# Authentication API vs Management API for getting logged in user info

**URL:** <https://community.auth0.com/t/authentication-api-vs-management-api-for-getting-logged-in-user-info/138541>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [July 10, 2024, 8:55am UTC](https://community.auth0.com/t/authentication-api-vs-management-api-for-getting-logged-in-user-info/138541 "2024-07-10T08:55:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valevaws](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/valevaws/32/58464_2.png) [@valevaws](https://community.auth0.com/u/valevaws)\
**Post date:** [July 10, 2024, 8:55am UTC](https://community.auth0.com/t/authentication-api-vs-management-api-for-getting-logged-in-user-info/138541/1 "2024-07-10T08:55:33Z")

</div>

Hey there,

I am new to Auth0 and have just implemented the Authorisation Code Flow via Go by following the quickstart [here](https://auth0.com/docs/quickstart/webapp/golang/interactive). I think Auth0 is amazing product and really enjoyed the hassle-free implementation for a regular web app.

Our tech stack is Go + Echo, so I had to change a bit the provided example as it uses chi.

Our goal is to get user information for the logged in user from within the web app, so that we can grab its unique identifier, email and name and put them into our own application database so that we can have an entrypoint for app specific table relations.

We want to obtain this info on the backend (Go) during runtime and persist the info in our database. What is the best practice here - do we use the Auth API or the Management API, what are the consequences?

We also suspect we can also get most of the needed info from the user profile claim obtained in our callbackHandler function. This seems like the fastest option, however is it also the most secure and viable one?

Many thanks! Looking forward to your answers!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 15, 2024, 8:38pm UTC](https://community.auth0.com/t/authentication-api-vs-management-api-for-getting-logged-in-user-info/138541/3 "2024-07-15T20:38:57Z")

</div>

Hey there @valevaws welcome to the community!

> [@valevaws](#):
>
> I think Auth0 is amazing product and really enjoyed the hassle-free implementation for a regular web app.

Awesome 😄

> [@valevaws](#):
>
> We want to obtain this info on the backend (Go) during runtime and persist the info in our database. What is the best practice here - do we use the Auth API or the Management API, what are the consequences?

The easiest route from your backend is to call the [userinfo](https://auth0.com/docs/api/authentication#get-user-info) with a user’s access token. The Management API is feasible, but definitely more involved.

> [@valevaws](#):
>
> We also suspect we can also get most of the needed info from the user profile claim obtained in our callbackHandler function. This seems like the fastest option, however is it also the most secure and viable one?

You could indeed also rely on the claims within the ID token, but these could vary as opposed to the full data from `/userinfo`.

---

<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:** [July 29, 2024, 8:39pm UTC](https://community.auth0.com/t/authentication-api-vs-management-api-for-getting-logged-in-user-info/138541/4 "2024-07-29T20:39:29Z")

</div>

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