Skip to content

Commit f6b5f3f

Browse files
committed
No authentication when HTTP request method is "GET"
1 parent 6416d37 commit f6b5f3f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/gnuhpc/bigdata/config/WebSecurityConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.springframework.beans.factory.annotation.Value;
88
import org.springframework.context.annotation.Bean;
99
import org.springframework.context.annotation.Configuration;
10+
import org.springframework.http.HttpMethod;
1011
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
1112
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
1213
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -48,6 +49,7 @@ protected void configure(HttpSecurity http) throws Exception {
4849
http.csrf().disable();
4950
if (securityCheck) {
5051
http.authorizeRequests().antMatchers("/api", "/swagger-ui.html", "/webjars/**", "/swagger-resources/**", "/v2/**").permitAll()
52+
.antMatchers(HttpMethod.GET, "/**").permitAll()
5153
.anyRequest().authenticated();
5254
http.httpBasic().authenticationEntryPoint(basicAuthenticationPoint);
5355
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

0 commit comments

Comments
 (0)