Remote login from main domain to subdomain


#1

Hi i’ve got a site.
subdomain.domain.com (discourse) and domain.com (main site)
When a user signs up to my main site I’d like to log him into discourse on my sub domain. Is there a URL I should redirect him to that can automatically log him into discourse and then bounce him back to my main site? Similar to the way udacity does it.

Thanks.


(Bhanu Sharma) #2

This can be achieved if you set up a login flow with SSO. I don’t have a good reference in hand but this happens from the SSO provider’s side where they log you in to all connected applications using some kind of URL redirect.

https://auth.udacity.com/sign-in?next=http%3A%2F%2Fforums-api.udacity.com%2Fapi%2Fv1%2Fsso%3Fsso%3Dbm9uY2U9YTk4ODBiMTZkOTU0YmM1NjkzODBkZmIyNzUyMjA0ZDAmcmV0dXJuX3Nzb191cmw9aHR0cHMlM0ElMkYlMkZkaXNjdXNzaW9ucy51ZGFjaXR5LmNvbSUyRnNlc3Npb24lMkZzc29fbG9naW4%253D%26sig%3Da485e4592f9f4efcf96c826622d003c73d688b054d7b01761a70873ba9b16a2c
As you could see this is purely based off their SSO.


(Jay Pfaffman) #3

Does your main site run WordPress? If so, the wp-discourse plugin will solve your problem. If it’s something else, you’ll likely need to do some work to get SSO working.