In my application I have data associated with a user (scores, results etc). The association between application data in by database and auth0 users is done by the ID I receive from the access token.
In one use case my application can display a high score list to the user eg.
- Bob 1000pts
- Joe 500pts
- Robin 450pts
Currently my flow to acheive this result is planned to be as follows:
The Frontend app signs in with Auth0 and retrieves an access token including a UserID
This Accesstoken is passed to my API Backend and the high scores are are queried from the database.
This dataset is a list of UserIds and their associated scores:
- ID-asds-asdfas 1000pts
- ID-sdfg-werwad 500pts
- ID-asdf-asdfasd 450pts
I don’t want to display a highscore list of userIds so my API backend then queries Auth0 to retrieve the usernames associated with the UserIds. This list of username+scores is returned to the Frontend app.
Is this the correct approach?