Problem in sso redirection for compose a new pre-filled topic via URL

Hello

I am implementing my own authenticating service as SSO provider for discourse. Its working fine. But when my users (not logged in users) open a pre-filled topic URL then they wont see those pre-filled data after redirect back to discourse.

full scenario:

  • Not logged in user opens a pre-filled topic creation URL
  • He automatically redirected to SSO page
  • He logged in using SSO and redirect back to http://discourse_site/session/sso_login?....
  • Here I expect user to see topic creation box with filled data but discourse just shows latest topic page. Not even showing the create topic box

Can anyone help me on this issue? Are there any problem in my setting or its a bug?

I can also confirm that if I am in a specific topic and press login the redirect will work fine and I will return to that topic.

2 Likes

Try using the approach that’s outlined here: Compose a new pre-filled personal message via URL - #11 by simon.

2 Likes

Ok It is working. Thank you very much

old message:

Thank @simon for your replay. Unfortunatly I couldn’t make it working. In your link it said to use a url like

http://localhost:3000/session/sso?return_path=http%3A%2F%2Flocalhost%3A3000%2Fnew-message%3Fusername%3Dscossar%26title%3DInformation+requested+about+gentle+yoga+classes
Firstly I supposed to add it to stage 6 of official discourse SSO doc. So it would be like:

http://discourse_site/session/sso_login?sso=payload&sig=sig&return_path=https%3A%2F%2Fdiscourse_site%2Fnew-message%3Fusername%3Dscossar%26title%3DInformation%2Brequested%2Babout%2Bgentle%2Byoga%2Bclasses

But it didn’t work. So I start to test it in different places and none of them worked. Would you please elaborate more on were I should put return_path?

1 Like

All you should need to do is create a link in the form given in that post. You’ll need to substitute the correct URL of your Discourse site, and change the username from scossar to a username that exists on your site. Do not add the payload or sig parameters to the link. That should all be taken care of by your existing SSO implementation. All that the return_path parameter is doing is redirecting the user to a URL that will create the prefilled topic.

Note that in the example I linked to, I’m creating a prefilled message, not a prefilled topic. You’ll need to adjust the return_path given in the example code to create a topic instead of a message.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.