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

**URL:** https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916
**Category:** Support
**Created:** [February 1, 2021, 6:13am UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916 "2021-02-01T06:13:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![a.golmirzaei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/a.golmirzaei/32/207880_2.png) [@a.golmirzaei](https://meta.discourse.org/u/a.golmirzaei)
#### Post date: [February 1, 2021, 6:13am UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916/1 "2021-02-01T06:13:52Z")

</div>

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](https://meta.discourse.org/t/compose-a-new-pre-filled-topic-via-url/28074) 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.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 1, 2021, 7:29pm UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916/2 "2021-02-01T19:29:46Z")

</div>

Try using the approach that’s outlined here: [Creating pre-filled personal message links - #11](https://meta.discourse.org/t/compose-a-new-pre-filled-personal-message-via-url/35984/11).

---

<div class="post-metadata">

### Author: ![a.golmirzaei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/a.golmirzaei/32/207880_2.png) [@a.golmirzaei](https://meta.discourse.org/u/a.golmirzaei)
#### Post date: [February 2, 2021, 2:49pm UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916/3 "2021-02-02T14:49:43Z")

</div>

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](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045). 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`?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 2, 2021, 8:53pm UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916/4 "2021-02-02T20:53:12Z")

</div>

> [@a.golmirzaei](#):
>
> Would you please elaborate more on were I should put `return_path` ?

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.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 4, 2021, 8:54pm UTC](https://meta.discourse.org/t/problem-in-sso-redirection-for-compose-a-new-pre-filled-topic-via-url/177916/5 "2021-03-04T20:54:07Z")

</div>

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