# How to get the actual "sub"

**URL:** <https://community.auth0.com/t/how-to-get-the-actual-sub/64102>\
**Category:** Get Help\
**Tags:** jwt\
**Created:** [June 8, 2021, 12:13pm UTC](https://community.auth0.com/t/how-to-get-the-actual-sub/64102 "2021-06-08T12:13:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanjiaqi00](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tanjiaqi00/32/29873_2.png) [@tanjiaqi00](https://community.auth0.com/u/tanjiaqi00)\
**Post date:** [June 8, 2021, 12:13pm UTC](https://community.auth0.com/t/how-to-get-the-actual-sub/64102/1 "2021-06-08T12:13:20Z")

</div>

Does anyone know how to get the exact “sub” from the access token in python?

I’m currently getting {“sub”: “client\_id@clients”} instead of getting this (picture below):

![image](https://global.discourse-cdn.com/auth0/original/3X/4/e/4ed6198cd4ddd226c3cf3df01b1aef0bb28902f5.png)

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [June 8, 2021, 7:21pm UTC](https://community.auth0.com/t/how-to-get-the-actual-sub/64102/3 "2021-06-08T19:21:57Z")

</div>

Hi @tanjiaqi00,

Welcome to the Community!

That looks like an Access Token for a Machine-to-Machine app, is that correct?

The `sub` will list the ID of the entity that is authorized to use the Access Token. For M2M apps, this is the client application. When using other types a flows that include an end user, the sub will show the user’s ID. It looks like the screenshot is displaying a decoded Access Token from a non-M2M flow, and so it is showing a user ID.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 25, 2021, 1:06pm UTC](https://community.auth0.com/t/how-to-get-the-actual-sub/64102/4 "2021-06-25T13:06:18Z")

</div>

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