How to get the actual "sub"

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

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.