Hi,
When I register an app in AAD, and then perform an OAuth2 / OpenID authentication, and then query the OpenID userinfo endpoint (https://graph.microsoft.com/oidc/userinfo) with the access_token, it returns a JSON like this:
{
"sub": "bPnSL00SVbZoFB97zHSwi9ksiT4bAzGxL2LKk2oaJcM",
"name": "steve",
"picture": "https://graph.microsoft.com/v1.0/me/photo/$value"
}
My question is - how is the 'sub' claim created?
Per the documentation, it returns a different value per application, but I would like to predict it up front to pre-load identities in the other application to have them automatically matched. I'm restricted in how I can do that, and can only use the 'sub' field from the userinfo response. ( I cannot change the application )
From:
https://learn.microsoft.com/en-us/azure/active-directory/develop/access-tokens
The subject is, however, a pairwise identifier - it is unique to a particular application ID. Therefore, if a single user signs into two different apps using two different client IDs, those apps will receive two different values for the subject claim.