Class SecurityConfig

java.lang.Object
org.odpi.openmetadata.userauthn.auth.SecurityConfig

@EnableWebSecurity @EnableMethodSecurity @Configuration public class SecurityConfig extends Object
Configuration of HttpSecurity for Spring security.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.authentication.AuthenticationManager
    authManager(org.springframework.security.authentication.AuthenticationProvider authProvider)
    Return the authentication manager.
    org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    Returns WebMvcConfigurer for the cors configuration.
    com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext>
    Get the jwk source.
    org.springframework.security.web.SecurityFilterChain
    securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity)
    Define the types of URLs that will be permitted to be called.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • userSearchBase

      @Value("${ldap.user.search.base}") protected String userSearchBase
    • userSearchFilter

      @Value("${ldap.user.search.filter}") protected String userSearchFilter
  • Constructor Details

    • SecurityConfig

      public SecurityConfig()
  • Method Details

    • authManager

      @Bean public org.springframework.security.authentication.AuthenticationManager authManager(org.springframework.security.authentication.AuthenticationProvider authProvider)
      Return the authentication manager.
      Parameters:
      authProvider - details of the expected provider
      Returns:
      manager
    • jwkSource

      @Bean public com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource()
      Get the jwk source.
      Returns:
      source
    • corsConfigurer

      @Bean @ConditionalOnProperty("cors.allowed-origins") public org.springframework.web.servlet.config.annotation.WebMvcConfigurer corsConfigurer()
      Returns WebMvcConfigurer for the cors configuration. The bean is based on springboot configuration property cors.allowed-origins
      Returns:
      corsConfigurer
    • securityFilterChain

      @Bean public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) throws Exception
      Define the types of URLs that will be permitted to be called.
      Parameters:
      httpSecurity - security object to configure
      Returns:
      configured HTTP security object
      Throws:
      Exception - something went wrong