IdentityServer 4 in k8s behind loadbalancer

10/5/2017

I've a identityserver deployed to kubernetes. I also konfigured google and facebook auth (see below). The HTTPS Termination is done but the K8s Ingress.

To get the identity still working with https i set forwarding rules (see below).

But from now on i get the following error and a HTTP 500 When a User tries to login. Terror occurs when the

System.InvalidOperationException: No authentication handler is configured to handle the scheme: Identity.External

The line of code that triggers the error is in the account controller:

signInManager.ExternalLoginSignInAsync(provider, userIdClaim.Value, true);

My identity server startup looks like this:

   app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.XForwardedProto |  ForwardedHeaders.XForwardedProto,
                ForwardLimit = null,
                RequireHeaderSymmetry = false
            });

            app.UseIdentityServer();

            app.UseGoogleAuthentication(new GoogleOptions
            {
                AuthenticationScheme = "Google",
                DisplayName = "Google",
                SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,

                ClientId = "dfdfsf",
                ClientSecret = "-cf-"
            });


            app.UseStaticFiles();
            app.UseMvcWithDefaultRoute();

what am I missing?

-- Boas Enkler
identityserver4
kubernetes

0 Answers