Class JwtAuthenticationAutoConfiguration

java.lang.Object
org.finos.fluxnova.bpm.spring.boot.starter.rest.JwtAuthenticationAutoConfiguration

@Configuration @EnableConfigurationProperties({RestAuthenticationProperties.class,JwtAuthenticationProperties.class}) @AutoConfigureAfter(FluxnovaBpmRestJerseyAutoConfiguration.class) public class JwtAuthenticationAutoConfiguration extends Object
Spring Boot auto-configuration for REST API authentication.

Basic authentication can be enabled with:

 FLUXNOVA_BPM_AUTH_ENABLED=true
 FLUXNOVA_BPM_AUTH_TYPE=basic
 

JWT authentication can be enabled with:

 FLUXNOVA_BPM_AUTH_ENABLED=true
 FLUXNOVA_BPM_AUTH_TYPE=jwt
 FLUXNOVA_BPM_JWT_JWKS_URL=https://login.microsoftonline.com/{tenant}/discovery/v2.0/keys
 FLUXNOVA_BPM_JWT_ISSUER=https://login.microsoftonline.com/{tenant}/v2.0
 FLUXNOVA_BPM_JWT_AUDIENCE=api://your-client-id
 FLUXNOVA_BPM_JWT_USER_CLAIM_NAME=preferred_username
 FLUXNOVA_BPM_JWT_GROUPS_CLAIM_NAME=groups
 
  • Constructor Details

    • JwtAuthenticationAutoConfiguration

      public JwtAuthenticationAutoConfiguration()
  • Method Details

    • jwtAuthenticationPlugin

      @Bean @Conditional(org.finos.fluxnova.bpm.spring.boot.starter.rest.JwtAuthenticationEnabledCondition.class) public JwtAuthenticationPlugin jwtAuthenticationPlugin(JwtAuthenticationProperties props)
      Creates and initialises the JwtAuthenticationPlugin from the bound properties. The plugin validates the required fields and sets up the underlying JwtAuthenticationProvider.
    • jwtAuthenticationFilter

      @Bean @ConditionalOnMissingBean(name="processEngineAuthenticationFilter") @Conditional(org.finos.fluxnova.bpm.spring.boot.starter.rest.JwtAuthenticationEnabledCondition.class) public org.springframework.boot.web.servlet.FilterRegistrationBean<ProcessEngineAuthenticationFilter> jwtAuthenticationFilter(JwtAuthenticationPlugin jwtAuthenticationPlugin, org.springframework.boot.jersey.autoconfigure.JerseyApplicationPath applicationPath)
      Registers the ProcessEngineAuthenticationFilter with the JWT provider on the configured Jersey application path.

      The filter is ordered at 1 so it runs before any other application filters. If you need to change the order or URL pattern, define your own FilterRegistrationBean<ProcessEngineAuthenticationFilter> bean — Spring Boot will use yours instead via @ConditionalOnMissingBean.

      Suppressed when distro/run is present and has already registered its own processEngineAuthenticationFilter bean (e.g. via fluxnova.bpm.run.auth.enabled=true, authentication=jwt).

    • basicAuthenticationFilter

      @Bean @ConditionalOnMissingBean(name="processEngineAuthenticationFilter") @Conditional(org.finos.fluxnova.bpm.spring.boot.starter.rest.BasicAuthenticationEnabledCondition.class) public org.springframework.boot.web.servlet.FilterRegistrationBean<ProcessEngineAuthenticationFilter> basicAuthenticationFilter(org.springframework.boot.jersey.autoconfigure.JerseyApplicationPath applicationPath)