Azure ad b2c Azure B2C-提供的令牌不包含有效的颁发者

Azure ad b2c Azure B2C-提供的令牌不包含有效的颁发者,azure-ad-b2c,azure-ad-b2c-custom-policy,identity-experience-framework,Azure Ad B2c,Azure Ad B2c Custom Policy,Identity Experience Framework,我正在使用Azure B2C连接到外部OpenID连接身份提供商,我在B2C中创建了一个基本的用户流,该用户流可以正常工作,但只返回少量声明,因此我需要创建一个自定义策略,将自定义输入参数传递给我的IDP并收集其他声明 我从SocialAndLocalAccount样本开始,并修改了我的IDP的详细信息: TrustFrameworkBase.xml(缩减到技术概要+用户旅程) 。。。 主题 一串 用户界面区域设置 一串 为帐户身份验证传递了特殊参数以告诉我们一次。 姓名 一串 你的名字(也称为

我正在使用Azure B2C连接到外部OpenID连接身份提供商,我在B2C中创建了一个基本的用户流,该用户流可以正常工作,但只返回少量声明,因此我需要创建一个自定义策略,将自定义输入参数传递给我的IDP并收集其他声明

我从SocialAndLocalAccount样本开始,并修改了我的IDP的详细信息:

TrustFrameworkBase.xml(缩减到技术概要+用户旅程)

。。。
主题
一串
用户界面区域设置
一串
为帐户身份验证传递了特殊参数以告诉我们一次。
姓名
一串
你的名字(也称为名字)。
文本框
姓
一串
您的姓氏(也称为姓氏或姓氏)。
文本框
出生日期
一串
你的出生日期。
文本框
...
泰卢斯洛斯
告诉我们一次
登录后告诉我们
通过登录告诉我们一次
这是我放客户id的地方
告诉我们一次
这就是我的元数据所在的位置
代码
表格邮政
openid
邮递
假的
...
目标
(“底部的Redirect Uri”部分)但是“/authresp”似乎没有将代码交换为id_令牌,因为当它重定向到jwt.ms时,我得到“令牌不包含有效的颁发者”

小提琴手代码响应

通过使用fiddler的inspector,我可以看到IDP的端点使用类似以下的代码(不是实际代码)进行响应:


OIDC表格\u后响应

JavaScript已禁用。我们强烈建议启用它。单击下面的按钮继续。

Fiddler AuthResp响应

再次使用Fiddler,我可以看到AuthResp没有使用IDP的令牌端点将代码交换为id_令牌(或者遇到错误,我没有得到任何有用的消息)。相反,我回来了:

<html>

<head>
    <title>Object moved</title>
</head>

<body>
    <h2>Object moved to <a
            href="https://jwt.ms/#error=invalid_request&amp;error_description=AADB2C90238%3a+The+provided+token+does+not+contain+a+valid+issuer.+Please+provide+another+token+and+try+again.%0d%0aCorrelation+ID%3a+2ad979b5-384f-43bf-8d05-2230f17553bc%0d%0aTimestamp%3a+2021-02-26+04%3a29%3a08Z%0d%0a">here</a>.
    </h2>
</body>

</html>

移动的对象
对象移动到。
问题

  • 我在某处的文档中读到,“OpenIDConnect”技术配置文件将自动将代码交换为id令牌,但我似乎找不到该文档,我的配置是否缺少一个步骤,或者我是否必须使用额外的用户旅程手动执行此操作
  • 如果“/authrep”和令牌端点之间存在通信错误,是否有地方可以查看更具描述性的错误消息?jwt.ms和审计日志都只是说“令牌不包含有效的颁发者”

  • 我认为登录的技术配置文件配置不正确。您可以在中找到使用OpenIdConnect的工作示例

    请参考样品,例如

    • :技术配置文件
      非交互登录
    • :技术配置文件
      非交互登录

    我认为登录的技术配置文件配置不正确。您可以在中找到使用OpenIdConnect的工作示例

    请参考样品,例如

    • :技术配置文件
      非交互登录
    • :技术配置文件
      非交互登录

    该错误意味着来自OIDC提供程序的id令牌具有与众所周知的OIDC配置端点中的颁发者不匹配的颁发者(iss)声明。您可以将issuer元素添加到TUO OpenIdConnect技术配置文件的元数据中,以使用令牌中显示的值覆盖它


    颁发者:OpenID连接身份提供程序的唯一标识符。issuer元数据的值优先于OpenID已知配置端点中指定的issuer。如果指定,Azure AD B2C将检查身份提供程序返回的令牌中的iss声明是否等于颁发者元数据中指定的iss声明。

    此错误意味着来自OIDC提供程序的id令牌具有与已知OIDC配置端点中的颁发者不匹配的颁发者(iss)声明。您可以将issuer元素添加到TUO OpenIdConnect技术配置文件的元数据中,以使用令牌中显示的值覆盖它


    颁发者:OpenID连接身份提供程序的唯一标识符。issuer元数据的值优先于OpenID已知配置端点中指定的issuer。如果指定,Azure AD B2C将检查身份提供商返回的令牌中的iss声明是否等于发卡机构元数据中指定的声明。

    您好,谢谢您提供的信息。从基本流程返回的发卡机构是
    https://itpauthdev.b2clogin.com/ae2201eb-e4e9-44e7-8c73-b52e37ba01f8/v2.0/
    但当我将其作为新元数据添加时,我会收到相同的错误。有没有一种方法可以让我检查B2C在到达jwt.ms之前收到的令牌?即AAD B2C的发行人
    <TrustFrameworkPolicy 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" 
      PolicySchemaVersion="0.3.0.0" 
      TenantId="itpauthdev.onmicrosoft.com" 
      PolicyId="B2C_1A_TrustFrameworkExtensions" 
      PublicPolicyUri="http://itpauthdev.onmicrosoft.com/B2C_1A_TrustFrameworkExtensions" 
      TenantObjectId="ae2201eb-e4e9-44e7-8c73-b52e37ba01f8">
      <BasePolicy>
        <TenantId>itpauthdev.onmicrosoft.com</TenantId>
        <PolicyId>B2C_1A_TrustFrameworkBase</PolicyId>
      </BasePolicy>
      <BuildingBlocks></BuildingBlocks>
      <ClaimsProviders>
        <ClaimsProvider>
          <Domain>tellusonce</Domain>
          <DisplayName>Tell Us Once</DisplayName>
          <TechnicalProfiles>
            <TechnicalProfile Id="TUO-OpenIdConnect">
              <DisplayName>Tell Us Once Login</DisplayName>
              <Description>Login through Tell Us Once</Description>
              <Protocol Name="OpenIdConnect" />
              <Metadata>
                <Item Key="client_id">this is where i put my client id</Item>
                <Item Key="ProviderName">Tell Us Once</Item>
                <Item Key="METADATA">this is where my metadata is</Item>
                <Item Key="response_types">code</Item>
                <Item Key="response_mode">form_post</Item>
                <Item Key="scope">openid</Item>
                <Item Key="HttpBinding">POST</Item>
                <Item Key="UsePolicyInRedirectUri">false</Item>
              </Metadata>
              <CryptographicKeys>
                <Key Id="client_secret" StorageReferenceId="B2C_1A_TellUsOnceSecret" />
              </CryptographicKeys>
              <InputClaims>
                <InputClaim ClaimTypeReferenceId="acr_values" DefaultValue="urn:id.gov.au:tdif:acr:ip1:cl1" />
                <InputClaim ClaimTypeReferenceId="scope" DefaultValue="openid profile" />
                <InputClaim ClaimTypeReferenceId="prompt" DefaultValue="login" />
                <InputClaim ClaimTypeReferenceId="ui_locales" DefaultValue="en-US" />
              </InputClaims>
              <OutputClaims>
                <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
                <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
                <OutputClaim ClaimTypeReferenceId="middleName" DefaultValue="" />
                <OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name" />
                <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" />
                <OutputClaim ClaimTypeReferenceId="DateOfBirth" PartnerClaimType="birthdate" />
                <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="ITP-B2C" />
                <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="ITP-Auth-DEV-OIDC" />
              </OutputClaims>
              <OutputClaimsTransformations>
                <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
                <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
                <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
                <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
              </OutputClaimsTransformations>
            </TechnicalProfile>
          </TechnicalProfiles>
        </ClaimsProvider>
      </ClaimsProviders>
      <UserJourneys>
        <UserJourney Id="SignUpOrSignInOidc">
          <OrchestrationSteps>
            <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
              <ClaimsProviderSelections>
                <ClaimsProviderSelection TargetClaimsExchangeId="TUO-OIDCExchange" />
              </ClaimsProviderSelections>
            </OrchestrationStep>
            <OrchestrationStep Order="2" Type="ClaimsExchange">
              <ClaimsExchanges>
                <ClaimsExchange Id="TUO-OIDCExchange" TechnicalProfileReferenceId="TUO-OpenIdConnect" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <!-- For social IDP authentication, attempt to find the user account in the directory. -->
            <OrchestrationStep Order="3" Type="ClaimsExchange">
              <ClaimsExchanges>
                <ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <!-- Create the user in the directory if one does not already exist. -->
            <OrchestrationStep Order="4" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>objectId</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="AADUserWrite" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <OrchestrationStep Order="5" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
          </OrchestrationSteps>
          <ClientDefinition ReferenceId="DefaultWeb" />
        </UserJourney>
      </UserJourneys>
    </TrustFrameworkPolicy>
    
    <TrustFrameworkPolicy 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" 
      PolicySchemaVersion="0.3.0.0" 
      TenantId="itpauthdev.onmicrosoft.com" 
      PolicyId="B2C_1A_signup_signin_oidc" 
      PublicPolicyUri="http://itpauthdev.onmicrosoft.com/B2C_1A_signup_signin" 
      TenantObjectId="ae2201eb-e4e9-44e7-8c73-b52e37ba01f8">
      <BasePolicy>
        <TenantId>itpauthdev.onmicrosoft.com</TenantId>
        <PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
      </BasePolicy>
      <RelyingParty>
        <DefaultUserJourney ReferenceId="SignUpOrSignInOidc" />
        <UserJourneyBehaviors></UserJourneyBehaviors>
        <TechnicalProfile Id="PolicyProfile">
          <DisplayName>PolicyProfile</DisplayName>
          <Protocol Name="OpenIdConnect" />
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="givenName" />
            <OutputClaim ClaimTypeReferenceId="middleName" DefaultValue="" />
            <OutputClaim ClaimTypeReferenceId="surname" />
            <OutputClaim ClaimTypeReferenceId="email" />
            <OutputClaim ClaimTypeReferenceId="DateOfBirth" DefaultValue="ClaimNotFound" />
            <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" />
            <OutputClaim ClaimTypeReferenceId="identityProvider" />
            <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
          </OutputClaims>
          <SubjectNamingInfo ClaimType="sub" />
        </TechnicalProfile>
      </RelyingParty>
    </TrustFrameworkPolicy>
    
    <HTML>
    
    <HEAD>
        <TITLE>OIDC Form_Post Response</TITLE>
    </HEAD>
    
    <BODY Onload="document.forms[0].submit()">
        <FORM METHOD="POST" ACTION="https://itpauthdev.b2clogin.com/itpauthdev.onmicrosoft.com/oauth2/authresp"> <INPUT
                TYPE="HIDDEN" NAME="code"
                VALUE="4cfed1f1-bfcc-42db-b39c-d79480f6d333.056c6e05-eaec-426a-a5e7-bf9f66f962be.15ac212d-38b7-4e9b-80e2-a948be9360e5" />
            <INPUT TYPE="HIDDEN" NAME="state"
                VALUE="StateProperties=eyJTSUQiOiJ4LW1zLWNwaW0tcmM6M2RkYmRhYjktY2VkZS00MDA4LTliNWYtOGRmZjU2ZDZmZDYzIiveWIlEIjoiMmFtkoc5YjUtMzg0Zi00M2JmLThkMDUtMjIzMGYxNzU1M2JjIiwiVE9CRJI6ImFlMjIwMWViLWU0ZTktNDRlNy04YzczLWI1MmUzN2JhMDFmOCJ9" />
            <INPUT TYPE="HIDDEN" NAME="session_state" VALUE="65e01676-90d1-4c5e-a7f4-66dfd7b3211b" /> <NOSCRIPT>
                <P>JavaScript is disabled. We strongly recommend to enable it. Click the button below to continue .</P>
                <INPUT name="continue" TYPE="SUBMIT" VALUE="CONTINUE" />
            </NOSCRIPT> </FORM>
    </BODY>
    
    </HTML>
    
    <html>
    
    <head>
        <title>Object moved</title>
    </head>
    
    <body>
        <h2>Object moved to <a
                href="https://jwt.ms/#error=invalid_request&amp;error_description=AADB2C90238%3a+The+provided+token+does+not+contain+a+valid+issuer.+Please+provide+another+token+and+try+again.%0d%0aCorrelation+ID%3a+2ad979b5-384f-43bf-8d05-2230f17553bc%0d%0aTimestamp%3a+2021-02-26+04%3a29%3a08Z%0d%0a">here</a>.
        </h2>
    </body>
    
    </html>