[英]MVC application with azure authentication
Am creating an application with azure authentication(MVC5).Everything working in local when running in IIS Express. 我正在使用Azure身份验证(MVC5)创建应用程序。在IIS Express中运行时,所有工作都在本地进行。 When am hosting the application to local IIS, application is redirecting to Microsoft login page for user authentication and after entering the credentials its not coming back to the redirect URL which I mentioned in the Azure application.
将应用程序托管到本地IIS时,应用程序将重定向到Microsoft登录页面以进行用户身份验证,并且在输入凭据后,其不会返回到我在Azure应用程序中提到的重定向URL。
When the examine the URL, a new nonce cookies is keep on generating and appending to the URL and atlast getting BAD REQUEST ERROR 当检查URL时, 将继续生成并附加到URL 上一个新的现时cookie ,最终导致BAD REQUEST ERROR
Startup.Auth.cs code Startup.Auth.cs代码
public partial class Startup
{
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
private static string tenantId = ConfigurationManager.AppSettings["ida:TenantId"];
private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];
private static string authority = aadInstance + tenantId;
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri
});
}
}
I got some sample project from this link and its working fine after hosting also. 我从此链接获得了一些示例项目,并且在托管后也可以正常工作。
If anyone facing this issue??????????? 如果有人遇到这个问题?
您是否尝试过修改IIS服务器上的MaxFieldLength和MaxRequestBytes注册表设置,以便认为用户的请求标头不会太长?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.