Discourse API - Login case SSO Provider to Consumer site

(Junaid Mailk) #1


We are working on integrating Main Rails app with Discourse forum. Our Main rails app is SSO provider and forum is SSO consumer. We want to implement the case of automatic login on SSO consumer site when user successfully login on main Rails site. I explored the code of Discourse API gem(GitHub - discourse/discourse_api: Ruby API for Discourse) and weservices code in the discourse app(admin/users_controller.rb). I think it can be implemented the above case easily as you implemented the log_out webservice code. All we need to return session cookie in webservice after successfully setting auth code to user and api consumer will create cookie on their end with relevant domain name depending type of url scheme(directory based or sub-domain) your Main rails app & forum app url have. Is Discourse team have any plan for its implementation? Discourse Meta don’t exist mentioned here Official Single-Sign-On for Discourse (sso)).

I also opened a SSO related issue(SSO login & logout issues) 2 days back in ‘Support’ category but didn’t receive any feedback on it.


(Vinoth Kannan) #2

Alternatively you can simply open discourse’s sso call (https://discourse.example.com/login) on iframe when user login on main Rails site.

I think it is moved here sso - Discourse Meta

(Kane York) #3

Yep. Do this: