On my site, lets say
example.com, I have a link to my discourse site with a sso payload. For example
discourse.com/session/sso_provider?sso=afjakfj&sig=sdjfsdkfj. After the user clicks this link, If the user is not logged on to Discourse, the user is first redirected to the
discourse.com/login. When the user successfully enters their username and password, there is an ajax request in the background to the
return_sso_url stored in the payload; the page then proceeds to redirect the user to the index of
discourse.com. I expect the user to be redirected back to
For background see Using the Discourse SSO provider feature.