Class JWTAuthenticator

java.lang.Object
io.debezium.server.http.jwt.JWTAuthenticator
All Implemented Interfaces:
Authenticator

public class JWTAuthenticator extends Object implements Authenticator
Implements the logic for authenticating against an endpoint supporting the JSON Web Tokens (JWT) scheme. Once authentication is successful, the authenticator can add the authentication details to the header of an HTTP request using a HTTPRequest.Builder instance. After the initial authentication is successful, additional authentication attempts will refresh the token.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • EXPIRATION_DURATION_MULTIPLIER

      private static final double EXPIRATION_DURATION_MULTIPLIER
      See Also:
    • username

      private final String username
    • password

      private final String password
    • tokenExpirationDuration

      private final long tokenExpirationDuration
    • refreshTokenExpirationDuration

      private final long refreshTokenExpirationDuration
    • jwtToken

      private String jwtToken
    • jwtRefreshToken

      private String jwtRefreshToken
    • client

      private final HttpClient client
    • authRequestBuilder

      private final HttpRequest.Builder authRequestBuilder
    • refreshRequestBuilder

      private final HttpRequest.Builder refreshRequestBuilder
    • mapper

      private final com.fasterxml.jackson.databind.ObjectMapper mapper
    • authenticationState

      private JWTAuthenticator.AuthenticationState authenticationState
    • expirationDateTime

      private Instant expirationDateTime
  • Constructor Details

    • JWTAuthenticator

      JWTAuthenticator(URI authUri, URI refreshUri, String username, String password, long tokenExpirationDuration, long refreshTokenExpirationDuration, Duration httpTimeoutDuration)
  • Method Details