묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨스프링 시큐리티 OAuth2
AuthorizedClient 질문
OAuth2AuthorizedClient 의 클라이언트가클라이언트 서버를 의미하는 지리소스 오너의 정보를 의미하는 지 헷갈립니다.ㅠㅠ 클라이언트 서버에서 인증 받은 클라이언트라고 하면이걸 서버 입장에서의 사용자를 이야기 하는 건지무엇을 얘기하는 지 헷갈리네요..
-
미해결스프링 시큐리티 OAuth2
AbstractOAuth2UserService의 @Autowired
안녕하세요 정수원님. 덕분에 스프링 시큐리티를 알아가고 있습니다. 수강 중 문의드리고 싶은 점이 생겨 질문 드립니다.customUserDetailService에서는 @RequiredArgsConstructor로 생성자 초기화를 하고 AbstractOAuth2UserService에서는 @Autowired로 생성자 초기화를 하는데 이와 같은 방식으로 생성자 초기화를 설정하신 이유를 알고 싶습니다. 답변해주시면 정말 감사드리겠습니다!
-
해결됨스프링 시큐리티 OAuth2
Ajax 인증시 AuthenticationManager 등록 문의
Spring Authorization 1.0 을 사용하여 FormLogin 이 아닌 Ajax로 로그인을 하려고 합니다.Spring Security 강의를 참조하여AbstractAuthenticationProcessingFilter를 상속하여 CustomUserDetailsService, CustomAuthenticationProvider, CustomAuthenticationProcessingFilter, CustomAuthenticationToken 구현체를 만들었습니다.CustomAuthenticationProcessingFilter는 AbstractAuthenticationProcessingFilter 상속하여 개발하였는데 Filter를 등록 하려면 강의에서 내용처럼 AuthenticationManager를 등록 해줘여 하는데 강의는 WebSecurityConfigurerAdapter 상속하여 설정 하는것으로 설명되어 있는데 Spring Securitty 6.0 에서는 삭제되었습니다.Spring Security 의 강의를 보면 @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(ajaxAuthenticationProvider()); }configure(AuthenticationManagerBuilder auth)를 구현하고 @Bean public AjaxLoginProcessingFilter ajaxLoginProcessingFilter() throws Exception { AjaxLoginProcessingFilter filter = new AjaxLoginProcessingFilter(); filter.setAuthenticationManager(authenticationManagerBean()); return filter; } 질문)AjaxLoginProcessingFilter Bean 에서 설정하는데 SecurityFilterChain 를 등록하는 방식에서는 어떻게 등록해야 할지 문의 합니다.제가 구현한 소스 일부Authorization Server 설정을 다른 클래스에서 설정하였고 디버깅을 해보니 Authorization Server 용 FilterChain 과 로그인 처리용 FilterChain 이 따로 등록되어 로그인 프로세스는 Spring Security FilterChain Class 에서 진행하였습니다@Configuration는 Spring Security 6에서는 @EnableWebSecurity에 포함되지 않아 추가 하였습니다.@EnableWebSecurity @RequiredArgsConstructor @Configuration public class DefaultSecurityConfig { private final PasswordEncoder passwordEncoder; private final CustomAuthenticationProvider customAuthenticationProvider; // @Bean public CustomAuthenticationProcessingFilter customAuthenticationProcessingFilter() throws Exception { CustomAuthenticationProcessingFilter filter = new CustomAuthenticationProcessingFilter(); return filter; } // @formatter:off @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorizeRequests ->authorizeRequests .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers("/login/**").permitAll() .requestMatchers("/api/registered-client/**").permitAll() .anyRequest().authenticated() ) .csrf(csrf -> csrf .ignoringRequestMatchers(new AntPathRequestMatcher("/api/registered-client/**")) ) .formLogin().disable(); http.authenticationProvider(customAuthenticationProvider); http.addFilterBefore(customAuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class); return http.build(); } // @formatter:on }AuthenticationManager를 등록하지 않아 예와가 발생함Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customAuthenticationProcessingFilter' defined in class path resource [com/naon/oidc/security/config/DefaultSecurityConfig.class]: authenticationManager must be specified그리고 @Bean으로 만들어 등록하면 순환참조가 됩니다.
-
미해결스프링 시큐리티 OAuth2
Authorization Code Grant Type 문의
강사님 안녕하세요.신규 Authorization 서버를 구축해보고자 사전 지식 쌓을겸 강의를 현재 듣고 있습니다.Authorization code grant 방식으로 고려중인데 User Credentials을 사용안하고(openId X) 단순히 code 발급, token 발급, token 인증 형태의 기능만 사용하고 싶은 경우에 FilterChain에서 설정이 가능한지 궁금합니다. 브라우저를 통해 로그인 없이 단순 API 형태로써 말이죠.왜냐하면 다른 형태의 SSO Token을 내부적으로 활용해야 하는 방향으로 접근해야 해서, 리소스 획득을 위한 인증 방식으로 Authorization Code Grant Type을 적용해볼까 했습니다.항상 로그인을 통한 User Detail Repository 참조의 형태를 가져가는것이 기본인지 해당 기능을 off 할 수 있는지 궁금합니다.감사합니다.
-
미해결스프링 시큐리티 OAuth2
RSA 검증 기능 구현 - JwtAuthorizationRsaFilter
강의를 보다 의문이 생겨서 질문 드립니다.http.addFilterBefore(jwtAuthorizationRsaFilter(null), UsernamePasswordAuthenticationFilter.class);필터를 등록하실 때 jwtAuthorizationRsaFIlter에 null을 주셨습니다.@Bean public JwtAuthorizationRsaFilter jwtAuthorizationRsaFilter(RSAKey rsaKey) throws JOSEException { return new JwtAuthorizationRsaFilter(new RSASSAVerifier(rsaKey.toRSAPublicKey())); // 검증은 공개키 }그러나 jwtAuthorizationRsaFIlter는 파라미터에 넘어온 rsaKey를 이용하여 공개키를 찾는데 이 rsaKey는 어디서 주입 받는 것인가요??설정 클래스에 @Autowired는 모두 삭제한 것으로 알고 있습니다.jwtAuthenticationFilter를 등록할 때 역시 같은 이유로 어디서 주입 받는지 잘 모르겠습니다.
-
해결됨스프링 시큐리티 OAuth2
추가 질문 드립니다.
https://www.inflearn.com/questions/770325 안녕하세요.OAuth2 를 Toggle 버튼 등으로 계정 하나에 여러 SNS 계정을 연동하는 방법에 질문 드렸었는데, 상세 내용 전달 드립니다. 이와 같이, 보여드린 사진처럼 이미 로그인을 한 상태에서 네이버, 카카오 등을 연동하는 것입니다 제가 생각해보았었던 구현 방법을 한번 말씀 드리겠습니다.사용자 로그인 (JWT)회원 상세 정보 화면 이동상세 화면에서 위에서 첨부 드린 사진과 같이, sns 설정을 통해 네이버 연동 시작네이버 선택시 oauth2/authorization/naver redirect사용자 네이버 로그인 과정네이버 로그인이 완료되면 OAuth2UserService 에서 네이버 계정의 정보를 얻어 오고, 기존 계정과 연동을 하고자 하는데 기존 계정의 정보를 알 수 있는 방법이 도저히 떠오르지 않아서 질문을 드렸었습니다.한 가지 생각한 것은, 4번의 과정에서 기존 계정을 Cookie 에 저장하고, 추후에 naver 로그인이 완료 되고 AuthenticationSuccessHandler 에서 request 안에 있는 cookie 로 판별하는 것이었습니다.하지만 이 방법은 (1) 기존 계정에 SNS 연동을 하려고 하는 건지(지금 말씀드리고 있는 방법) (2)계정 로그인이 안된 상태에서 SNS 로그인 과정을 걸치는 건지 2가지 케이스가 있을 것 같은데, 이런 부분을 쿠키를 통해서 분기 처리를 한다는 것이 데이터 정합성에 문제가 생기지 않을까 염려되었습니다. (AuthenticationSuccessHandler 에서 쿠키만으로 기존 password 계정에 SNS 연동을 하는 것인지, 신규 SNS 회원 가입인지 판별하는 것은 위험해보였습니다. )쿠키 방식 말고, (1) 기존 계정에 SNS 연동을 하려고 하는 건지(지금 말씀드리고 있는 방법) (2)계정 로그인이 안된 상태에서 SNS 로그인 과정을 걸치는 건지 2가지 케이스 를 구분할 수 있는 방법에 대해 조언 해주시면 감사하겠습니다!
-
미해결스프링 시큐리티 OAuth2
git hub 들어가니 소스가 비어있습니다 강사님
git hub 들어가니 소스가 비어있습니다 강사님https://github.com/onjsdnjs/spring-security-oauth2/tree/master/src/main/java/io/security/oauth2
-
해결됨스프링 시큐리티 OAuth2
Authorization Code 궁금증이 있습니다.
안녕하세요 선생님 강의 잘 듣고 있습니다 Authorization Code 요청하기 강의를 듣고 궁금한점이 생겨서 질문 올립니다 이번 강의의 핵심은 임시코드 발급하기 였습니다 클라이언트가 keyCloak 와 연동해서 어떻게 redirect uri 를 만들고 어떻게 요청을 하고 인증이 완료 되는것도 같이 해보았습니다 다만 저는 좀 궁금한게 선생님이 총 2개의 로그인 방식을 보여주셨다고 생각합니다 이 링크를 클릭했을때의 방식 다른 방식은 세션을 완전히 제거한 이 화면에서 로그인 하는 방식을 보여주셨습니다 여기선 궁금한건 이번강의 주제는 임시코드를 발급받는 Filter 에 대해서 공부중인데첫번째 스크린샷에서는 선생님이 말씀하신 대로 OAuth2AuthorizationRequestRedirectFilter 에서 잘 요청이 들어옵니다requset 가 "/oauth2/authorization"; 들어오기 떄문인데 두번쨰 스크린샷에서는 전혀 이 필터를 태우지 않습니다 저는 임시코드 발급이라고 하길래 지금 할려는 스크린샷 1 , 2 두 행동 모두가 임시코드를 발급받기 위한 행동으로 알고 있습니다 그런데 첫번째 스크린샷은 OAuth2AuthorizationRequestRedirectFilter 필터를 태우고 두번째 스크린샷은 OAuth2LoginAuthenticationFilter 이 필터를 태우고 있습니다 이 앞의 configure 강의에서도 요청 순서 말씀하시면서 OAuth2AuthorizationRequestRedirectFilter 가 먼저 요청을 받아서 임시코드를 받아오고 그 다음 OAuth2LoginAuthenticationFilter 가 진행된다 라고 하셔서 제가 지금 혼동이 오는거 같습니다. 앞의 부분에서 제가 놓친 부분이 있을까요 선생님?
-
미해결스프링 시큐리티 OAuth2
OAuth 2.0 Token Endpoinr Flow - 클라이언트 인증하기
강의 영상이 로딩이 안돼고 있습니다P
-
해결됨스프링 시큐리티 OAuth2
JdbcOAuth2AuthorizationService에서 DB에 저장시 오류 원인
OAuth2AuthorizationService 구현체를 JdbcOAuth2AuthorizationService로 변경하였습니다.Spring Authorization Server 버전은 1.0 입니다.@Bean public OAuth2AuthorizationService authorizationService(JdbcTemplate jdbcTemplate, RegisteredClientRepository registeredClientRepository) { return new JdbcOAuth2AuthorizationService(jdbcTemplate, registeredClientRepository); }DB Schema : Spring Authorization Server 에서 제공/* IMPORTANT: If using PostgreSQL, update ALL columns defined with 'blob' to 'text', as PostgreSQL does not support the 'blob' data type. */ CREATE TABLE oauth2_authorization ( id varchar(100) NOT NULL, registered_client_id varchar(100) NOT NULL, principal_name varchar(200) NOT NULL, authorization_grant_type varchar(100) NOT NULL, authorized_scopes varchar(1000) DEFAULT NULL, attributes blob DEFAULT NULL, state varchar(500) DEFAULT NULL, authorization_code_value blob DEFAULT NULL, authorization_code_issued_at timestamp DEFAULT NULL, authorization_code_expires_at timestamp DEFAULT NULL, authorization_code_metadata blob DEFAULT NULL, access_token_value blob DEFAULT NULL, access_token_issued_at timestamp DEFAULT NULL, access_token_expires_at timestamp DEFAULT NULL, access_token_metadata blob DEFAULT NULL, access_token_type varchar(100) DEFAULT NULL, access_token_scopes varchar(1000) DEFAULT NULL, oidc_id_token_value blob DEFAULT NULL, oidc_id_token_issued_at timestamp DEFAULT NULL, oidc_id_token_expires_at timestamp DEFAULT NULL, oidc_id_token_metadata blob DEFAULT NULL, refresh_token_value blob DEFAULT NULL, refresh_token_issued_at timestamp DEFAULT NULL, refresh_token_expires_at timestamp DEFAULT NULL, refresh_token_metadata blob DEFAULT NULL, PRIMARY KEY (id) ); authorization code 발급시 로그인 화면 계정 정보 입력 후 MariaDB에 저장할떄 .BadSqlGrammarException 예외가 발생합니다, 질문1)에러 로그를 보면 insertAuthorization 메소드에서 attribute 컬럼에 Principal Class 자체를 저장하는 과정에서 발생하고 있습니다,다만,퀴리를 DB에서 직접 실행하면 저장이 되는것 으로 보아 Spring JDBCTemplate에서 변환시 오루가 발생하는거 같은데 원인이 궁급합니다. private void insertAuthorization(OAuth2Authorization authorization) { List<SqlParameterValue> parameters = this.authorizationParametersMapper.apply(authorization); try (LobCreator lobCreator = this.lobHandler.getLobCreator()) { PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, parameters.toArray()); this.jdbcOperations.update(SAVE_AUTHORIZATION_SQL, pss); } } Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap","java.security.Principal":{"@class":"org.springframework.security.authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":"org.springframework.security.web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":"org.springframework.security.core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null},"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":"http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"}}}] to -4 RegisteredClientRepository는 구현체를 JdbcRegisteredClientRepository 로 변경해도 이상없이 동작 하고 있고 JdbcAuthorizationConsentService는 JdbcOAuth2AuthorizationService 오류로 동의 단게가 진행되지 않아서 확인해보지 않았습니다. 질문2)이외에도Authorization Server에서 blob 컴럼에 Class 자체를 저장하는 사례가 많이 있는데 커스참 구현체를 만들어서 Class 를 저장하지 않고 Authorization Server 필요한 항목만 JSON 으로 저장 하거나 테이블을 정규화 하여 Map 에 담아 주는것이 좋은 방법일까요? 참고로 Attribe는 JwtGenerator에서 보면 nonce 을 가지고 오고 있습니다.if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(context.getAuthorizationGrantType())) { OAuth2AuthorizationRequest authorizationRequest = context.getAuthorization().getAttribute( OAuth2AuthorizationRequest.class.getName()); String nonce = (String) authorizationRequest.getAdditionalParameters().get(OidcParameterNames.NONCE); if (StringUtils.hasText(nonce)) { claimsBuilder.claim(IdTokenClaimNames.NONCE, nonce); } } 에러로그 전문org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO oauth2_authorization (id, registered_client_id, principal_name, authorization_grant_type, authorized_scopes, attributes, state, authorization_code_value, authorization_code_issued_at, authorization_code_expires_at,authorization_code_metadata,access_token_value,access_token_issued_at,access_token_expires_at,access_token_metadata,access_token_type,access_token_scopes,oidc_id_token_value,oidc_id_token_issued_at,oidc_id_token_expires_at,oidc_id_token_metadata,refresh_token_value,refresh_token_issued_at,refresh_token_expires_at,refresh_token_metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:101) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1538) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.insertAuthorization(JdbcOAuth2AuthorizationService.java:211) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.save(JdbcOAuth2AuthorizationService.java:189) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider.authenticate(OAuth2AuthorizationCodeRequestAuthenticationProvider.java:209) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182) ~[spring-security-core-6.0.1.jar:6.0.1]at org.springframework.security.oauth2.server.authorization.web.OAuth2AuthorizationEndpointFilter.doFilterInternal(OAuth2AuthorizationEndpointFilter.java:166) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.oauth2.server.authorization.web.OAuth2AuthorizationServerMetadataEndpointFilter.doFilterInternal(OAuth2AuthorizationServerMetadataEndpointFilter.java:84) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:116) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.AuthorizationServerContextFilter.doFilterInternal(AuthorizationServerContextFilter.java:61) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191) ~[spring-security-web-6.0.1.jar:6.0.1]at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:351) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-6.0.4.jar:6.0.4]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.4.jar:6.0.4]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.4.jar:6.0.4]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:859) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1734) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.5.jar:10.1.5]at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap","java.security.Principal":{"@class":"org.springframework.security.authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":"org.springframework.security.web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":"org.springframework.security.core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null},"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":"http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"}}}] to -4at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:282) ~[mariadb-java-client-3.0.10.jar:na]at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:336) ~[mariadb-java-client-3.0.10.jar:na]at org.mariadb.jdbc.BasePreparedStatement.setInternalObject(BasePreparedStatement.java:1172) ~[mariadb-java-client-3.0.10.jar:na]at org.mariadb.jdbc.BasePreparedStatement.setObject(BasePreparedStatement.java:608) ~[mariadb-java-client-3.0.10.jar:na]at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setObject(HikariProxyPreparedStatement.java) ~[HikariCP-5.0.1.jar:na]at org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:415) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:236) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:152) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.doSetValue(ArgumentPreparedStatementSetter.java:65) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService$LobCreatorArgumentPreparedStatementSetter.doSetValue(JdbcOAuth2AuthorizationService.java:621) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0]at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.setValues(ArgumentPreparedStatementSetter.java:50) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:963) ~[spring-jdbc-6.0.4.jar:6.0.4]at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-6.0.4.jar:6.0.4]... 68 common frames omitted
-
해결됨스프링 시큐리티 OAuth2
OAuth2 Login에 대해 궁금한 점
안녕하세요해당 강의를 통해서 OAuth2 로그인을 따라해보면서, 궁금한 점이 생겨서 질문 드립니다.만약에 기존 유저에 OAuth2 로그인을 적용시키려면 어떻게 하는 지 궁금하네요..요즘 여러 서비스에서, OAuth2를 도입하고 기존 계정에 Toggle 버튼 같이 네이버, 카카오 등을 On, Off 할 수 있는 기능들을 제공합니다하지만 Spring Security OAuth2 Login 기능으로 기존 계정에 on,off 처럼 연결이 가능할까 의문도 들고 생각도 해봤지만 도저히 떠오르지 않더라구여더군다나 기존 계정에 JWT 로 인증을 하고 있었다면 불가능하지 않나 생각이 들었습니다.너무 막연하게 질문을 드렸는데, 정확하게 알고 싶은 것은 유저 상세 페이지에서 토글 버튼 같은 것으로 네이버 연동을 시도하여 네이버 로그인을 시도했을 때,OAuth2UserService 에서 기존 유저에 대한 정보를 알 수 있는 방법이 있는 지 궁금합니다
-
해결됨스프링 시큐리티 OAuth2
OAuth2 로그인 이후 통신 방법
안녕하세요.OAuth2 로그인 이후에 검증 방식에 대해 궁금한 점이 있어서 질문 드려봅니다.현재 프로젝트에서 OAuth2 를 이용하여 로그인 하는 기능을 사용하고자 하여, 강사님의 강의를 통해 OAuth2 Login을 적용시켰습니다.OAuth2 를 이용하여 회원가입을 하고, 회원가입이 완료되어 OAuth2로 로그인하면, 자체적으로 생성한 JWT Token 을 이용하여 Client 와 통신을 하는 방식으로 구현하였습니다.API 호출 마다 JWT 토큰만으로 인증을 하고 있었는데, JWT 토큰 이후 이 유저가 OAuth2(예를들어 네이버 같은 서버)에서도 유효한 회원인 지 검증이 필요하지 않을까 생각이 들었고,유저가 OAuth2 서버에서 유효한 회원인 지 검증 하는 부분을 만들고자 하는데, 내부적으로 이용할 수 있는 기능이 있는지 문의 드립니다.ClientRegistration 에 user-info-uri 를 통해 유저 정보를 가져오기 때문에, 예를 들어 oauth2_authorized_client의 accessToken을 이용하여 Naver(OAuth2)에서 회원을 간단하게 조회하고 검증 작업을 진행하면 되지 않을까 해서 내부적으로 이용할 수 있는 기능이 있을 것 같아서요..아니면 OAuth2 로그인 이후에 검증 방식에 대해서 제가 잘못 이해한 부분이 있다면 말씀 부탁 드리겠습니다감사합니다.
-
미해결스프링 시큐리티 OAuth2
무한리디렉션 궁금증
안녕하세요 선생님 강의 잘듣고 있습니다 오늘 처음으로 spring 시큐리티와 keycloak 와 사용해서 간단한 RestController 을 만들어서 keycloak 로 로그인하는 강의를 들었는데 궁금점이 생겼습니다 applition.yml redirect 구성하실때 http://localhost:8081/login/oauth2/code/keycloak이 주소가 시큐리티 ouath2 로그인 고유 주소인가요? 제가 테스트한다고 oauth2 에 다른 문자열을 넣고 돌리면 리디렉션이 너무 많다고 크롬 , 엣지에서 오류가 발생합니다 ex1) clientId - OAuth2-client-appredirectUri=http://localhost:8081/login/oauth2/code/keycloakex2)clientId - OAuth2-client-appredirectUri=http://localhost:8081/login/OAuth2-client-app/code/keycloak 이렇게 비교를 해보았는데 1번은 로그인이 잘되고 2번은 계속 무한 리디렉션이 나옵니다 그래서 ex1) 번을 크롬 개발자 도구로 쫒아 가보니 1) http://localhost:8081/oauth2/authorization/keycloak status :302 Location: http://localhost:8080/realms/spring-security-OAuth2/protocol/openid-connect/auth?response_type=code&client_id=OAuth2-client-app&scope=openid%20email%20profile&state=wNz-VZFRvu_Nr8KUFYjRshELNLOFbUZVO9vWdcEQrs4%3D&redirect_uri=http://localhost:8081/login/oauth2/code/keycloak&nonce=ehS4VAjQJBrDf7APtHtUbWuzwdOnCJAOd8BhRhSohoU 2) http://localhost:8080/realms/spring-security-OAuth2/protocol/openid-connect/auth?response_type=code&client_id=OAuth2-client-app&scope=openid%20email%20profile&state=wNz-VZFRvu_Nr8KUFYjRshELNLOFbUZVO9vWdcEQrs4%3D&redirect_uri=http://localhost:8081/login/oauth2/code/keycloak&nonce=ehS4VAjQJBrDf7APtHtUbWuzwdOnCJAOd8BhRhSohoUstatus : 302 Location: http://localhost:8081/login/oauth2/code/keycloak?state=wNz-VZFRvu_Nr8KUFYjRshELNLOFbUZVO9vWdcEQrs4%3D&session_state=0e8d5564-fa24-4521-9bd9-bd931d42beb7&code=58d084f3-272e-4e31-ad4d-edc808fde122.0e8d5564-fa24-4521-9bd9-bd931d42beb7.e3344d0f-ca0d-44fd-8993-08b7b90ca190 3) http://localhost:8081/login/oauth2/code/keycloak?state=wNz-VZFRvu_Nr8KUFYjRshELNLOFbUZVO9vWdcEQrs4%3D&session_state=0e8d5564-fa24-4521-9bd9-bd931d42beb7&code=58d084f3-272e-4e31-ad4d-edc808fde122.0e8d5564-fa24-4521-9bd9-bd931d42beb7.e3344d0f-ca0d-44fd-8993-08b7b90ca190status : 302 Location: http://localhost:8081/ 스프링 시큐리티 안에서 oauth2 가 가지는 고유의 엔드포인트 라고 생각을 해야 하는게 맞는거겠죠? 무한리디렉션이 생기는 이유는 솔직히 모르겠습니다 아마 로그인 권한은 획득했는데.. 그 이후는 잘 모르겠습니다.
-
미해결스프링 시큐리티 OAuth2
선행학습 질문
안녕하세요 강의 듣기 초반인데 상세한 설명이 너무 좋은것 같습니다~! 나중엔 다 수강을 할 예정이지만 OAuth2를 먼저 사용하게 될 예정이라 1편 실전프로젝트 전 단계인 스피링시큐리티 기본API 및 Filter 이해 , 주요 아키텍처 이해 정도만 선행으로 듣고 OAuth2를 들어도 될까요? 아님 실전프로젝트도 다 듣고 OAuth2를 듣는게 좋을까요?
-
미해결스프링 시큐리티 OAuth2
안녕하세요 MSA 구성을 진행하고 있는 뉴비 신입 개발자입니다.
KeyCloak 을 인가서버로 활용하고Resource 자원 사용하는 Data API 인가 처리를 하는 Auth API (Gateway) 를 구현해서 진행하고 있습니다.그런데 너무 여러가지 방식이 많다보니 혼돈이 와서 선생님이 가르쳐주신 방식으로 인가와 인증을 구현하려고하는데,인가 서버 -> KeyCloak 사용 게이트 웨이에 Oauth2 를 넣으려고 하는데 개념적으로 궁금한 점이 있어 여쭤봅니다.공개 클라이언트 방식과 기밀 클라이언트 가 구현함에 있어 어떤 차이를 가지는지 의문입니다.가령 react -> KeyCloak 요청 시 token 을 바로 가져오려고 하는데, 이 토큰을 받는 것 까진 문제가 없습니다. 하지만 영상에서 보여주신 것과 같이 자원 API 로 접근하는 권한을 획득하기 위해서 기밀 클라이언트 방식으로 구현하면 code 를 리다이렉트 받은 uri 와 token 요청시 리다이렉트 uri 가 같아야하는 문제가 있어서 code 를 auth api 로 받은 뒤 토큰 엔드포인트를 찍어 스프링 프로젝트에서 가져올 때 오류가 발생합니다.react -> keycloak -> code 반환 받은 것 -> spring -> redirect uri 문제로 토큰 발급 불가 가 되는데 어떤 형식으로 처리해야 맞는 것인지 궁금합니다.
-
해결됨스프링 시큐리티 OAuth2
강의에 매칭되는 git branch 찾기가 매우 힘듭니다.
안녕하세요 !git branch 마다 README 파일이 있는건 아니라서강의에 해당하는 git branch 를 찾기가 매우 힘듭니다.혹시 강의와 브렌치의 매핑이 정리된 자료가 있나요 ?
-
미해결스프링 시큐리티 OAuth2
keycloack userinfo 403 forbidden error
https://www.inflearn.com/questions/693312/profile-email-%EA%B6%8C%ED%95%9C%ED%8E%98%EC%9D%B4%EC%A7%80%EA%B0%80-%EB%82%98%EC%98%A4%EC%A7%80-%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4 해당 페이지에 있는 해결 방법 그대로consent required를 킨 후에access token을 받아오는 것 까지는 잘 되는데,마찬가지로 userinfo 요청시http://localhost:8080/realms/oauth2/protocol/openid-connect/userinfo에 Authorization에 Bearer Token타입 체크 후Token값도 받아온 access_token값으로 잘 넣어줬는데도403 forbidden 에러가 뜨네요무엇이 잘못된걸까요keycloack버전은 20.0.2입니다
-
미해결스프링 시큐리티 OAuth2
Spring Boot 를 이용해 JWT + Social 로그인 처리 질문 있습니다.
안녕하세요. 우선 좋은 강의 제공 해주셔서 감사드립니다 :) 이번에 회사에서 신규 프로젝트로Client Server (Vue, React, Android, IOS)Back Server (Spring Boot)해당 언어로 구성하기로 결정 되었습니다. 신규 프로젝트에 있어서 가장 중요한 부분이 인증 및 인가 시스템인데요.여기서 우리는 JWT + Spring Security 를 사용하기로 결정되었고특히 Social Login 경우 Grant Type 을 "Authorization Code Grant Type" 을 이용하기로 했습니다.아무래도 Authorization Code Grant Type 이 가장 안전하기 때문 입니다. 앞써 말씀드렸지만 Client Server 를 vue, react, Android, ois 를 이용 계획이고Authorization Code Grant Type 을 동시에 이용하면서 인증 처리 할 예정인데요. 인증이 성공적으로 완료된다면 자체적으로 JWT 토큰을 생성해서 Access Token 을 만들고 Client 서버 에게 반환 해서 반환 받은 Client 서버들을 Resouce Server 에서 자원을 요청 하는 시스템입니다. 우선 이미지를 보면서 시나리오를 설명 드리도록 하겠습니다. 일반 로그인A 사용자가 아이디 하고 패스워드를 입력 후 Authorization Server(Spring Boot) 로 전송한다. 인증 처리가 완료 되면 A 사용자 그러니깐 Client 서버에게 자체적으로 JWT Token 을 만들어서 Access Token을 전송한다. Client Server 는 자체적으로 만든 JWT Token (Access Token) 을 쿠키에 저장 하고 Resource Server 에 요청 한다. Social 로그인Client 서버 접속한 사용자는 KaKao 소셜 로그인 버튼을 클릭한다. (요청 파라미터는 카카오로 부터 제공 받은 client_id, redirect_uri + response_type 을 'code' 로 지정한다.) KaKao Authorization Server 는 요청 받은 파라미터로 Client 식별하고 사용자에게 kakao 로그인 페이지를 보여드린다. 생략 되었지만 인가 처리되었다면 임시 코드값을 지정한 redirect uri 통해 client server 로 전송한다. 임시 코드를 받은 Client Server 는 자체적으로 구축한 Authorization Server(Spring Boot) 로 전송한다. 임시 코드를 전송 받은 데이터와 client_id, client_secret, response_type 함께 KaKao Authorization Server 로 요청한다 (Access Token 받기 위해) 인증이 완료되면 KaKao Authorization Server 는 Authorization Server(Spring Boot) 로 인가처리가 완료되었음을 의미하는 Access Token 만들어 전송한다. Access Token 을 발급 받은 Authorization Server(Spring Boot) 서버는 해당 Access Token 을 이용해서 인증 처리하기 위해 KaKao Authorization Server 로 요청한다. 인증 처리 완료되었다면 해당 접속자의 유저 정보를 전송 한다. 해당 유저 정보를 이용해서 회원 가입 프로세스 처리 동시에 자체적으로 JWT Token (Resource Server 접근 하기 위한) 을 생성해서 Client Server에 반환 한다. Client Server 는 자체적으로 만든 JWT Token (Access Token) 을 쿠키에 저장 하고 Resource Server 에 요청 한다. 선생님 강의에서는 Client Server 경우 Spring Boot Security 을 이용했던거와 달리클라이언트 서버 경우 Vue, React, Android, IOS 사용 할려고 합니다.그리고 Grant Type 을 "Authorization Code Grant Type" 사용 하기 때문에 일반 로그인 경우는 문제가 없는데Social 로그인 경우 프로세스를 어떻게 하면 잘 구성 될지 제 나름대로 고민을 해보았습니다. Implicit Grant Type 경우를 사용하면 쉽게 처리 할 수 있을것 같은데Grant Type 을 "Authorization Code Grant Type" 사용 할려다 보니 많이 복잡해지고 이렇게 작동이 될지 의문도 들고 이런 저런 생각이 드네요. 또한 Client Server 경우 절대로 client_secret 을 노출 해서는 안되다는 점 제한으로 이러저런 구성하는데 힘이 좀 들었습니다한번 선생님에게 제가 구상한 프로세스를 피드백 받고 싶어 이렇게 질문 드립니다. 항상 소중한 강의 제공해주셔서 감사드리고 답변 부탁드립니다. 감사합니다 :)
-
해결됨스프링 시큐리티 OAuth2
Spring Authorization Server 1.0 관련
https://spring.io/projects/spring-authorization-serverSpring Authorization Server 1.0이 정식으로 출시되었고 강의는 만들어진 시간으로 보아 0.31 기반인거 같은데 1.0(0.4)에 대한 보강 계획은 있으신지요?
-
미해결스프링 시큐리티 OAuth2
OAuth2 로그인 구현 - Authorization Code 요청하기 - OAuth2AuthorizationRequest 객체 세션 저장 문제
안녕하세요! 좋은 강의 너무 감사드립니다! 한가지 질문 드릴께 있습니다. OAuth2 로그인 구현 - Authorization Code 요청하기26:25분내용을 보면 첫번째 인증 단계! (response type = code)OAuth2AuthorizationRequest 객체 담아서인가 서버 (keyclack 서버) 에 전달 하게 되는데요이것과 동시에 OAuth2AuthorizationRequest 객체를 sesstion 에 저장을 하게 됩니다. 그러면 사용자는 인가 서버 (keyclack 서버) 로그인을 성공적으로 해결된다면 미리 지정된 redirect url 통해Authorization Code 값을 전달해주는데요!그런 후 미리 OAuth2AuthorizationRequest 객체를 sesstion 저장된것을 가져오는데 만약 해당 서버가 1개 라서 다행이지만scale out 경우 그러니깐 서버가 2대 이상이라면 맨처음 OAuth2AuthorizationRequest 객체 저장할때가 1번 서버라면 OAuth2AuthorizationRequest 객체를 가져올때가 2번 서버라면 이때 각각 다른 서버이기 때문에 가져오지 못하는 문제가 발생되지 않나요? 이때는 어떻게 해결해야 할까요??.. OAuth2AuthorizationRequest 객체를 외부 세션 서버로 저장 할수 있도록 다시 로직을 재구현 해야 하는걸까요?