facebook login testing

This commit is contained in:
liquidjoo
2019-05-27 11:34:18 +09:00
parent 319ad587bb
commit 992796000b
4 changed files with 20 additions and 18 deletions

View File

@@ -16,13 +16,13 @@ import java.util.List;
@EnableWebSecurity @EnableWebSecurity
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
// @Autowired @Autowired
// private UserArgumentResolver userArgumentResolver; private UserArgumentResolver userArgumentResolver;
//
// @Override @Override
// public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
// resolvers.add(userArgumentResolver); resolvers.add(userArgumentResolver);
// } }
@Bean @Bean
FilterRegistrationBean forwardedHeaderFilter() { FilterRegistrationBean forwardedHeaderFilter() {

View File

@@ -79,7 +79,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.authorizeRequests().anyRequest().authenticated() .authorizeRequests().anyRequest().authenticated()
.and() .and()
.oauth2Login() .oauth2Login()
.loginPage("/login").permitAll(); .loginPage("/login").defaultSuccessUrl("/mk-auth/login/success").permitAll();
// .and()
// .addFilterBefore(filter, CsrfFilter.class);
} }

View File

@@ -81,18 +81,18 @@ public class SsoController {
return user; return user;
} }
@GetMapping(value = "/loginSuccess") @GetMapping(value = "/login/success")
@ResponseBody @ResponseBody
public String loginComplete(@SocialUser User user) { public String loginComplete(@SocialUser User user) {
System.out.println(user); System.out.println(user);
return "kkkkkkkkk"; return "kkkkkkkkk";
} }
@GetMapping(value = "/login/success") // @GetMapping(value = "/login/success")
@ResponseBody // @ResponseBody
public String test2() { // public String test2() {
return "kkk"; // return "kkk";
} // }

View File

@@ -7,7 +7,7 @@ zuul.routes.mk2-service.url=http://127.0.0.1:8082
zuul.routes.mk2-service.sensitive-headers= zuul.routes.mk2-service.sensitive-headers=
zuul.routes.mk2-oauth.path=/mk-auth/** zuul.routes.mk2-oauth.path=/mk-auth/**
zuul.routes.mk2-oauth.url=https://6667b9ff.ngrok.io zuul.routes.mk2-oauth.url=https://59a7bc58.ngrok.io
zuul.routes.mk2-oauth.sensitive-headers= zuul.routes.mk2-oauth.sensitive-headers=
#zuul.routes.mk2-oauth.path=/mk2auth/** #zuul.routes.mk2-oauth.path=/mk2auth/**
@@ -18,13 +18,13 @@ security.oauth2.sso.login-path=/login
security.oauth2.client.access-token-uri=https://6667b9ff.ngrok.io/mk-auth/oauth/token security.oauth2.client.access-token-uri=https://59a7bc58.ngrok.io/mk-auth/oauth/token
# /oauth/authorize 요청은 클라이언트가 리소스 서버의 api를 사용하기 위해 사용자(리소스 소유자)에게 # /oauth/authorize 요청은 클라이언트가 리소스 서버의 api를 사용하기 위해 사용자(리소스 소유자)에게
# 권한 위임 동의를 받기 위한 페이지를 출력하는 기능을 수행 # 권한 위임 동의를 받기 위한 페이지를 출력하는 기능을 수행
security.oauth2.client.user-authorization-uri=https://6667b9ff.ngrok.io/mk-auth/oauth/authorize security.oauth2.client.user-authorization-uri=https://59a7bc58.ngrok.io/mk-auth/oauth/authorize
security.oauth2.resource.user-info-uri=https://6667b9ff.ngrok.io/mk-auth/user security.oauth2.resource.user-info-uri=https://59a7bc58.ngrok.io/mk-auth/user
#security.oauth2.resource.prefer-token-info=false #security.oauth2.resource.prefer-token-info=false
security.oauth2.client.client-id=system1 security.oauth2.client.client-id=system1