Kev*_*Kev 5 azure-ad-b2c azure-ad-b2c-custom-policy
我已按照中提供的说明进行操作,可以为 Azure AD B2C 自定义策略中的输入提供默认值吗?。
无法获取查询参数并将其保存在 Azure B2C 上
GiveName 显示为 NULL。
我的技术简介如下:
<TechnicalProfile Id="LocalAccountSignUpWithLogonName">
<DisplayName>Sign Up with Username</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IpAddressClaimReferenceId">IpAddress</Item>
<Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
<Item Key="LocalAccountType">Username</Item>
<Item Key="LocalAccountProfile">true</Item>
<Item Key="language.button_continue">Create</Item>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<InputClaims>
<InputClaim ClaimTypeReferenceId="signInName" />
<InputClaim ClaimTypeReferenceId="extension_mfaByPhoneOrEmail" DefaultValue="SKIPMFA" />
<InputClaim ClaimTypeReferenceId="givenName" DefaultValue="{OAUTH-KV:name}" AlwaysUseDefaultValue="true"/>
</InputClaims>
Run Code Online (Sandbox Code Playgroud)
谢谢
当您启动 B2C 会话时,您需要将查询字符串参数添加到 /authorize 端点的初始请求中。如果您调用如下内容,而不是您发布的 URL(看起来您在 B2C 会话开始后将查询字符串参数添加到调用中):
https://test.b2clogin.com/test.onmicrosoft.com/B2C_1A_SUSI_MFA_phone_or_email_New/oauth2/v2.0/authorize?client_id=XXX&nonce=ABC123&redirect_uri=https://jwt.ms&...&name=TestAccount
Run Code Online (Sandbox Code Playgroud)
查询name字符串参数应该被提取出来,您可以在技术配置文件中引用它。
favFood在我的测试租户中,我使用末尾有一个查询字符串参数的 URL :
https://<tenant>.b2clogin.com/<tenant>.onmicrosoft.com/oauth2/v2.0/authorize?p=<policy_name>&client_id=<client_id>da&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms&scope=openid&response_type=id_token&prompt=login&qsFavFood=ice%20cream
Run Code Online (Sandbox Code Playgroud)
通过使用像技术配置文件中那样的声明解析器(我使用的是 a ClaimsTransformationProtocolProvider),我在 jwt.ms 中的响应将捕获的值显示为声明:
{
<jwt_header_stuff>
}.{
...
"nonce": "defaultNonce",
"iat": 1648236227,
"auth_time": 1648236227,
"reduri": "https://jwt.ms/",
"qsFavFood": "ice cream",
...
}.[Signature]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2152 次 |
| 最近记录: |