# First time usage React with Spring Boot

**URL:** <https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226>\
**Category:** Get Help\
**Tags:** jwt, login, auth0\
**Created:** [October 28, 2021, 6:36am UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226 "2021-10-28T06:36:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cycoraxdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cycoraxdev/32/32647_2.png) [@cycoraxdev](https://community.auth0.com/u/cycoraxdev)\
**Post date:** [October 28, 2021, 6:36am UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226/1 "2021-10-28T06:36:07Z")

</div>

I am first time user of auth0. I was able to create end to end flow between react front end and spring boot api by creating application and then API.

However few queries:

1. How do i enrich metadata for user from spring boot, to update say payment plan ?
2. I am currently using access token received from front end to call management api to get user info ?
3. What is best way to save userID received during login process from backend spring boot services ?

This is my first time, so need to know if auth0 is secured enough, and above mechanism are secured too with jwt ?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 29, 2021, 7:55pm UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226/3 "2021-10-29T19:55:49Z")

</div>

Hi @cycoraxdev,

Welcome to the Auth0 Community!

> [@cycoraxdev](#):
>
> How do i enrich metadata for user from spring boot, to update say payment plan ?

You will want to request a management API token in your backend application and update the user via the management API.

[https://auth0.com/docs/users/metadata/manage-metadata-api](https://auth0.com/docs/users/metadata/manage-metadata-api)

> [@cycoraxdev](#):
>
> I am currently using access token received from front end to call management api to get user info ?

The token you get is intended for the [/userinfo endpoint](https://auth0.com/docs/api/authentication#get-user-info). You could also use an ID token.

> [@cycoraxdev](#):
>
> What is best way to save userID received during login process from backend spring boot services ?

You can get the user id from the token via the `sub` claim.

---

<div class="post-metadata">

**Author:** ![cycoraxdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cycoraxdev/32/32647_2.png) [@cycoraxdev](https://community.auth0.com/u/cycoraxdev)\
**Post date:** [October 30, 2021, 6:21am UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226/4 "2021-10-30T06:21:41Z")

</div>

Thanks Dan. So we should always use Management Token to Update User or its metadata from backend ?

So when user logins once, we should call saveUser on our backend with access token and extract sub claim and save it you meant ? How to identify if it first time user registration ?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 1, 2021, 4:58pm UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226/5 "2021-11-01T16:58:04Z")

</div>

> [@cycoraxdev](#):
>
> So we should always use Management Token to Update User or its metadata from backend ?

It is possible to update the _user\_metadata_ from the frontend with a [SPA management API token](https://auth0.com/docs/security/tokens/access-tokens/get-management-api-tokens-for-single-page-applications), **but** you will not be able to update the user’s _app\_metadata_ from frontend app.

> **[Understand How Metadata Works in User Profiles](https://auth0.com/docs/manage-users/user-accounts/metadata)**
>
> Describes Auth0 user, application, and client metadata. Learn how you can use metadata to store information that does not originate from an identity provider.

> [@cycoraxdev](#):
>
> How to identify if it first time user registration ?

If the the specific sub claim does not exist in your user db then you can assume it’s a new user. Make sure you are validate the token is a signed token from Auth0.

---

<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:** [January 20, 2022, 11:03pm UTC](https://community.auth0.com/t/first-time-usage-react-with-spring-boot/72226/6 "2022-01-20T23:03:19Z")

</div>

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