SMTOWN 계정

연동 개발 가이드

로그인은 Authorization Code + PKCE, 사용자 식별은 OIDC, API 호출은 JWT Bearer access token을 씁니다.

반드시 지킬 것

Endpoint

이름메서드경로설명
DiscoveryGET/.well-known/openid-configurationissuer, endpoint, 지원 알고리즘
인가GET/oauth2/authorizeresponse_type=code, client_id, redirect_uri, scope, state, code_challenge(S256) 필수
tokenPOST/oauth2/tokenauthorization_code(+code_verifier), refresh_token, client_credentials
UserInfoGET/userinfoBearer access token. scope에 따라 sub, name, email
JWK SetGET/oauth2/jwks서명 검증용 공개 키(kid)
폐기POST/oauth2/revokeRFC 7009. Client 인증 필요
introspectionPOST/oauth2/introspectRFC 7662. Client 인증 필요
로그아웃GET/connect/logoutOIDC RP-Initiated Logout. id_token_hint, post_logout_redirect_uri

scope

scope내용API
openidOIDC 로그인. ID token 발급-
profile이름/api/v1/me, /api/v1.1/me, /api/about/me
email이메일(UserInfo)-
passport패스포트·스탬프/api/v1/me/passports/**, /api/v1/me/stamps
profile.info레거시 이름. 전환 기간에만 profile과 같게 처리profile과 같음

Spring Boot Client 예

spring:
  security:
    oauth2:
      client:
        registration:
          app-login:
            provider: sm-oauth
            client-id: ${CLIENT_ID}
            client-secret: ${CLIENT_SECRET}
            authorization-grant-type: authorization_code
            redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
            scope: [openid, profile]
        provider:
          sm-oauth:
            issuer-uri: https://auth.smtown.com

PKCE는 OAuth2AuthorizationRequestCustomizers.withPkce()로 켭니다. 전체 예제는 저장소의 service-client 모듈을 보세요.

기존 서버 경로(지원하지 않음)

새 서버에서는 동작하지 않습니다. 새 경로로 바꿔 연동해 주세요.

기존 서버새 서버
/oauth/authorize/oauth2/authorize
/oauth/token/oauth2/token
/oauth/check_tokenJWT 직접 검증(issuer-uri, audiences)
GET /oauth/revokePOST /oauth2/revoke