Search code examples
visual-studioasp.net-mvc-5iis-expressasp.net-identity-2iis-10

Why is IIS 10 Server Display Localhost After Office 365 User Authentication


I have a very simple question to know why IIS 10 server which is currently (Installed in Windows server 2012), does not display my Landing Page after completing the office 365 user authentication.

I have developed an mvc 5 web application which have simple actions and razor pages.

What I WANT is when the application runs on IIS server, it must start with the office 365 user authentication then just after that, the Landing page must display, must not display http://Localhost/43890. BUT I don't know if I am missing something or not doing the right thing on the IIS Server

What I have done:

  1. AccountController:

    public void SignIn() { // Send an OpenID Connect sign-in request. if (!Request.IsAuthenticated) { HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectAuthenticationDefaults.AuthenticationType); } }

  2. Web.Config

  3. IIS 10 Server Configuration IIS setup1 IIS Setup2

  4. Result Getting (in all Browsers) Result from of Website in IIS Server

I have spent 5 days already still in with the same result and I have tried and search around google but no luck. Nothing still works. Please consider my question as I beg for help and real answer. Everyone is welcome to answer and subject. Thank you All!!!


Solution

  • I Have Figure out the resolutions.

    I was trying to deploy a Web Application such as ASP.net MVC Web Application to the IIS 10 server which was not possible; Rather than create a ASP.NET Web Pages (Razor) Site and deploy it to IIS server then worked just fine.

    There was no need of changing my settings on IIS. Just As the website is publish successfully, I just Import the website to IIS server then boom, all works well.

    I was Inspired but this link: Website Deploy in IIS

    I hope this will help someone too some day.

    Thank you everyone for your Help.