Fire SSO Login to discourse onLogIn on external site

We are using discourse with SSO and it works great.

However, I am running into an odd situation.

  • We are leveraging Discourse private messaging links on our external site ( to spawn a new private message on discourse (
  • If the user is logged in to the forums, it works exactly as expected.
  • If the user logs in to (but doesn’t go to the forums first) when the user clicks on the link to spawn a new message, it simply opens the forums (without spawning a new message)
  • If the user clicks on the message link a second time, then the message works.

It seems to me that the issue is that while the user is logged in to, they are not logged into the forums until they view a page on

Here is an example classified ad so you can see the process:

Is there a way to fire the SSO login (to upon login on the external site (

I found one reference that could work.:

You might be able to use the approach outlined here: Compose a new pre-filled personal message via URL. I haven’t tried using it with the return_path set to compose a prefilled PM, but I think it could be made to work.

1 Like

The pre-filled personal message works fine (as long as the user is logged in). I will have our dev look at using the return_path

I just re-read my previous reply. What I had meant to write was that the approach outlined in this topic should work: Create an SSO login link. This is how our WordPress plugin creates links that automatically log users into Discourse. What I haven’t tested is using this approach with a pre-filled message URL set for the return_path.

Let me know if that still isn’t clear.

1 Like

@simon thanks so much for the clarification. That makes more sense now. I will test it out and update here.

1 Like

Quick update @simon - it worked perfectly.

Thanks for your help.


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