Maping custom data to user authenticated by okta

Let’s say I want to build ToDo app with Okta authentication.

I need to store users’ tasks in the relational database.

The user has to have the ability to query only his tasks.

What user property should I use as a user identifier in my database?

In access token, I can see claims like uid and sub which seems to be suitable for my needs.

Unfortunately, both of them are strings instead of numeric values.

Using them as tables’ primary key seems like a very inefficient idea.

Could you recommend a better way of achieving my goal?

Sub is usually the best value to use. It’s a unique identifier.

The ‘sub’ claim is the user’s email. I is immutable?

Hi @pkpkpk

The sub claim inside the ID token represents the user’s Okta ID and it’s immutable.
For the acces token, the sub claim represents the “Username” field that is populated for the user under Admin >> Applications >> application >> Assignments >> user >> pencil icon.

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