ARTIFACTORY: How to resolve the “Error handling OAuth2 login: No email was found on the OAuth response” error when setting up Azure OpenID

ARTIFACTORY: How to resolve the “Error handling OAuth2 login: No email was found on the OAuth response” error when setting up Azure OpenID

AuthorFullName__c
DaYoun Kang
articleNumber
000006141
ft:sourceType
Salesforce
FirstPublishedDate
2024-07-09T05:55:56Z
lastModifiedDate
2024-07-09T05:58:26Z
VersionNumber
1

When integrating Artifactory with Azure OpenID following this KB article here, we sometimes encounter errors like below:

Error handling OAuth2 login: No email was found on the OAuth response
As explained in the linked article, this error occurs when Artifactory is looking for a property in the returned JSON response but could not find it.
From Artifactory 7.4.0, we can set the below property to $ARTIFACTORY_HOME/etc/artifactory/artifactory.system.properties file and restart Artifactory to tell Artifactory to use this identifier from the Open ID response:
artifactory.oauth.user.info.identifier=xxx

But what if setting the above property still results in the same error?
The answer is, it’s likely that you’re not using an identifier returned from the below UserInfo response.
See the below sample UserInfo response from the Azure document here:
User-added image
The claims shown in the above response are the only claims returned.

Therefore, when setting the above property, “artifactory.oauth.user.info.identifier”, we should set it to one of the claims returned from the above UserInfo response.

E.g.
artifactory.oauth.user.info.identifier=name
artifactory.oauth.user.info.identifier=email