Class JWTDecoderConfig

java.lang.Object
com.example.blogs.app.config.JWTDecoderConfig

@Configuration public class JWTDecoderConfig extends Object
Provides JWT decoder bean for validating and parsing JWT tokens in Spring Security OAuth2 resource server.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs JwtDecoderConfig with the configured HMAC SHA256 secret key.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.jwt.JwtDecoder
    Creates a JWT decoder bean that validates and parses JWT tokens using JJWT library.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JWTDecoderConfig

      public JWTDecoderConfig(@Value("${jwt.secret-key}") String secret)
      Constructs JwtDecoderConfig with the configured HMAC SHA256 secret key.
      Parameters:
      secret - the secret key for JWT verification, loaded from application properties
  • Method Details

    • jwtDecoder

      @Bean public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder()
      Creates a JWT decoder bean that validates and parses JWT tokens using JJWT library.
      Returns:
      JWT decoder for Spring Security OAuth2 resource server