Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code
- ========
- @Configuration
- @EnableWebSecurity
- @ComponentScan(basePackageClasses = KeycloakSecurityComponents.class)
- public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
- @Autowired
- public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
- auth.authenticationProvider(keycloakAuthenticationProvider());
- }
- @Bean
- public KeycloakConfigResolver KeycloakConfigResolver() {
- return new KeycloakSpringBootConfigResolver();
- }
- @Override
- protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
- return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
- }
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- super.configure(http);
- http.authorizeRequests()
- .antMatchers("/api/v1/manual/kyc/**").authenticated()
- .anyRequest().permitAll();
- }
- @Override
- public void configure(final WebSecurity web) throws Exception {
- web.ignoring().antMatchers("/**");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement