【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

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

分类: 【Azure 环境】, 【Azure Developer】

标签: Azure Developer, Azure 环境, AUTHORITY, Azure AD B2C

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容