Class ReactiveJwtSupportAutoConfiguration


  • @ConditionalOnWebApplication(type=REACTIVE)
    @ConditionalOnClass({org.bremersee.security.authentication.JsonPathReactiveJwtConverter.class,org.bremersee.security.authentication.WebClientAccessTokenRetriever.class})
    @Configuration
    @EnableConfigurationProperties({AuthProperties.class,MessageSourceProperties.class})
    public class ReactiveJwtSupportAutoConfiguration
    extends Object
    The reactive authentication support auto configuration.
    Author:
    Christian Bremer
    • Constructor Detail

      • ReactiveJwtSupportAutoConfiguration

        public ReactiveJwtSupportAutoConfiguration​(AuthProperties properties)
        Instantiates a reactive authentication support auto configuration.
        Parameters:
        properties - the properties
    • Method Detail

      • init

        @EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class)
        public void init()
        Init.
      • authenticationDetails

        @ConditionalOnMissingBean
        @Bean
        public org.bremersee.security.authentication.AuthenticationDetails authenticationDetails​(MessageSourceProperties messageSourceProperties)
        Creates authentication details bean.
        Parameters:
        messageSourceProperties - the message source properties
        Returns:
        the authentication details
      • jsonPathReactiveJwtConverter

        @ConditionalOnProperty(prefix="spring.security.oauth2.resourceserver.jwt",
                               name="jwk-set-uri")
        @ConditionalOnMissingBean
        @Bean
        public org.bremersee.security.authentication.JsonPathReactiveJwtConverter jsonPathReactiveJwtConverter()
        Creates a json path reactive jwt converter bean.
        Returns:
        the json path reactive jwt converter
      • webClientAccessTokenRetriever

        @Conditional(JwtSupportCondition.class)
        @ConditionalOnMissingBean
        @Bean
        public org.bremersee.security.authentication.WebClientAccessTokenRetriever webClientAccessTokenRetriever​(org.springframework.beans.factory.ObjectProvider<org.bremersee.security.authentication.ReactiveAccessTokenCache> accessTokenCache)
        Creates access token retriever.
        Parameters:
        accessTokenCache - the access token cache
        Returns:
        the web client access token retriever
      • passwordFlowReactiveAuthenticationManager

        @ConditionalOnProperty(prefix="bremersee.auth.password-flow",
                               name={"token-endpoint","client-id","client-secret"})
        @ConditionalOnBean(org.bremersee.security.authentication.JsonPathReactiveJwtConverter.class)
        @ConditionalOnMissingBean
        @Bean
        public PasswordFlowReactiveAuthenticationManager passwordFlowReactiveAuthenticationManager​(org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.jwt.ReactiveJwtDecoder> jwtDecoder,
                                                                                                   org.bremersee.security.authentication.JsonPathReactiveJwtConverter jwtConverter,
                                                                                                   org.bremersee.security.authentication.WebClientAccessTokenRetriever tokenRetriever)
        Creates password flow reactive authentication manager.
        Parameters:
        jwtDecoder - the jwt decoder
        jwtConverter - the jwt converter
        tokenRetriever - the token retriever
        Returns:
        the password flow reactive authentication manager