Skip to content
Snippets Groups Projects
Commit c0c0af33 authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Merge branch 'disable-spring-web-security-205' into 'master'

disabled spring web security

See merge request !141
parents 2ed6567f 8211feba
No related branches found
No related tags found
1 merge request!141disabled spring web security
Pipeline #83209 failed
/* Licensed Materials - Property of IBM */ /* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.notification.provider.ibm.security; package org.opengroup.osdu.notification.provider.ibm.security;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 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.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter { public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().authorizeRequests() http.csrf().disable();
.antMatchers("/test/challenge/**", // .authorizeRequests()
"/v1/api-docs", // .antMatchers("/test/challenge/**",
"/configuration/ui", // "/v1/api-docs",
"/swagger-resources/**", // "/configuration/ui",
"/configuration/security", // "/swagger-resources/**",
"/swagger-ui.html", // "/configuration/security",
"/info", // "/swagger-ui.html",
"/webjars/**") // "/info",
.permitAll().anyRequest().authenticated().and().oauth2ResourceServer().jwt(); // "/webjars/**")
} // .permitAll().anyRequest().authenticated().and().oauth2ResourceServer().jwt();
}
}
\ No newline at end of file }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment