Duende IdentityServer 6.20 .Net6.0 "AuthenticationScheme: idsrv was not authenticated"

369 views Asked by At

I have a fully functioning Duende IS6 solution, servicing an Angular client. However the Seq log output contains a lot of these entries with each request:

{
    "@t": "2023-01-08T19:14:58.3783602Z",
    "@mt": "AuthenticationScheme: {AuthenticationScheme} was not authenticated.",
    "@m": "AuthenticationScheme: idsrv was not authenticated.",
    "@i": "19c670d5",
    "@l": "Debug",
    "AuthenticationScheme": "idsrv",
    "EventId": {
        "Id": 9,
        "Name": "AuthenticationSchemeNotAuthenticated"
    },
    "SourceContext": "Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler",
    "RequestId": "0HMNHLIGV47GF:00000002",
    "RequestPath": "/.well-known/openid-configuration/jwks",
    "ConnectionId": "0HMNHLIGV47GF",
    "application": "dev.identity"
}

Does anyone know what the issue is here? To be clear, my app functions and authenticates just fine so whatever it is doesn't appear to be causing an issue, just filling up my logs.

(apols for earlier version tag but could not tag identityserver6 as not enough rep)

1

There are 1 answers

0
Tore Nestenius On

The error is because ASP.NET Core did not find any cookie that it could convert into a ClaimsPrincipal user.

As you mention, requests to "/.well-known/openid-configuration/jwks" is never made by the browser, instead its made by the client and apis on the backend to retrieve the signing keys. And in these requests, there is no cookie to authenticate.