feat: 구글 로그인/가입 — ID 토큰 검증 후 세션 발급
- AuthService.googleLogin: 구글 tokeninfo 로 ID 토큰 검증(aud==클라이언트 ID)
후 provider=GOOGLE 회원 조회/자동가입 → 세션 발급(login 과 동일 경로)
- GoogleLoginRequest DTO, /api/auth/google·/google-client-id 엔드포인트
- application.yml: app.google-client-id=${GOOGLE_CLIENT_ID:}
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a1697a7a22
commit
09efd65fa9
@@ -56,6 +56,18 @@ public class AuthController {
|
||||
return authService.login(req, clientIp(request));
|
||||
}
|
||||
|
||||
/** 구글 OAuth 클라이언트 ID (비보호) — 프론트가 구글 버튼 노출/초기화에 사용. 미설정 시 빈 문자열 */
|
||||
@GetMapping("/google-client-id")
|
||||
public java.util.Map<String, String> googleClientId() {
|
||||
return java.util.Map.of("clientId", authService.googleClientId());
|
||||
}
|
||||
|
||||
/** 구글 로그인/가입 (비보호) — ID 토큰 검증 후 세션 발급 */
|
||||
@PostMapping("/google")
|
||||
public LoginResponse googleLogin(@Valid @RequestBody com.sb.web.auth.dto.GoogleLoginRequest req) {
|
||||
return authService.googleLogin(req.getIdToken(), req.isRememberMe());
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
public ResponseEntity<Void> logout(HttpServletRequest request) {
|
||||
authService.logout(AuthInterceptor.resolveToken(request));
|
||||
|
||||
Reference in New Issue
Block a user