从JS单页应用程序向azure-ad-b2c策略发送声明的示例 [英] Example of sending claim to azure-ad-b2c policy from JS single page application
问题描述
我正在使用msal js库将SPA重定向到b2c策略.
I'm using msal js library to redirect SPA to b2c policy.
我找不到从JavaScript应用程序向b2c策略(例如extension_Brand)发送一些自定义声明的示例.
I can't find an example of sending some custom claim to the b2c policy (like extension_Brand) from javascript application.
What I have found is .NET example: https://github.com/Azure-Samples/active-directory-b2c-advanced-policies/blob/d62c3f9e573ac8b5a9adc1565c6254f632e2a531/wingtipgamesb2c/src/WingTipMusicWebApplication/Startup.cs#L108 But it uses .NET library.
哪个JS库可以向b2c策略发送声明?
Which JS library can send claim to the b2c policy?
推荐答案
我不知道任何JS示例.
There are no JS examples that I know of.
您可以使用 MSAL.js 通过 loginRedirect
等.
You can use MSAL.js to send claims to B2C via the extraQueryParameters
arg on loginPop
, loginRedirect
, etc.
对服务器进行Ajax调用以获得JWT,然后将该JWT传递到B2C.
Make an ajax call to the server to get a JWT and then pass along that JWT to B2C.