asp.net-coreidentityserver4

Refresh token exception in identity server 4


Based on the below i am working on refresh Refresh token renewal

enter image description here But after token expired ,while request new refresh token am getting below error

enter image description here

Below is my code

   var tokenClientOptions = new TokenClientOptions
                        {
                            Address = "https://localhost:5000", //configuration.TokenEndpoint,
                            ClientId = "webclient",//openIdConnectOptions.ClientId,
                            ClientSecret ="secret"  // openIdConnectOptions.ClientSecret
                        };

                        var httpClientFactory = serviceProvider.GetService<IHttpClientFactory>();
                        using var httpClient = httpClientFactory.CreateClient();

                        var tokenClient = new TokenClient(httpClient, tokenClientOptions);
                        var tokenResponse = await tokenClient.RequestRefreshTokenAsync(refreshToken, cancellationToken: cancellationToken).ConfigureAwait(false);

below is my Html response.

enter image description here

I have given base path idetity server 4. Pls let me know reason am getting error..Thanks in advance.


Solution

  • The Token Endpoint of Identity Server to programmatically request tokens is /connect/token.

    The URL of the address need to be https://localhost:5000/connect/token.