Azure AD B2C Redirect URI仅localhost可用,生产环境URI无法正常工作的问题求助
Azure AD B2C Redirect URI仅localhost可用,生产环境URI无法正常工作的问题求助
大家好,我最近在Blazor应用对接Azure AD B2C时遇到了一个头疼的问题,想请各位帮忙排查下:
当我把重定向URI设为http://localhost时,本地运行完全正常,认证流程能顺利走通。但换成生产环境要用的https://medbase.co.zw/auth后,就彻底失效了——连PublicClientApplicationBuilder这段初始化代码都没执行,可切回localhost测试时,这部分代码又能正常跑起来。
下面是我的核心代码片段:
Scopes = _settings.Scopes.ToStringArray(); // Create PCA once. Make sure that all the config parameters below are passed PCA = PublicClientApplicationBuilder .Create(_settings?.ClientId) .WithB2CAuthority(_settings?.Authority) #if !ANDROID .WithRedirectUri("https://medbase.co.zw/auth") //.WithRedirectUri("http://localhost") #endif .Build();
我也确认过Azure AD B2C应用配置里已经添加了生产环境的重定向URI,附上配置截图供参考:
有没有朋友遇到过类似的情况?或者能给我一些排查的方向?万分感谢!
备注:内容来源于stack exchange,提问作者Tanaka Mawere
相关产品推荐
相关产品推荐

