简体   繁体   English

Azure AD B2C 索赔改造

[英]Azure AD B2C claims transformation

I am useing AAD B2C to authenticate users in my application.我正在使用 AAD B2C 对我的应用程序中的用户进行身份验证。 In SAML there is a possibility to transform the NameID using a NameIdPolicy.在 SAML 中,可以使用 NameIdPolicy 转换 NameID。 It allows for instance to get a short unique id for the user (see persistent NameId).例如,它允许为用户获取一个简短的唯一 ID(请参阅持久 NameId)。

I would like to achieve the same in AAD B2C Application, as it serves a legacy application that requires a short unique id.我想在 AAD B2C 应用程序中实现相同的目标,因为它服务于需要一个简短的唯一 ID 的遗留应用程序。 The built-in object id (guid) is far too long as the max number of char is 16.内置的 object id (guid) 太长了,因为最大字符数为 16。

Can we do some claim transformationm with AAD B2C similar to the SAML one in AAD Enterprise Applications?我们可以使用 AAD B2C 进行一些声明转换,类似于 AAD 企业应用程序中的 SAML 吗?

Looking at Claims Transformation in B2C Policies.查看 B2C 政策中的索赔转换。 Not sure I can achieve it this way: https://docs.microsoft.com/en-us/azure/active-directory-b2c/claimstransformations不确定我可以通过这种方式实现它: https://docs.microsoft.com/en-us/azure/active-directory-b2c/claimstransformations

Assuming you're sending claims back using a B2C custom policy, you can choose any claim that matches your needs for a short NameID instead of a default claim of objectId.假设您使用 B2C 自定义策略发回声明,您可以选择任何符合您对短 NameID 需求的声明,而不是 objectId 的默认声明。

<SubjectNamingInfo Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ClaimType="YOUR_CLAIM_ID" />

You can choose to set YOUR_CLAIM_ID based on your business needs.您可以根据业务需求选择设置 YOUR_CLAIM_ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM