Class JwtAuthenticationProvider

java.lang.Object
com.auth0.spring.security.api.JwtAuthenticationProvider
All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider

public class JwtAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
  • Constructor Details

    • JwtAuthenticationProvider

      public JwtAuthenticationProvider(byte[] secret, String issuer, String audience)
    • JwtAuthenticationProvider

      public JwtAuthenticationProvider(com.auth0.jwk.JwkProvider jwkProvider, String issuer, String audience)
    • JwtAuthenticationProvider

      public JwtAuthenticationProvider(byte[] secret, String[] issuers, String audience)
    • JwtAuthenticationProvider

      public JwtAuthenticationProvider(com.auth0.jwk.JwkProvider jwkProvider, String[] issuers, String audience)
  • Method Details

    • supports

      public boolean supports(Class<?> authentication)
      Specified by:
      supports in interface org.springframework.security.authentication.AuthenticationProvider
    • authenticate

      public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
      Specified by:
      authenticate in interface org.springframework.security.authentication.AuthenticationProvider
      Throws:
      org.springframework.security.core.AuthenticationException
    • withJwtVerifierLeeway

      public JwtAuthenticationProvider withJwtVerifierLeeway(long leeway)
      Allow a leeway to use on the JWT verification.
      Parameters:
      leeway - the leeway value to use expressed in seconds.
      Returns:
      this same provider instance to chain calls.