Package org.atmosphere.auth
Interface TokenRefresher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Optional SPI for server-side token refresh. When a
TokenValidator returns
TokenValidator.Expired, the AuthInterceptor
will attempt a refresh if a TokenRefresher is configured.
If the refresh succeeds, the new token is sent back to the client via the
X-Atmosphere-Auth-Refresh header or response body, depending on the transport.
- Since:
- 4.0
-
Method Summary
-
Method Details
-
refresh
Attempt to issue a new token for an expired one.- Parameters:
expiredToken- the expired token string- Returns:
- the new token if refresh succeeded, or empty if the token cannot be refreshed (e.g. refresh window exceeded, user revoked)
-