2

After upgrading from IdentityServer4 (v2) to Duende Identity Server, I am getting this error when an app is trying to get a token to connect to an API:

error requesting access token for client default

There is no "Error" in the logs, but the token request returns a 404:

Microsoft.AspNetCore.Routing.Matching.DfaMatcher:
    |No candidates found for the request path '//connect/token'
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware:
    |Request did not match any endpoints
Duende.IdentityServer.Hosting.EndpointRouter:
    |No endpoint entry found for request path: //connect/token
Microsoft.AspNetCore.Hosting.Diagnostics:
    |Request finished HTTP/1.1 POST https://accounttest.veic.org//connect/token 
    application/x-www-form-urlencoded 29 - 404 - - 2.0641ms

This same app used to work fine before the Identity Server upgrade.

Jess
  • 23,901
  • 21
  • 124
  • 145

1 Answers1

2

As it turns out, this error has nothing to do with Duende Identity Server. The problem is that upgrading .NET to use EndPoint Routing can cause this issue.

The previous code to app.UseMvcWithDefaultRoute was more gracious about accepting double slashes in a URL. The new app.UseEndpoints routing does not handle this double slash in the URL and route it to an action.

Here is a good answer about how to deal with the double slash in the URL.

Jess
  • 23,901
  • 21
  • 124
  • 145