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.

@FunctionalInterface public interface TokenRefresher
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

    Modifier and Type
    Method
    Description
    refresh(String expiredToken)
    Attempt to issue a new token for an expired one.
  • Method Details

    • refresh

      Optional<String> refresh(String expiredToken)
      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)