Class TokenManagerJWT

    • Constructor Detail

      • TokenManagerJWT

        public TokenManagerJWT()
    • Method Detail

      • addAuthHeader

        public void addAuthHeader​(org.apache.http.HttpRequest request)
        Add any headers to the request that are required Authentication and Authorisation.
        Specified by:
        addAuthHeader in interface TokenManager<TokenManagerJWT>
        Parameters:
        request - The request to modify.
      • isExpired

        public boolean isExpired()
      • getToken

        public String getToken()
      • validateToken

        public boolean validateToken​(String token)
      • setHttpClient

        public TokenManagerJWT setHttpClient​(org.apache.http.impl.client.CloseableHttpClient client)
        Set the HTTP client this TokenManager uses to fetch tokens.
        Specified by:
        setHttpClient in interface TokenManager<TokenManagerJWT>
        Parameters:
        client - The CloseableHttpClient to use for fetching Tokens.
        Returns:
        this TokenManager
      • getHttpClient

        public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
        Get the HTTP client this TokenManager uses to fetch tokens.
        Specified by:
        getHttpClient in interface TokenManager<TokenManagerJWT>
        Returns:
        The HTTP client this TokenManager uses to fetch tokens.
      • setTokenServerUrl

        public TokenManagerJWT setTokenServerUrl​(String tokenServerUrl)
        Set the URL to fetch tokens from. Usually in the form of http://example.com/auth/realms/{realm}/protocol/openid-connect/token
        Parameters:
        tokenServerUrl - The URL to fetch tokens from.
        Returns:
        this TokenManager
      • setJwtId

        public TokenManagerJWT setJwtId​(String jwtId)
        The ID to use for fetching tokens.
        Parameters:
        jwtId - The ID on the JWT auth server.
        Returns:
        this TokenManager
      • setJwtKey

        public TokenManagerJWT setJwtKey​(String jwtKey)
        Set the key to use for getting tokens.
        Parameters:
        jwtKey - The key to use for getting tokens.
        Returns:
        this TokenManager