I'm trying to get an ASP.Net Core to authenticate against Thinktecture V2 uising OpenID Connect (we currently need WS-Trust so can't upgrade).
My configuration is as follows
app.UseCookieAuthentication(new CookieAuthenticationOptions());
X509Store certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
certStore.Open(OpenFlags.ReadOnly);
var cert = certStore.Certificates.Find(X509FindType.FindByThumbprint, "CertThumbprint", false);
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
RequireHttpsMetadata = false,
ClientId = _config["OpenID:ClientId"],
ClientSecret = _config["OpenID:ClientSecret"],
Authority = _config["OpenID:Authority"],
ResponseType = OpenIdConnectResponseType.Code,
PostLogoutRedirectUri = _config["OpenID:PostLogoutRedirectUri"],
SignInScheme = "Cookies",
CallbackPath = "/signin-oidc",
TokenValidationParameters = new TokenValidationParameters()
{
IssuerSigningKey = new X509SecurityKey(cert[0]),
},
Configuration = new OpenIdConnectConfiguration
{
Issuer = "https://identityserver/IdentityServer/issue",
AuthorizationEndpoint = "https://identityserver/IdentityServer/issue/oidc/authorize",
TokenEndpoint = "https://identityserver/IdentityServer/issue/oidc/token",
UserInfoEndpoint = "https://identityserver/IdentityServer/issue/oidc/userinfo",
}
});
config.json
"OpenID": {
"ClientId": "Test",
"ClientSecret": "{6DD502AB-2AB1-4028-BD4A-85C91790EC7B}",
"Authority": "https://identityserver/IdentityServer/issue/oidc",
"PostLogoutRedirectUri": "https://localhost:44353/" }
When I try and authenticate I get the following exception:
HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
The trace from thinktectureIdentityServer.svclog is
If anyone could provide any help it would be greatly appreciated.