Sites using DiscourseConnect sometimes want to include links on their DiscourseConnect provider site that will log users into Discourse and redirect them to a specific Discourse URL. This can be done by creating an anchor on the SSO provider site with an href
property that points to /session/sso
and has a return_path
parameter set to the Discourse URL you want users to end up on.
The link’s href
property should be in this form:
https://forum.example.com/session/sso?return_path=https://forum.example.com/your-discourse-endpoint
Here’s a full anchor that will log in a user and redirect them to a URL:
<a href="https://forum.example.com/session/sso?return_path=https://forum.example.com/your-discourse-endpoint">Link Text</a>