Advertisement
Guest User

Untitled

a guest
Mar 12th, 2023
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Code
  2. ========
  3. @Configuration
  4. @EnableWebSecurity
  5. @ComponentScan(basePackageClasses = KeycloakSecurityComponents.class)
  6. public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
  7.  
  8. @Autowired
  9. public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
  10. auth.authenticationProvider(keycloakAuthenticationProvider());
  11. }
  12.  
  13. @Bean
  14. public KeycloakConfigResolver KeycloakConfigResolver() {
  15. return new KeycloakSpringBootConfigResolver();
  16. }
  17.  
  18. @Override
  19. protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
  20. return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
  21. }
  22.  
  23. @Override
  24. protected void configure(HttpSecurity http) throws Exception {
  25. super.configure(http);
  26. http.authorizeRequests()
  27. .antMatchers("/api/v1/manual/kyc/**").authenticated()
  28. .anyRequest().permitAll();
  29. }
  30. @Override
  31. public void configure(final WebSecurity web) throws Exception {
  32. web.ignoring().antMatchers("/**");
  33. }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement