social login working..

This commit is contained in:
liquidjoo
2019-05-22 18:39:00 +09:00
parent a83500bd4c
commit 939392c7f7
4 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
package io.bluemoon.gatewayzuul.config;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
/**
* 리소스 서버는 OAuth2 토큰에 의해 보호되는 리소스를 제공.
* Spring OAuth2는 이 보호 기능을 구현하는 Spring security 인증 필터를 제공.
*/
//@Configuration
//@EnableResourceServer
//@EnableOAuth2Sso
//@Order(value = -1)
public class GatewayConfiguration extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/mk-auth/**", "login").permitAll()
.anyRequest()
.authenticated();
}
}

View File

@@ -32,10 +32,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.regex.Pattern;
@Configuration
@EnableOAuth2Sso
@EnableResourceServer
@Order(value = -1)
@Order(value = 0)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
// @Bean