0
Answered

Add user to private forum allowed list

Richard Sloggett (Support) 7 years ago in API • updated by Vladimir Mullagaliyev (co-founder) 2 years ago 13
Is there a way through the API for us to add a user to the "allowed user" list for a private forum? We want to automatically allow new beta users to get forum access.

Answers

Answer
Answered
It's possible using Single Sign On function 

Just pass additional parameter allowed_private_forums: [forum_id],
inside SSO token.
PINNED
Many thanks for your help with this - up and running now. Your support is excellent. Feel free to use the VB.NET SSO_TOKEN generation code I sent - might help someone else get up and running with a VB.NET site.
Under review
It's possible using Single Sign On function 

Just pass additional parameter allowed_private_forums: [forum_id],
inside SSO token.
Thanks for your reply. I'm getting a "This Forum is private" message when trying this. I have checked that SSO users are enabled for the private forum I am testing with and have verified that my project key and api key are correct.

I'm unsure if I have used the correct value for Forum Id. This is what my Json string looks like before encryption - does this look right?

{"guid":"test@test.net",
"expires_date":"2012-01-25 10:03:05",
"display_name":"Test User",
"email":"test@test.net",
"locale":"en",
allowed_private_forums:10506}

Is there a way for me to test my SSO_TOKEN? Just a suggestion, but it would be handy to have a page I can redirect to with the SSO_TOKEN that would validate it for me so I know that bit is correct.
Your Private forum Liminitix has id 10505
Also put allowed_private option in double quotes like other parameters
Thanks for the follow up. I've added quotes around the parameter name (also tried around the parameter value too), like so:

{"guid":"test@test.net",

"expires_date":"2012-01-25 10:03:05",

"display_name":"Test User",

"email":"test@test.net",

"locale":"en",

"allowed_private_forums":10505}



.. but still get the same "forum is private" error. Here is my url including SSO token for my latest attempt:

http://innovasys.userecho.com?sso_token="j6lFH53WSI63+0RVrrvmLOAo5ULNrRMNgJVfgtcFVSsr/2X+Z1dYSpCOXRQELbeMoonfOHTa8LhcP8Yj+6rttqzqJ3QGMlIz5o80EGGW3ucTlX1+sHEiss0p0FqnbEbHSyTzs28aq2tXmudkcLmxfc8nnsth1LD+kjVCKL9y7R/Yq2kjj72Cijld7CNy9IBqwAdg4Uehy0ZxQ58JeNRN/KA4wF2q3h0KT6hiPfNvIEi6c76CZlwXYTkHvy9lFI2/"
We checked your token decoder fails when trying base64 decode.
Can you send your function that generates SSO_TOKEN to info@userecho.com
It's will be fastest way to localize and fix issue.
Post here your SSO_TOKEN we  validate it for you, also we prepare token validation link soon.
We checked your code and find out solution.
Just replace '+' symbol to '%2B at the final SSO_TOKEN

Something like this
.Replace("+", "%2B");
Many thanks for this - I have added HttpUtility.UrlEncode call to make sure the SSO_TOKEN is correctly url encoded.

I'm now seeing a different problem - when I try and visit the private forum using our token url I now don't get the "private forum" message, but instead I see:

We are updating UserEcho please refresh page after few seconds

I waited a few minutes (about 30 so far) but the message doesn't change. If I log in manually from the main userecho page, I can get to the forum Ok.
Try to put forum_id in square brackets

"allowed_private_forums":[10505]

PINNED
Many thanks for your help with this - up and running now. Your support is excellent. Feel free to use the VB.NET SSO_TOKEN generation code I sent - might help someone else get up and running with a VB.NET site.
Answer
Answered
It's possible using Single Sign On function 

Just pass additional parameter allowed_private_forums: [forum_id],
inside SSO token.

What is [forum_id]? I my userecho server is returning:{ "status": "error", "message": "Forum doesn't exist" }

Replace the [forum_id] with ID of your forum. Go to your Project Settings -> Community forums and check ID for selected forum.