FortnoxAB / csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
51 stars 64 forks source link

How to check for the expiry of the RefreshToken? #269

Open Sunita76 opened 1 year ago

Sunita76 commented 1 year ago

For checking the expiry of the AccessToken I can use: var auth = new StandardAuth(accessToken); var isExpired = auth.IsExpired(); Can I check the RefreshToken expiry also in the same way?

Thanks

richardrandak commented 1 year ago

No, the refresh token does not have the JWT format which could be decoded in order to retrieve its expiration time. Since the SDK does not know when the refresh token was obtained, there is no way to calculate the expiration time either.

So, you have implement your own way to manage the refresh token expiration time.

Sunita76 commented 1 year ago

Thanks a lot for the explanation.