imgbrd-grabber icon indicating copy to clipboard operation
imgbrd-grabber copied to clipboard

OAuth2 authentication fetches expiration from the refresh token on non-standard implementations

Open Bionus opened this issue 1 year ago • 0 comments

When a source's OAuth2 token endpoint does not use expires or expires_in in its response, Grabber will try to get the expiration time from the refresh token's exp JWT claim, instead of the access token's.

Both expirations should be treated separately, but we should also consider that in most cases, refresh tokens aren't JWT and their expiration is not often indicated in responses, so we should gracefully handle the case where only the access token's expiration is known.

Bionus avatar Dec 21 '23 11:12 Bionus