Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Azure AD B2C中登录电子邮件域验证_Azure_Azure Active Directory_Azure Ad B2c - Fatal编程技术网

在Azure AD B2C中登录电子邮件域验证

在Azure AD B2C中登录电子邮件域验证,azure,azure-active-directory,azure-ad-b2c,Azure,Azure Active Directory,Azure Ad B2c,我使用链接中显示的步骤使用microsoft身份验证 这将打开一个Microsoft SSO页面以登录,该页面按预期工作。这使我们可以通过不同的microsoft托管电子邮件登录,如您的-email@hotmail.com,您的-email@outlook.com等。我现在要做的是添加一个验证,使电子邮件域绑定,例如,仅允许@outlook.com用户登录。我们如何使用自定义策略来实现这一点 我们尝试添加链接中建议的以下代码: 但无法上载此策略,并出现以下错误: Validation fai

我使用链接中显示的步骤使用microsoft身份验证

这将打开一个Microsoft SSO页面以登录,该页面按预期工作。这使我们可以通过不同的microsoft托管电子邮件登录,如
您的-email@hotmail.com
您的-email@outlook.com
等。我现在要做的是添加一个验证,使电子邮件域绑定,例如,仅允许
@outlook.com
用户登录。我们如何使用自定义策略来实现这一点

我们尝试添加链接中建议的以下代码:


但无法上载此策略,并出现以下错误:

Validation failed: 1 validation error(s) found in policy "B2C_1A_SIGNUP_SIGNIN" of tenant "<yor-tenant-id>.onmicrosoft.com".Invalid technical profile with id "Common-AAD" only the protocol handler ""Web.TPEngine.Providers.SelfAssertedAttributeProvider"" can have a ValidationTechnicalProfile.Invalid technical profile with id "Common-AAD" only the protocol handler ""Web.TPEngine.Providers.SelfAssertedAttributeProvider"" can have a ValidationTechnicalProfile.
验证失败:在租户的策略“B2C_1A_SIGNUP_SIGNIN”onmicrosoft.com中发现1个验证错误。id为“Common AAD”的无效技术配置文件只有协议处理程序“Web.TPEngine.Providers.SelfAssertedAttributeProvider”可以具有验证技术配置文件。id为“Common AAD”的无效技术配置文件只有协议处理程序“Web.TPEngine.Providers.SelfAssertedAttributeProvider”可以具有ValidationTechnicalProfile。
如果您有任何关于如何在Microsoft SSO中验证域的帮助,我们将不胜感激。 多谢各位

编辑: 技术概况如下:

 <TechnicalProfile Id="Common-AAD">
          <DisplayName>Microsoft Account or Microsoft-Connected Account</DisplayName>
          <Protocol Name="OpenIdConnect" />
          <OutputTokenFormat>JWT</OutputTokenFormat>
          <Metadata>
            <Item Key="authorization_endpoint">https://login.microsoftonline.com/common/oauth2/v2.0/authorize</Item>
            <Item Key="client_id">my-client-id</Item>
            <Item Key="DiscoverMetadataByTokenIssuer">true</Item>
            <Item Key="HttpBinding">POST</Item>
            <Item Key="IdTokenAudience">my-id</Item>
            <Item Key="response_types">id_token</Item>
            <Item Key="scope">openid profile email offline_access</Item>
            <Item Key="UsePolicyInRedirectUri">false</Item>
            <Item Key="ValidTokenIssuerPrefixes">https://login.microsoftonline.com/,https://sts.windows.net/</Item>
            <Item Key="METADATA">https://login.microsoftonline.com/common/.well-known/openid-configuration</Item>
          </Metadata>
          <CryptographicKeys>
            <!-- Make sure to update the reference ID of the client secret below you just created (B2C_1A_AADAppSecret) -->
            <Key Id="client_secret" StorageReferenceId="B2C_1A_AppSecret" />
          </CryptographicKeys>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" />
            <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
            <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
            <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
            <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
            <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="preferred_username" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="signInName" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </OutputClaims>
          <OutputClaimsTransformations>
            <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
            <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
            <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
            <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
          </OutputClaimsTransformations>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
        </TechnicalProfile>

Microsoft帐户或Microsoft连接帐户
JWT
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
我的客户id
真的
邮递
我的身份证
身份证
openid配置文件电子邮件脱机访问
假的
https://login.microsoftonline.com/,https://sts.windows.net/
https://login.microsoftonline.com/common/.well-known/openid-configuration

错误在于
通用AAD
,能否将该技术配置文件粘贴到问题中?也可以粘贴任何引用
GetDomainFromEmail
LookupDomain
@JasSuri是否有一种方法可以使用Microsoft SSO但将其绑定到域?@JasSuri我还添加了技术配置文件,我们希望该电子邮件绑定到域。在您的文件中的某个地方,您有一个带有已定义ValidationTechnicalProfile。您可能在多个文件中定义了
通用AAD
,请仔细检查。您不能将ValidationTechnicalProfile放在另一个IdP(如本例中的OIDC)的ClaimsChange上。@JasSuri我与您共享的TP不会引起问题。我想将Microsoft SSO电子邮件域绑定。您知道这样做的方法吗?错误在于
通用AAD
,您能将该技术配置文件粘贴到问题中吗?也可以粘贴任何引用
GetDomainFromEmail
LookupDomain
@JasSuri是否有一种方法可以使用Microsoft SSO但将其绑定到域?@JasSuri我还添加了技术配置文件,我们希望该电子邮件绑定到域。在您的文件中的某个地方,您有一个带有已定义ValidationTechnicalProfile。您可能在多个文件中定义了
通用AAD
,请仔细检查。您不能将ValidationTechnicalProfile放在另一个IdP(如本例中的OIDC)的ClaimsChange上。@JasSuri我与您共享的TP不会引起问题。我想将Microsoft SSO电子邮件域绑定。你知道怎么做吗?
 <TechnicalProfile Id="Common-AAD">
          <DisplayName>Microsoft Account or Microsoft-Connected Account</DisplayName>
          <Protocol Name="OpenIdConnect" />
          <OutputTokenFormat>JWT</OutputTokenFormat>
          <Metadata>
            <Item Key="authorization_endpoint">https://login.microsoftonline.com/common/oauth2/v2.0/authorize</Item>
            <Item Key="client_id">my-client-id</Item>
            <Item Key="DiscoverMetadataByTokenIssuer">true</Item>
            <Item Key="HttpBinding">POST</Item>
            <Item Key="IdTokenAudience">my-id</Item>
            <Item Key="response_types">id_token</Item>
            <Item Key="scope">openid profile email offline_access</Item>
            <Item Key="UsePolicyInRedirectUri">false</Item>
            <Item Key="ValidTokenIssuerPrefixes">https://login.microsoftonline.com/,https://sts.windows.net/</Item>
            <Item Key="METADATA">https://login.microsoftonline.com/common/.well-known/openid-configuration</Item>
          </Metadata>
          <CryptographicKeys>
            <!-- Make sure to update the reference ID of the client secret below you just created (B2C_1A_AADAppSecret) -->
            <Key Id="client_secret" StorageReferenceId="B2C_1A_AppSecret" />
          </CryptographicKeys>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" />
            <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
            <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
            <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
            <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
            <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="preferred_username" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="signInName" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </OutputClaims>
          <OutputClaimsTransformations>
            <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
            <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
            <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
            <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
          </OutputClaimsTransformations>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
        </TechnicalProfile>