Azure B2C:如何在令牌中不返回自定义属性而不将它们作为注册属性的一部分? [英] Azure B2C: How do I get Custom Attributes back in the token without them being part of the signup attributes?

查看:66
本文介绍了Azure B2C:如何在令牌中不返回自定义属性而不将它们作为注册属性的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在B2C实例中创建了自定义属性,并将其添加到登录"或注册"策略中,但是我注意到,只有它们是注册属性"的一部分,它们才会以令牌形式返回.如果我将它们从注册"中删除,仅将它们作为一部分 在应用程序声明"中,它们不随令牌一起返回.不过,我可以使用Graph API查询它们,但目标是设置我不想成为注册经验一部分但希望获得令牌的角色和其他信息,以便我保存 额外调用Graph API.

I have created custom attributes in my B2C instance and have added them to my Sign In or Up policy but I noticed that they are only returned in the token if they are part of the Signup Attributes. If I remove them from Signup and only have them as part of the Application Claims, they do not return with the token. I can however query them with Graph API but the goal is to set Roles and other information that I do not want to be part of the signup experience but would like back with the token so I can save the extra calls to Graph API.

实现此目标的最佳方法是什么,或者这是一个错误?

What is the best way to achieve this or is this a bug?

推荐答案

这是无法完成的.为了使您的自定义属性返回到令牌中,您必须在登录或注册策略中对其进行配置.此政策是定义应向应用程序提供哪些声明的地方.

It can't be done. In order to have your custom attributes returned in the token you have to configure that in the sign-in or sign-up policy. This policy is the place to define which claims should be provided to the application. 

详细了解内置策略 这里

Read more about build-in policies here


这篇关于Azure B2C:如何在令牌中不返回自定义属性而不将它们作为注册属性的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆