Integrate discourse authentication with external service which is token base authentication

I want to integrate discourse authentication with my service but I have some issue.

At first My web service is Single Page Application and authentication is token base.

Flow of register is Facebook auth through Firebase auth then once user is created in my server, user interact with service by token issued from my service.

To my understand SSO of Discourse access session information in the cookie from subdomain so token base authentication system can’t use SSO easily right?

So I tried to oauth2 but when user from discourse try to request authentication, my service couldn’t judge user is correct or not because my service and firbase auth doesn’t have any credential information of user except token.

The idea which I’ve only came out is extending discourse for embedding iframe to get access localstorage from subdomain…

Are there good ideas or good plugins to do like above?

Same as me. This is a critical problem for us.

Same here.

One possible solution that seems straightforward: Is there a way to pass custom query parameters to the Discourse site’s /session/sso endpoint to allow additional data to be added to the payload passed through the SSO system? If so, the token could be passed through successfully using something like:

https://mydiscoursesite.mydomain.com/session/sso?token=abc123

(I should say I tried the above, but the extra parameter was not incorporated into the SSO payload.)