Azure ad b2c 从Azure B2C自定义策略调用安全REST API以嵌入声明

Azure ad b2c 从Azure B2C自定义策略调用安全REST API以嵌入声明,azure-ad-b2c,Azure Ad B2c,我试图通过创建自定义策略来使用Azure B2C安全API,作为用户旅程的一部分。我已经创建了一个索赔提供商,以获取以下不记名代币 <ClaimsProvider> <DisplayName>REST APIs</DisplayName> <TechnicalProfiles> <TechnicalProfile Id="SecureREST-Acces

我试图通过创建自定义策略来使用Azure B2C安全API,作为用户旅程的一部分。我已经创建了一个索赔提供商,以获取以下不记名代币

<ClaimsProvider>
            <DisplayName>REST APIs</DisplayName>
            <TechnicalProfiles>
                <TechnicalProfile Id="SecureREST-AccessToken">
                    <DisplayName></DisplayName>
                    <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                    <Metadata>
                        <Item Key="ServiceUrl">https://***.b2clogin.com/***.onmicrosoft.com/B2C_1A_SignUpOrSignIn/oauth2/v2.0/authorize</Item>
                        <Item Key="AuthenticationType">Basic</Item>
                        <Item Key="SendClaimsIn">Form</Item>
                    </Metadata>
                    <CryptographicKeys>
                        <Key Id="BasicAuthenticationUsername" StorageReferenceId="B2C_1A_SecureRESTClientId" />
                        <Key Id="BasicAuthenticationPassword" StorageReferenceId="B2C_1A_SecureRESTClientSecret" />
                    </CryptographicKeys>
                    <InputClaims>
                        <InputClaim ClaimTypeReferenceId="grant_type" DefaultValue="client_credentials" />
                        <InputClaim ClaimTypeReferenceId="scope" DefaultValue="https://***.onmicrosoft.com/profileapi/profileapi-scope" />
                    </InputClaims>
                    <OutputClaims>
                        <OutputClaim ClaimTypeReferenceId="bearerToken" PartnerClaimType="access_token" />
                    </OutputClaims>
                    <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
                </TechnicalProfile>
            </TechnicalProfiles>
        </ClaimsProvider>

REST API
https://***.b2clogin.com/***.onmicrosoft.com/B2C_1A_SignUpOrSignIn/oauth2/v2.0/authorize
基本的
形式
另一个声明提供者调用我的安全RESTAPI,如下所示

 <ClaimsProvider>
            <DisplayName>REST APIs</DisplayName>
            <TechnicalProfiles>
                <TechnicalProfile Id="AzureFunctions-GetRole">
                    <DisplayName>Get Roles </DisplayName>
                    <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                    <Metadata>
                        <Item Key="ServiceUrl">https://***.azurewebsites.net/api/UserProfiles/CheckAdminUser</Item>
                        <Item Key="AuthenticationType">Bearer</Item>
                        <Item Key="SendClaimsIn">Body</Item>
                        <Item Key="AllowInsecureAuthInProduction">false</Item>
                    </Metadata>


                    <InputClaims>
                        <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" />
                        <InputClaim ClaimTypeReferenceId="signInNames.emailAddress" PartnerClaimType="email" />
                        <InputClaim ClaimTypeReferenceId="bearerToken"/>
                    </InputClaims>
                    <OutputClaims>
                        <OutputClaim ClaimTypeReferenceId="IsAdminUser" PartnerClaimType="IsAdminUser" />
                    </OutputClaims>
                    
                    <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
                </TechnicalProfile>
            </TechnicalProfiles>
        </ClaimsProvider>

REST API
获得角色
https://***.azurewebsites.net/api/UserProfiles/CheckAdminUser
持票人
身体
假的

我怎么把这两个人绑起来?这应该是用户旅程中的两个步骤吗?

AAD B2C端点不支持客户端凭据流。获取令牌的初始调用应模拟AAD客户端凭据流:

如果这些技术配置文件没有向用户返回错误的可能性,您可以从用户旅程中调用它们。或作为自断言技术概要中引用的验证技术概要