Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aaf490e

Browse files
committed
1 parent 59cb3b2 commit aaf490e

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

‎auth/authentication-server/src/main/java/com/springboot/cloud/auth/authentication/config/ResourceServerConfig.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
package com.springboot.cloud.auth.authentication.config;
22

3+
import lombok.extern.slf4j.Slf4j;
34
import org.springframework.beans.factory.annotation.Value;
45
import org.springframework.context.annotation.Bean;
56
import org.springframework.context.annotation.Configuration;
7+
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
68
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
79
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
810
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
911
import org.springframework.security.oauth2.provider.token.TokenStore;
1012
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
1113
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
1214

15+
@Slf4j
1316
@Configuration
1417
@EnableResourceServer
1518
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
@@ -24,6 +27,15 @@ public void configure(ResourceServerSecurityConfigurer resourceServerSecurityCon
2427
.resourceId("WEBS");
2528
}
2629

30+
@Override
31+
public void configure(HttpSecurity http) throws Exception {
32+
log.debug("HttpSecurity configure method");
33+
http.csrf().disable();
34+
http.authorizeRequests()
35+
.antMatchers("/actuator/**").permitAll()
36+
.anyRequest().authenticated();
37+
}
38+
2739
@Bean
2840
public TokenStore tokenStore() {
2941
return new JwtTokenStore(accessTokenConverter());

‎auth/authentication-server/src/main/java/com/springboot/cloud/auth/authentication/config/WebServerSecurityConfig.java‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /