Created
January 9, 2020 22:43
-
-
Save brunapereira/dc8dbaf8ff589fdc59223dc3d5c95c5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| @EnableWebSecurity | |
| @Order(1) | |
| class FF4jSecurityConfig(private val properties: FF4JProperties): WebSecurityConfigurerAdapter() { | |
| override fun configure(auth: AuthenticationManagerBuilder) { | |
| auth.inMemoryAuthentication() | |
| .withUser(properties.user) | |
| .password("{noop}${properties.password}") | |
| .roles(properties.role) | |
| } | |
| override fun configure(http: HttpSecurity) { | |
| http.csrf().disable() | |
| .authorizeRequests() | |
| .antMatchers("/ff4j-web-console/**") | |
| .hasRole("ADMIN") | |
| .and() | |
| .httpBasic() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment