# "push" sso users to discourse?

**URL:** https://meta.discourse.org/t/push-sso-users-to-discourse/183949
**Category:** SSO
**Created:** [March 21, 2021, 3:47pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949 "2021-03-21T15:47:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mrkurt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mrkurt/32/189547_2.png) [@mrkurt](https://meta.discourse.org/u/mrkurt)
#### Post date: [March 21, 2021, 3:47pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949/1 "2021-03-21T15:47:35Z")

</div>

We want to programmatically create new topics for our users from a backend service. Is it possible to push a SSO user to discourse without them going through the login flow?

---

<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: [March 22, 2021, 5:05pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949/2 "2021-03-22T17:05:34Z")

</div>

If you are using [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) to authenticate users on your site, you can create or update users programmatically with this method: [Sync DiscourseConnect user data with the sync\_sso route](https://meta.discourse.org/t/sync-discourseconnect-user-data-with-the-sync-sso-route/84398). Note that this doesn’t log the user into Discourse, it just creates the user. If that is not what you are trying to accomplish, send us more details about what you are wanting to do.

---

<div class="post-metadata">

### Author: ![mrkurt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mrkurt/32/189547_2.png) [@mrkurt](https://meta.discourse.org/u/mrkurt)
#### Post date: [March 23, 2021, 4:11pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949/3 "2021-03-23T16:11:31Z")

</div>

We are! That’s perfect.

Incidentally, we wouldn’t need to do this if the [new topic parameters](https://meta.discourse.org/t/compose-a-new-pre-filled-topic-via-url/28074) survived the SSO sign on flow. We can’t find the right incantation to make that work, though, so it dumps people to a blank topic form if they aren’t already logged in. I can file that as a bug somewhere if you consider it a bug. :slight_smile:

---

<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: [March 23, 2021, 5:15pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949/4 "2021-03-23T17:15:37Z")

</div>

> [@mrkurt](#):
>
> Incidentally, we wouldn’t need to do this if the [new topic parameters](https://meta.discourse.org/t/compose-a-new-pre-filled-topic-via-url/28074) survived the SSO sign on flow.

It should be possible to get that to work. If the parameters are being stripped, I suspect they are being stripped by the SSO code you are using, not by Discourse. Have a look at this post for details: [Creating pre-filled personal message links - #11](https://meta.discourse.org/t/compose-a-new-pre-filled-personal-message-via-url/35984/11). Note that the example URL in that post is creating a new PM, not a new topic. The same approach should work for creating a new topic though.

---

<div class="post-metadata">

### Author: ![mrkurt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mrkurt/32/189547_2.png) [@mrkurt](https://meta.discourse.org/u/mrkurt)
#### Post date: [March 23, 2021, 6:06pm UTC](https://meta.discourse.org/t/push-sso-users-to-discourse/183949/5 "2021-03-23T18:06:33Z")

</div>

Oh that does work! Nice. This URL doesn’t return to right, but it’s super easy to link to the SSO URL:

````plaintext
http://localhost:3000/new-topic?title=wat&category=questions-and-help/build-debugging&tags=build```
````
