Class JwtAuthentication


  • public final class JwtAuthentication
    extends AuthenticationBase
    Properties for access validation based on JSON Web Tokens (JWT).
    • Constructor Detail

      • JwtAuthentication

        public JwtAuthentication()
    • Method Detail

      • issuers

        public List<String> issuers()
        Get the issuers property: List of expected token issuers. Token issuer is valid if it matches at least one of the given values.
        Returns:
        the issuers value.
      • withIssuers

        public JwtAuthentication withIssuers​(List<String> issuers)
        Set the issuers property: List of expected token issuers. Token issuer is valid if it matches at least one of the given values.
        Parameters:
        issuers - the issuers value to set.
        Returns:
        the JwtAuthentication object itself.
      • audiences

        public List<String> audiences()
        Get the audiences property: List of expected token audiences. Token audience is valid if it matches at least one of the given values.
        Returns:
        the audiences value.
      • withAudiences

        public JwtAuthentication withAudiences​(List<String> audiences)
        Set the audiences property: List of expected token audiences. Token audience is valid if it matches at least one of the given values.
        Parameters:
        audiences - the audiences value to set.
        Returns:
        the JwtAuthentication object itself.
      • claims

        public List<TokenClaim> claims()
        Get the claims property: List of additional token claims to be validated. Token must contains all claims and respective values for it to be valid.
        Returns:
        the claims value.
      • withClaims

        public JwtAuthentication withClaims​(List<TokenClaim> claims)
        Set the claims property: List of additional token claims to be validated. Token must contains all claims and respective values for it to be valid.
        Parameters:
        claims - the claims value to set.
        Returns:
        the JwtAuthentication object itself.
      • keys

        public List<TokenKey> keys()
        Get the keys property: List of keys which can be used to validate access tokens. Having multiple keys allow for seamless key rotation of the token signing key. Token signature must match exactly one key.
        Returns:
        the keys value.
      • withKeys

        public JwtAuthentication withKeys​(List<TokenKey> keys)
        Set the keys property: List of keys which can be used to validate access tokens. Having multiple keys allow for seamless key rotation of the token signing key. Token signature must match exactly one key.
        Parameters:
        keys - the keys value to set.
        Returns:
        the JwtAuthentication object itself.