bas*_*lio 13 adfs saml saml-2.0 azure-active-directory azure-ad-b2c
我需要一个带有自定义策略的联合身份验证(当用户通过身份验证时,我需要他在 b2c 用户中显示为联合身份,而不是其他人或其他我可以用单个租户实现的东西),我以前在 azure 中将默认策略设置为 OpenId提供者,但没有找到如何在自定义策略中使用 OpenId 进行 FEDERATION 身份验证,所以我使用 SAML 和我所拥有的以下内容进行了验证。
我试过单租户,这不是我需要的。问题也不在于签名密钥,因为我已经遇到了这个问题并解决了这个问题。我创建了自签名证书,先将其上传到 AAD 应用程序,然后再上传到 b2c 策略密钥。我认为验证联邦的应用程序不是问题,因为我使用默认策略。
<TechnicalProfile Id="Office-SAML2">
<DisplayName>Microsoft Office 365</DisplayName>
<Description>Login with your ADFS account</Description>
<Protocol Name="SAML2"/>
<Metadata>
<Item Key="WantsSignedRequests">false</Item>
<Item Key="PartnerEntity">https://login.microsoftonline.com/<b2c tenant id>/federationmetadata/2007-06/federationmetadata.xml</Item>
<Item Key="XmlSignatureAlgorithm">Sha256</Item>
</Metadata>
<CryptographicKeys>
<Key Id="SamlAssertionSigning" StorageReferenceId="B2C_1A_SamlCert"/>
<Key Id="SamlMessageSigning" StorageReferenceId="B2C_1A_SamlCert"/>
</CryptographicKeys>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name"/>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name"/>
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email"/>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name"/>
<OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="https://sts.windows.net/<b2c tenant id>/" AlwaysUseDefaultValue="true" />
<OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" />
</OutputClaims>
<OutputClaimsTransformations>
<OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName"/>
<OutputClaimsTransformation ReferenceId="CreateUserPrincipalName"/>
<OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId"/>
<OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId"/>
</OutputClaimsTransformations>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop"/>
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
这里的问题是 AAD 应用程序注册的标识符 URI 与身份验证请求中请求的标识符 URI 不匹配。您可以通过以下方式修复此问题:
Single Sign-On
菜单。Identifier (Entity ID)
中 您还需要正确的Reply URL
:
https://contoso.b2clogin.com/te/contoso.onmicrosoft.com/<policyd of Base>/samlp/sso/assertionconsumer
您最好使用 OpenId (它还允许多租户访问): https:
//learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-setup-aad-custom
归档时间: |
|
查看次数: |
35170 次 |
最近记录: |