I have an OIDC authentication server based on Identity Server 4 which allows federation on to an external identity provider.
services.AddAuthentication()
.AddOpenIdConnect(extIDP.AuthScheme, extIDP.AuthDisplay, options =>
{
options.SignInScheme = extIDP.Options.SignInScheme;
options.SignOutScheme = extIDP.Options.SignOutScheme;
options.Authority = extIDP.Options.Authority;
options.ClientId = extIDP.Options.ClientId;
options.ClientSecret = extIDP.Options.ClientSecret;
options.ResponseType = extIDP.Options.ResponseType;
options.CallbackPath = extIDP.Options.CallbackPath;
options.SignedOutCallbackPath = extIDP.Options.SignedOutCallbackPath;
options.RemoteSignOutPath = extIDP.Options.RemoteSignOutPath;
options.RequireHttpsMetadata = extIDP.Options.RequireHttpsMetadata;
options.SaveTokens = true;
options.Scope.Clear();
options.Scope.Add(IdentityServerConstants.StandardScopes.OpenId);
options.Scope.Add(IdentityServerConstants.StandardScopes.Profile);
options.Scope.Add(IdentityServerConstants.StandardScopes.Email);
options.Scope.Add(JwtClaimTypes.Role);
});
Where extIDP comes from some configuration. So this works just fine, but we have a client with an IDP that doesnt support a response mode of form_post (which is the default used in the setup above), so if I add in an extra line to the config to set the ResponseMode to "fragment" then we should be fine but it does not work.
I end up with a Correlation Error being reported With verbose logging enabled in our Auth Server we get
Warning: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler ".AspNetCore.Correlation." state property not found
Note this is occurring when running against two test auth servers locally so has nothing to do with load balancing problems. I also added a cookie policy to ensure it wasnt being cause by a strict cookie policy. So I am currently a bit stuck.