Class SecurityConfiguration

java.lang.Object
com.markvarga21.studentmanager.config.security.SecurityConfiguration

@Configuration @EnableWebSecurity @EnableMethodSecurity public class SecurityConfiguration extends Object
Configuration class for setting up the security related configurations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.authentication.AuthenticationManager
    This method is used to create an AuthenticationManager bean.
    org.springframework.security.authentication.AuthenticationProvider
    This method is used to create an AuthenticationProvider bean.
    org.springframework.web.cors.CorsConfigurationSource
    This method is used to configure the CORS configuration source.
    org.springframework.security.crypto.password.PasswordEncoder
    The password encoder bean.
    org.springframework.security.web.SecurityFilterChain
    securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity)
    This method is used to configure the security filter chain.
    org.springframework.security.core.userdetails.UserDetailsService
    This method is used to create a UserDetailsService bean.

    Methods inherited from class java.lang.Object

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

    • SecurityConfiguration

      public SecurityConfiguration()
  • Method Details

    • corsConfigurationSource

      @Bean public org.springframework.web.cors.CorsConfigurationSource corsConfigurationSource()
      This method is used to configure the CORS configuration source.
      Returns:
      The built CorsConfigurationSource object.
    • securityFilterChain

      @Bean public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) throws Exception
      This method is used to configure the security filter chain.
      Parameters:
      httpSecurity - The HttpSecurity object to configure the security filter chain.
      Returns:
      The SecurityFilterChain object.
      Throws:
      Exception
    • authenticationManager

      @Bean public org.springframework.security.authentication.AuthenticationManager authenticationManager()
      This method is used to create an AuthenticationManager bean.
      Returns:
      the created AuthenticationManager bean.
    • userDetailsService

      @Bean public org.springframework.security.core.userdetails.UserDetailsService userDetailsService()
      This method is used to create a UserDetailsService bean.
      Returns:
      The UserDetailsService object.
    • authenticationProvider

      @Bean public org.springframework.security.authentication.AuthenticationProvider authenticationProvider()
      This method is used to create an AuthenticationProvider bean.
      Returns:
      The AuthenticationProvider object.
    • passwordEncoder

      @Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
      The password encoder bean.
      Returns:
      a BCryptPasswordEncoder object.