Class JwtSupportAutoConfiguration

    • Constructor Detail

      • JwtSupportAutoConfiguration

        public JwtSupportAutoConfiguration​(AuthProperties properties)
        Instantiates a new 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 AuthenticationDetails authenticationDetails​(MessageSourceProperties messageSourceProperties)
        Creates authentication details bean.
        Parameters:
        messageSourceProperties - the message source properties
        Returns:
        the authentication details
      • jsonPathJwtConverter

        @ConditionalOnProperty(prefix="spring.security.oauth2.resourceserver.jwt",
                               name="jwk-set-uri")
        @ConditionalOnMissingBean
        @Bean
        public JsonPathJwtConverter jsonPathJwtConverter()
        Creates a json path jwt converter bean.
        Returns:
        the json path jwt converter
      • restTemplateAccessTokenRetriever

        @Conditional(JwtSupportCondition.class)
        @ConditionalOnMissingBean
        @Bean
        public RestTemplateAccessTokenRetriever restTemplateAccessTokenRetriever​(org.springframework.beans.factory.ObjectProvider<org.springframework.boot.web.client.RestTemplateBuilder> restTemplateBuilder,
                                                                                 org.springframework.beans.factory.ObjectProvider<AccessTokenCache> accessTokenCache)
        Creates access token retriever.
        Parameters:
        restTemplateBuilder - the rest template builder
        accessTokenCache - the access token cache
        Returns:
        the rest template access token retriever
      • passwordFlowAuthenticationManager

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