简体   繁体   中英

HTTP error 502 when deploying simple Identity Server 3 to Azure

i am playing around with Identity Server 3 for a project I am working on and i am trying to follow a tutorial I found here: https://www.scottbrady91.com/Identity-Server/Identity-Server-3-Standalone-Implementation-Part-1

When running locally it works like expected but I want to deploy it to a web app in Azure. This is where I run into problems.

I receive an error:

    502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

Now I am trying to figure out if something is wrong with how I am setting up Identity Server or if I am not able to deploy something like this to a Web app in azure. Unfortunately i can't find any logs anywhere to give me any hints.

My startup class:

public sealed class Startup {
public void Configuration(IAppBuilder app) {
    app.Map(
        "/core",
        coreApp => {
            coreApp.UseIdentityServer(new IdentityServerOptions {
                SiteName = "Standalone Identity Server",
                SigningCertificate = Cert.Load(),
                Factory = new IdentityServerServiceFactory()
                        .UseInMemoryClients(Clients.Get())
                        .UseInMemoryScopes(Scopes.Get())
                        .UseInMemoryUsers(Users.Get()),
                RequireSsl = true
            });
        });
}

}

According to your description, I followed the tutorial about how to use identityserver3 to provide authentication services to an MVC application and a Web API here to check this issue. It could work as expected on local side. Then I just deployed the identityserver project (identity server hosting application and client web application) and Web API project to Azure web app, then I checked it could work, you could refer to my web app here .

I would recommend you could clone this git sample IdentityServer3.Samples > MVC Authentication and test it on your local side, then change the related Uris to your azure side and deploy to azure to narrow this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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