简体   繁体   English

Azure AD B2C-错误的URL

[英]Azure AD B2C - Wrong URL

I need to implement Azure AD b2c in a an old WEBFORMS application (not an MVC application). 我需要在旧的WEBFORMS应用程序(而不是MVC应用程序)中实现Azure AD b2c。 I followed the instructions and validated the Azure AD B2C configuration by running this sample. 我按照说明进行了操作,并通过运行此示例验证了Azure AD B2C配置。 After that, I've added all the applicable nugets to my OLD WEBFORMS application and copy the appropriated code. 之后,我将所有适用的nuget添加到了OLD WEBFORMS应用程序中,并复制了相应的代码。 What I have is an EXCEPTION when calling the Challenge method. 调用Challenge方法时,我所拥有的是EXCEPTION。 When I look at network trace I saw an extra "?" 当我查看网络跟踪时,看到一个额外的“?” on the authentication URL before the client_id 在client_id之前的身份验证URL上

The URL generated by the sample, that works, is: 该示例生成的有效的URL是:

" https://login.microsoftonline.com/mytenant.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_signup01&client_id=myguid&redirect_uri= ..." https://login.microsoftonline.com/mytenant.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_signup01&client_id=myguid&redirect_uri= ...”

The URL generated by my old WEBFORMS application is: 我的旧WEBFORMS应用程序生成的URL是:

" https://login.microsoftonline.com/mytenant.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_signup01?client_id=myguid&redirect_uri= ..." https://login.microsoftonline.com/mytenant.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_signup01?client_id=myguid&redirect_uri= ...”

How can I fix this? 我怎样才能解决这个问题?

I just found the answer. 我才找到答案。 Everything is working after upgrade Microsoft.IdentityModel.Protocol.Extensions nuget package to latest version. Microsoft.IdentityModel.Protocol.Extensions nuget软件包升级到最新版本后,一切正常。

I had faced the same issue. 我曾经遇到过同样的问题。 this is purely because of dll. 这纯粹是因为dll。 You check your sample application, and find what version of dlls they are using, install the same in your app, then it will work. 您检查示例应用程序,找到它们使用的dll版本,在您的应用程序中安装相同版本的dll,然后它将起作用。

是的,同样的问题,更新lib修复了它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM