How to set Authorization token in request headers when user attempts to login on discourse

Hi @Ankit_Kumar_Jha, I found a way to do it.
I have set-up the discourse-connect url in dashboard settings to the frontend url of my main site.

Let’s say example.com is my frontend site and discuss.example.com is my discourse site. I have set-up the discourse connect url to something like https://example.com/discourse-sso/. From this frontend site URL i am sending a request to my backend API endpoint. In this request i am storing the authorization token in headers.

Voila!

1 Like