spring-attic/spring-cloud-security

OAuth2 intercepter for feign does not re-issue invalid token

Ouverte

#220 ouverte le 2 sept. 2019

 (3 commentaires) (8 réactions) (0 personne assignée)Java (250 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (525 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hi,

If we check OAuth2RestTemplate it has an option retryBadAccessTokens which will try one more time to obtain new access token if previous token is invalid. This is useful if, for some reasons, you decide to revoke access token.

In OAuth2FeignRequestInterceptor access token is preserved in client context until it expires. There is no way to make feign to reissue new token until it expire.

The difficulty here that in feign interceptor is not responsible for retry. So what will be correct way to handle this issue? One of the option is to implement a feign retryer which will clean up client context.

If it is correct, do you want me to try to contribute this change?

Guide contributeur