【Azure Developer】在使用中国区 Azure AD B2C时, AUTHORITY的值是什么呢?

问题描述

使用MSAL4J的SDK调用(源码地址:https://github.com/Azure-Samples/ms-identity-msal-java-samples/tree/main/3.%20Java%20Servlet%20Web%20App%20Tutorial/1-Authentication/sign-in-b2c#about-the-code),其中的一段代码中, AUTHORITY 地址在中国区Azure AD B2C中应该是什么呢?

IClientSecret secret = ClientCredentialFactory.createFromSecret(SECRET);
confClientInstance = ConfidentialClientApplication
                    .builder(CLIENT_ID, secret)
                    .b2cAuthority(AUTHORITY + policy)
                    .build();

在Github的实例代码中,AUTHORITY   = https://fabrikamb2c.b2clogin.com/tfp/fabrikamb2c.onmicrosoft.com/

 

问题解答

根据中国区文档的介绍以及示例中参考,在中国区AUTHORITY的值对应为   https://<your-tenant-name>.b2clogin.cn/<your-tenant-name>.partner.onmschina.cn/

 

参考资料

https://github.com/Azure-Samples/ms-identity-msal-java-samples/blob/main/3.%20Java%20Servlet%20Web%20App%20Tutorial/1-Authentication/sign-in-b2c/src/main/resources/authentication.properties 

https://docs.azure.cn/zh-cn/active-directory-b2c/b2clogin#what-endpoints-does-this-apply-to

https://docs.azure.cn/zh-cn/active-directory-b2c/configure-a-sample-node-web-app#step-5-configure-the-sample-web-app 

 

posted @   路边两盏灯  阅读(82)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-06-23 【Azure Redis 缓存】Azure Redis加入VNET后,在另一个区域(如中国东部二区)的VNET无法访问Redis服务(注:两个VNET已经结对,相互之间可以互ping)
点击右上角即可分享
微信分享提示