The claim preferred_username is optional in Azure AD [1] . Although it is listed as preferred, in some enterprise environment it's not possible to add this additional claim. unique_name and upn are legacy alternatives
Awesome! Can you please add a test against your new function? And maybe you would like to make the claim configurable as well in addition to the hardcoded ones?
The claim
preferred_username
is optional in Azure AD [1] . Although it is listed as preferred, in some enterprise environment it's not possible to add this additional claim.unique_name
andupn
are legacy alternatives[1] - https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-optional-claims#v10-specific-optional-claims-set