How to get registered user data from token in PHP API?

Hello, I have a problem that I don’t know how to solve, from the front I am using Angular in which I log in and it sends the token of the user who logged in to the PHP API in Bearer Token.

The problem is that I can’t get the data of the user who logged in. Now I show you an example of my code.

Esta es la configuracion que tengo, misma que en el front.

In the endpoint I make a function to obtain the token declared in the variable $token which I would have to use to obtain the user’s data, how could I obtain that data?

Thank you so much. I hope you can help me

Hi @federicoj.rodriguez,

Welcome to the Auth0 Community!

This example shows how to get the token in PHP:

You need to decode the token to see it’s claims. If this doesn’t solve it, please share an example token you are seeing (with sensitive data removed).


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