Discourse Logout URL


(UserXtreamz) #1

I am using Single Sign On for discourse authentication.Once the user logout from the main website.At the same time i need to log out from the discourse also.

I just tried with the following api but its not working for me…


(Sam Saffron) #2

There is a site setting for “logout redirect” just go ahead and set that.

(UserXtreamz) #3

That is enabled for me but it’s not working on my end.
when use “/admin/users/USER_ID/log_out” this URL for user log out

I am getting “[‘BAD CSRF’]” Error.

(Sam Saffron) #4

makes no sense, you should not be using that URL, if you want to logout a user via API use our API gem.

If you want the system to redirect you to a particular spot when users log out, set the site setting.

(UserXtreamz) #6

I need to log out the user via API call. is it possible through this “/admin/users/USER_ID/log_out” APi call?

(Sam Saffron) #7

Yes, use the discourse api gem

(UserXtreamz) #10

I already tried with “http://discourse.site.com/admin/users/10/log_out” for user logout .But it’s not working…
Do i need any other settings for this?

(Sam Saffron) #11

take a step back … what if we allowed you to simply post to that URL and log users out.

I would be able to log out every user in your forum from this computer.

We have security … see discourse_api gem for example usage.

(UserXtreamz) #12

For enabling this API. Do we need to do the following steps to my discourse instance.Is it right?
Using the Discourse API Ruby Gem