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

**URL:** <https://meta.discourse.org/t/how-to-set-authorization-token-in-request-headers-when-user-attempts-to-login-on-discourse/246464>\
**Category:** SSO\
**Created:** [November 22, 2022, 7:56pm UTC](https://meta.discourse.org/t/how-to-set-authorization-token-in-request-headers-when-user-attempts-to-login-on-discourse/246464 "2022-11-22T19:56:41Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![csgeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csgeek/32/281897_2.png) [@csgeek](https://meta.discourse.org/u/csgeek)\
**Post date:** [November 22, 2022, 7:56pm UTC](https://meta.discourse.org/t/how-to-set-authorization-token-in-request-headers-when-user-attempts-to-login-on-discourse/246464/1 "2022-11-22T19:56:41Z")

</div>

Hello all,

I am working on integrating my freshly built discourse community with my website. I have also implemented SSO ([DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)). Everything works fine on Postman.

The problem is I am stuck integrating those.

I can perform authentication in Postman by passing the authentication token in request headers. But I am unable to figure out how to pass the Authentication token in request headers when the user attempts to log in via my discourse website.

In other words, how do I set the Authorization token (present in the browser’s localStorage) in the request headers of the URL that is being sent to my backend?

**My tech stack** :- React, Django-rest

**For a better understanding please take a look at the following** :-

 ![doubt](https://global.discourse-cdn.com/meta/original/4X/b/a/a/baa7879bac85e7a5d982c74328befb183f51eec7.png)

**Response:-**  
`http://discuss.example.com/session/sso_login?sso=bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGImbmFtZT1zYW0mdXNlcm5hbWU9c2Ftc2FtJmVtYWlsPXRlc3QlNDB0ZXN0LmNvbSZleHRlcm5hbF9pZD1oZWxsbzEyMyZyZXF1aXJlX2FjdGl2YXRpb249dHJ1ZQ%3D%3D&sig=3d7e5ac755a87ae3ccf90272644ed2207984db03cf020377c8b92ff51be3abc3`

In the above request, I am explicitly setting the Authorization token to the request headers.

While integrating, how can I set the token (present in the browser’s localStorage) to request headers while redirecting the request to my backend?

I’m a _newbie_.

---

_[View the full topic](https://meta.discourse.org/t/how-to-set-authorization-token-in-request-headers-when-user-attempts-to-login-on-discourse/246464)._
