Integrate Auth0 with own Spring boot application

Hi all,

I am totally new to Auth0 product. I created Auth0 free account and tested login, sign up options. I need to integrate Auth0 for my spring boot application. Current application have mysql database and user, roles manage by my own code. Free account don’t support for connect external database. I can’t go that way.

Current application have two user types called Admin and General User. Current application use these types as Roles (Admin and Student).

In my understanding I need to follow these steps. (Use universal login provide by Auth0)

  1. Sign IN : After successful sign up take Auth_code from response and take access token form /auth/token end point.
  2. Sign UP : After successful sign up take Auth_code and take access token after that. Then take email by decoding token and insert user record to my existing database.

Is this the correct flow. If not what is the good way to do that.

Students can register to system without any restriction and they directly register with STUDENT role. Admins can create by another admin. How I can manage Role base user creation using my client application.