# Catch editors 'access\_token' from httpAdminMiddleware

**URL:** <https://discourse.nodered.org/t/catch-editors-access-token-from-httpadminmiddleware/50193>\
**Category:** General\
**Tags:** http-request\
**Created:** [26 August 2021 05:32 UTC](https://discourse.nodered.org/t/catch-editors-access-token-from-httpadminmiddleware/50193 "2021-08-26T05:32:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daft11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/daft11/32/46631_2.png) [@Daft11](https://discourse.nodered.org/u/Daft11)\
**Post date:** [26 August 2021 05:32 UTC](https://discourse.nodered.org/t/catch-editors-access-token-from-httpadminmiddleware/50193/1 "2021-08-26T05:32:50Z")

</div>

Good day, ladies and gentlemen. Need your expertise.

With help of other topics from this forum I managed to configure my adminAuth module. It's working great! I chose as an option to pass access\_token through editor url query (?access\_token=\<ACCESS\_TOKEN\>).

The main question is.  
Can i have an access to this token from httpAdminMiddleware? I tried to catch it from request referrer but somehow referrer shows in request without queries.  
looks like this: [http://127.0.0.1:1880/?](http://127.0.0.1:1880/?)  
Maybe there is the way to fix this behavior or any other way to store data into current session and then receive it on httpAdminMiddleware.

I would also explain why i need this. On every request from Node-Red to my other server i need to provide some extra headers. I thought to manage it with httpAdminMiddleware and since Node-Red have express maybe you could recommend any better approach (something like express.use() on Node-Red requests)?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 August 2021 17:10 UTC](https://discourse.nodered.org/t/catch-editors-access-token-from-httpadminmiddleware/50193/2 "2021-08-26T17:10:30Z")

</div>

Have you checked the `req.headers`?

Both req and res are available to the middleware, the only question is - where in the stack the httpAdminMiddleware sits.

Also, don't forget that that middleware doesn't actually get called all that often because once you've loaded the Editor, you don't necessarily get that many admin web requests.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 October 2021 17:10 UTC](https://discourse.nodered.org/t/catch-editors-access-token-from-httpadminmiddleware/50193/3 "2021-10-25T17:10:35Z")

</div>

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