All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.server.config.WebSecurityConfig Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
package org.bidib.wizard.server.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig {

    @Bean
    SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

        http
            .authorizeRequests(authorize -> authorize.mvcMatchers("/**").permitAll())
            // sample anonymous customization
            .anonymous(anonymous -> anonymous.authorities("ROLE_ANON"));

        return http.build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy