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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.web.servlet.FilterRegistrationBean<ProcessEngineAuthenticationFilter> basicAuthenticationFilter(org.springframework.boot.jersey.autoconfigure.JerseyApplicationPath applicationPath) org.springframework.boot.web.servlet.FilterRegistrationBean<ProcessEngineAuthenticationFilter> jwtAuthenticationFilter(JwtAuthenticationPlugin jwtAuthenticationPlugin, org.springframework.boot.jersey.autoconfigure.JerseyApplicationPath applicationPath) Registers theProcessEngineAuthenticationFilterwith the JWT provider on the configured Jersey application path.Creates and initialises theJwtAuthenticationPluginfrom the bound properties.
-
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 theJwtAuthenticationPluginfrom the bound properties. The plugin validates the required fields and sets up the underlyingJwtAuthenticationProvider. -
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 theProcessEngineAuthenticationFilterwith the JWT provider on the configured Jersey application path.The filter is ordered at
1so it runs before any other application filters. If you need to change the order or URL pattern, define your ownFilterRegistrationBean<ProcessEngineAuthenticationFilter>bean — Spring Boot will use yours instead via@ConditionalOnMissingBean.Suppressed when
distro/runis present and has already registered its ownprocessEngineAuthenticationFilterbean (e.g. viafluxnova.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)
-