简体   繁体   English

具有Azure身份验证的MVC应用程序

[英]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.

相关问题 MVC应用程序中的授权和身份验证 - Authorization and authentication in MVC application MVC应用程序中的SSRS身份验证 - SSRS authentication in a MVC application 一个ASP.NET MVC应用程序中是否可以同时具有Azure AD和个人帐户身份验证? - Is it possible to have both Azure AD and Individual Account authentication in one ASP.NET MVC application? Asp.net MVC表单身份验证应用程序转换为Azure Active Directory - Asp.net MVC form Authentication Application conversion to Azure Active Directory Azure ASP.NET 核心 MVC WebApp 的 AD 身份验证 - 如何自定义应用程序的 Redirect_URI! 发送 - Azure AD Authentication for ASP.NET Core MVC WebApp - how to customize the Redirect_URI the APPLICATION! sends Azure Native Application通用身份验证 - Azure Native Application Common Authentication ASP.NET MVC 5 中的 Azure AD 身份验证 - Azure AD authentication in ASP.NET MVC 5 在Azure中部署MVC5应用程序 - Deploy MVC5 application in azure 将MVC 4应用程序发布到azure后的身份验证问题 - Authentication problems after publishing MVC 4 app to azure Asp.net 核心 MVC 应用程序与 Azure AD 身份验证。 无法取消保护浏览器后退按钮上的消息 state - Asp.net Core MVC application with Azure AD authentication. Unable to unprotect message state on browser back button
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM