Invalid_grant error when doing a Refresh_Token

804 Views Asked by At

In IdentityServer4, I am using the HybridAndClientCredentials grantType for my client. When the token expires and the refresh token request fires, I get invalid_grant error. See the logs below for the request

Logs

> 11:14:56 Debug] IdentityServer4.Validation.TokenRequestValidator Start
> token request validation
> 
> [11:14:56 Debug] IdentityServer4.Validation.TokenRequestValidator
> Start validation of refresh token request
> 
> [11:14:56 Debug]
> IdentityServer4.EntityFramework.Stores.PersistedGrantStore
> MRNR65nTDUALsFTtuD6FKbzcHtXx9WB3xbclR+bdmJs= found in database: False
> 
> [11:14:56 Debug] IdentityServer4.Stores.DefaultRefreshTokenStore
> refresh_token grant with value:
> 386dd398df5b20566cc41befd44564221f999e0704b9c6d8ed5b3200a3e6b51e not
> found in store.
> 
> [11:14:56 Error] IdentityServer4.Validation.TokenValidator Invalid
> refresh token
> 
> [11:14:56 Error] IdentityServer4.Validation.TokenRequestValidator
> Refresh token validation failed. aborting.

From the logs above, it's clear that a key in the persistedGrant isn't found in the database. I don't know how to rectify this.

What do you suggest I do?

0

There are 0 best solutions below