I have a web app and I’m using Okta for login & signup and then storing extra profile details in my local database in a users table.
Now I need to get the user’s unique ID from Okta in order to link it to a unique record in my user’s table.
So what I thought was unique was the .sub field when you call
But this turns out to be not the case, so looking thru the documentation if you do:
const accessToken = await this.props.auth.getAccessToken(); const userinfo = await this.props.auth.getUser(accessToken);
Then doing the getUser call while giving it your accessToken it retrieves the unique id,
Though it still returns it in the sub attribute of the userinfo object.
Am I right?
Really hope this is the case?