Base solution for your next web application
Open Closed

Deploy to IIS, no swagger login screen #9426


User avatar
0
lweng567 created

Hi,

We have recently downloaded the ASP.NET Zero source (ASP.NET CORE & Angular) as separate solutions.

We can run the Api (Web.Host) without issue via our IDE (Visual Studio) but when we follow the steps to publish to IIS (https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Deployment-Angular-Publish-IIS) we are getting a HTTP Error 404 when we browse to the Api URL (e.g. http://localhost:[port]).

We can manually amend the Api URL (e.g. http://localhost:[port]/swagger/index.html) and see the Api endpoints but we are not prompted to login/authenticate.

Do you have any suggestions on what we are missing/doing wrong? Let us know if you need any screenshots, etc.

Thanks in advance.

Laurie


12 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Is there any information in the application logs?

    but we are not prompted to login/authenticate.

    .Web.Host project contains a basic login page. If you login on this page, you can execute actions on Swagger UI which requires authentication.

  • User Avatar
    0
    lweng567 created

    hi,

    There is not log in the application log, that is why i can't figure it out what is going on. When i open http://localhost:8080, i got a 404 error. Not sure what login page you are refering to? Laurie

  • User Avatar
    0
    lweng567 created

    if I changed the redirect in the HomeController, then i can get the login page

    public IActionResult Index() { if (_webHostEnvironment.IsDevelopment()) { return RedirectToAction("Index", "Ui"); }

            //return Redirect("/index.html"); // this line has issue
            
            return RedirectToAction("Index", "Ui");
        }
    
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Maybe related to https://github.com/aspnetzero/aspnet-zero-core/issues/3320

  • User Avatar
    0
    lweng567 created

    Hi, I can't access the above link. It gave me 404 Laurie

  • User Avatar
    0
    maliming created
    Support Team

    https://aspnetzero.com/LicenseManagement

  • User Avatar
    0
    lweng567 created

    still no luck, 404 error

  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can open the ui page manually.

    http://localhost:[port]/Ui/Index

  • User Avatar
    0
    lweng567 created

    I can.

  • User Avatar
    0
    maliming created
    Support Team

    If there is problem receiving the invitation email, alternatively user can visit github.com/orgs/aspnetzero page and accept the invitation.

  • User Avatar
    0
    lweng567 created

    Ok, no problem, thanks for explaining.

  • User Avatar
    0
    staffing created

    @maliming: I am using the same settings in the single solution and deploying the app on Azure. The application is working apart from the Imprsonation. I can't use impersonation functionality. If I remove the Index action then impersonation is working fine but I can't access the swagger.

    Thanks Harsh