Я использую настраиваемую политику для добавления Azure AD в качестве поставщика удостоверений для моего экземпляра Azure AdB2C.
Я настроил выходные утверждения для получения из Azure AD, но не все выставленные утверждения,
После нескольких часовпоиска, почему я не вижу все входные данные (только displayName, данное имя, отображаемая фамилия), я обнаружил, что проблема в том, что Azure AD не отображает утверждения в JWT,
Я пытался настроитьэто при манифесте регистрации приложения приложения - свойство «AdditionalClaims», но ничего…
Затем я нашел сценарий PowerShell, который решил проблему, и почти все утверждения, выставленные на JWT.Единственное утверждение, что я не нашел решения, это «мобильный».
Подскажите, пожалуйста, что я сделал не так?
Вот сценарий powerShell, который я создал:
Import-Module -Name AzureADPreview
Connect-AzureAD -Confirm
<# to set the policy use this#>
Set-AzureADPolicy -Definition @('{"ClaimsMappingPolicy":{"Version":1,"IncludeBasicClaimSet":"true","ClaimsSchema":[{"Source":"User","ID":"postalCode","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalCode","JwtClaimType":"postalCode"},{"Source":"User","ID":"streetAddress","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetAddress","JwtClaimType":"streetAddress"},{"Source":"User","ID":"othermail","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/othermail","JwtClaimType":"othermail"},{"Source":"User","ID":"country","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country","JwtClaimType":"country"},{"Source":"User","ID":"telephoneNumber","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/telephoneNumber","JwtClaimType":"telephoneNumber"},{"Source":"User","ID":"mobile","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobile","JwtClaimType":"mobile"},{"Source":"User","ID":"jobtitle","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/jobtitle","JwtClaimType":"jobtitle"},{"Source":"User","ID":"city","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/city","JwtClaimType":"city"},{"Source":"User","ID":"state","SamlClaimType":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/state","JwtClaimType":"state"}]}}') -DisplayName "ExtraClaimsExample" -Type "ClaimsMappingPolicy" -Id <the policyId>
Чтобы увидеть определение схемы, вы можете увидеть его здесь