Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Notification
Commits
4d63c750
Commit
4d63c750
authored
Sep 09, 2021
by
Meghnath Saha
Browse files
Disabling Spring Web Security for ODI Services
parent
338d1865
Pipeline
#64314
failed with stages
in 12 minutes and 12 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/security/SecurityConfig.java
View file @
4d63c750
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package
org.opengroup.osdu.notification.provider.ibm.security
;
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.WebSecurityConfigurerAdapter
;
@Configuration
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
public
class
SecurityConfig
extends
WebSecurityConfigurerAdapter
{
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
().
disable
().
authorizeRequests
()
.
antMatchers
(
"/test/challenge/**"
,
"/v1/api-docs"
,
"/configuration/ui"
,
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui.html"
,
"/info"
,
"/webjars/**"
)
.
permitAll
().
anyRequest
().
authenticated
().
and
().
oauth2ResourceServer
().
jwt
();
}
}
\ No newline at end of file
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package
org.opengroup.osdu.notification.provider.ibm.security
;
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.WebSecurityConfigurerAdapter
;
@Configuration
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
public
class
SecurityConfig
extends
WebSecurityConfigurerAdapter
{
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
().
disable
();
// .authorizeRequests()
// .antMatchers("/test/challenge/**",
// "/v1/api-docs",
// "/configuration/ui",
// "/swagger-resources/**",
// "/configuration/security",
// "/swagger-ui.html",
// "/info",
// "/webjars/**")
// .permitAll().anyRequest().authenticated().and().oauth2ResourceServer().jwt();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment