# Getting incorrect current user details in the request header.

**URL:** <https://community.hubspot.com/t/getting-incorrect-current-user-details-in-the-request-header/122973>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [December 24, 2024, 4:36am UTC](https://community.hubspot.com/t/getting-incorrect-current-user-details-in-the-request-header/122973 "2024-12-24T04:36:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VMourya](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@VMourya](https://community.hubspot.com/u/VMourya)\
**Post date:** [December 24, 2024, 4:36am UTC](https://community.hubspot.com/t/getting-incorrect-current-user-details-in-the-request-header/122973/1 "2024-12-24T04:36:28Z")

</div>

I am making an huspot public app, this app is highly user-specific so i am using a middlware function **validateToken**

```auto
router.get(
 "/hubspot/contacts/properties",
 authMiddleware.validateToken,
 HubspotController.getContactProperties
);

```

But in the header of the request I am getting the userId and access token of user who installed the my app not the onw who is currently using. How can i get the userId of the current user who is using my app?  
Please Help me out !

---

<div class="post-metadata">

**Author:** ![PamCotton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pamcotton/32/47916_2.png) [@PamCotton](https://community.hubspot.com/u/PamCotton)\
**Post date:** [December 27, 2024, 2:30pm UTC](https://community.hubspot.com/t/getting-incorrect-current-user-details-in-the-request-header/122973/2 "2024-12-27T14:30:54Z")

</div>

Hey @VMourya, thank you for posting in our Community!

This issue happens because HubSpot OAuth tokens are issued at the app installation level, meaning the token corresponds to the _user who installed the app,_ not the current user interacting with it.

One approach is using the **HubSpot authentication API** to retrieve user-specific details when interacting with your app. You can capture the current user’s identity via HubSpot’s [User Information API](https://developers.hubspot.com/docs/guides/api/settings/users/user-details) by passing their access token to verify and fetch user details. Make sure to store and validate the token on a per-user basis to differentiate users within your app.

I hope this information helps.

Pam
