IdentityServer4 PersistedGrantStore - How to store refresh tokens

时间:2019-03-19 14:51:47

标签: identityserver4 refresh-token

I have implemented the IPesistedGrantStore in IdentityServer4 and am storing access tokens in a database. The Get method retrieves these access tokens correctly. The problem is with refresh tokens. How are they stored? For the access token I store the PersistedGrant object, which is: Key, Type, SubjectId, ClientId, CreationTime, Expiration, and Data. But the refresh token is not being stored. I know there is a refresh_token because that value is returned from a password token request in Postman, along with access_token, expires_in, and token_type.

So when I try and request a refresh token I get the following:

2019-03-19 13:28:19,326 [4] DEBUG PersistedGrantStore -> Grant retrieved: /jjI7S51px7ApIt+zVxiNDOUe5Y16kYfNTSp2f37WnU= 
2019-03-19 13:28:19,328 [4] DEBUG DefaultRefreshTokenStore -> refresh_token grant with value: 4cadcc4c0d5b7e77e78e353a773c838d7f66e48507ea5303f9349c86555ed896 not found in store. 
2019-03-19 13:28:19,330 [4] ERROR TokenValidator -> Invalid refresh token 

It's fetching the access token and states it's an invalid refresh token. So I'm totally confused.

0 个答案:

没有答案