Auth0 Home Blog Docs

GO CLI application, how to retrieve usedID



I have followed the examples on how to use a checkJwt to control access to given API paths. However, I need to retrieve also user data (like the user ID). How can I do it?


To get the user information you can call the [GET /userinfo] ( endpoint. Given the Auth0 Access Token obtained during login, this endpoint returns a user’s profile. This endpoint will work only if openid was granted as a scope for the access_token.

Just as additional information about Go, you can also see more information about authenticating and getting the user profile in a webapp [here] ( and [here] (


What I have is not a web too, but what auth0 calls non interactive app (for me it is just a CLI server) implementing the API. I believe the get call will work!


So I tried, but I get some gibberish response and no idea what to do with it.
Do I need to define a struct and use JSON.UNMARSHALL on the repose body, or what else?
Thanks for any help.
Also, the scope opened is for clients. Here it is the API app that needs to retrieve the data. Basically an android client does the login, then it sends the token with some data to an API which needs to retrieve the userID and store the data the client sent.


TO add the android client had scope openID