Skip to content

[FEAT] 인증 서비스 및 Security 설정 구현 #27

@SooBin111

Description

@SooBin111

개요

JWT 기반 인증 서비스 전체와 Spring Security 설정을 구현합니다.
회원가입, 로그인, 토큰 갱신, Google OAuth, 비밀번호 재설정 등
인증 관련 전체 플로우를 포함합니다.

작업 내용

Auth API 구현

  • POST /api/auth/register/member - 일반 회원가입
  • POST /api/auth/register/manager - 매니저 회원가입
  • POST /api/auth/login/member - 일반 로그인
  • POST /api/auth/login/manager - 매니저 로그인
  • POST /api/auth/logout - 로그아웃 (인증 필요)
  • POST /api/auth/refresh - Access Token 갱신
  • GET /api/auth/check-email - 이메일 중복 확인
  • GET /api/auth/check-nickname - 닉네임 중복 확인
  • POST /api/auth/oauth/google - Google OAuth 로그인
  • POST /api/auth/password/reset-request - 비밀번호 재설정 요청
  • POST /api/auth/password/reset - 비밀번호 재설정

JWT / Security 구현

  • JwtProvider - JWT 토큰 생성 및 검증
  • JwtFilter - 요청마다 JWT 파싱 및 SecurityContext 인증 처리
  • CustomUserDetailsService - DB 기반 사용자 정보 로드
  • CustomAccessDeniedHandler - 403 응답 처리
  • JwtAuthenticationEntryPoint - 401 응답 처리
  • SecurityConfig - HTTP Method별 세분화된 접근 제어
    • 공개 API (Theme/Branch/Slot/MatePost/Review 조회, AI 추천 등) 인증 불필요
    • /api/admin/** → ADMIN 역할만
    • /api/owner/** → MANAGER 역할만

SecurityUtil 추가

  • SecurityContext에서 현재 로그인 사용자 accountId(Long) 추출 유틸

DTO

  • LoginRequest, SignupRequest, SignupResponse
  • TokenResponse, RefreshTokenRequest

체크리스트

  • AuthController 구현
  • AuthService 구현
  • JWT 필터 및 Provider 구현
  • SecurityConfig HTTP Method별 접근 제어
  • SecurityUtil 구현
  • 로컬 테스트 완료

참고

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions