Class AbstractJwtGenerator<T extends com.nimbusds.jose.jwk.JWK>

java.lang.Object
org.frankframework.management.security.AbstractJwtGenerator<T>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
DefaultJwtKeyGenerator, HmacJwtGenerator, KeystoreJwtGenerator

public abstract class AbstractJwtGenerator<T extends com.nimbusds.jose.jwk.JWK> extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.nimbusds.jose.JWSHeader
     
    protected @Nullable com.nimbusds.jose.jwk.JWK
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractJwtGenerator(com.nimbusds.jose.JWSAlgorithm algorithm)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    final @NonNull String
    Uses the Spring Authentication object to create a signed JWT.
    final @NonNull String
    createJWT(Consumer<com.nimbusds.jwt.JWTClaimsSet.Builder> additionalClaims)
    Uses the Spring Authentication object to create a signed JWT.
    protected abstract T
     
    protected String
    getPrincipalName(org.springframework.security.core.Authentication authentication)
     
    protected abstract com.nimbusds.jose.JWSSigner
    getSigner(T jwkKey)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationContextAware

    setApplicationContext
  • Field Details

    • jwtHeader

      protected com.nimbusds.jose.JWSHeader jwtHeader
    • publicJwk

      protected @Nullable com.nimbusds.jose.jwk.JWK publicJwk
  • Constructor Details

    • AbstractJwtGenerator

      protected AbstractJwtGenerator(com.nimbusds.jose.JWSAlgorithm algorithm)
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getJwk

      protected abstract T getJwk() throws GeneralSecurityException, com.nimbusds.jose.JOSEException
      Throws:
      GeneralSecurityException
      com.nimbusds.jose.JOSEException
    • getSigner

      protected abstract com.nimbusds.jose.JWSSigner getSigner(T jwkKey) throws com.nimbusds.jose.JOSEException
      Throws:
      com.nimbusds.jose.JOSEException
    • createJWT

      public final @NonNull String createJWT()
      Uses the Spring Authentication object to create a signed JWT.
    • createJWT

      public final @NonNull String createJWT(Consumer<com.nimbusds.jwt.JWTClaimsSet.Builder> additionalClaims)
      Uses the Spring Authentication object to create a signed JWT. Allows users to provide additional JWT claims.
    • getPrincipalName

      protected String getPrincipalName(org.springframework.security.core.Authentication authentication)