계정 연결 해제

연결 해제는 플랫폼 또는 Google에서 시작할 수 있으며, 두 플랫폼 모두에 일관된 링크 상태가 표시되어 최상의 사용자 환경을 제공합니다. 토큰 취소 엔드포인트 또는 계정 간 보호 지원은 Google 계정 연결의 선택사항입니다.

다음과 같은 이유로 계정이 연결 해제될 수 있습니다.

    • 의 사용자 요청
    • Google 애플리케이션 또는 Google 계정 설정
    • 플랫폼
  • 만료된 갱신 토큰 갱신 실패
  • 나 또는 Google에서 시작한 기타 이벤트 예를 들어 악용 및 위협 감지 서비스에 의한 계정 정지

사용자가 Google에서 연결 해제를 요청함

사용자의 Google 계정 또는 앱을 통해 계정 연결 해제가 시작되면 이전에 발급된 액세스 및 갱신 토큰이 삭제되고, 사용자 동의가 삭제되며, 토큰 취소 엔드포인트를 구현하기로 한 경우 선택적으로 토큰 취소 엔드포인트를 호출합니다.

사용자가 플랫폼에서 연결 해제를 요청함

사용자 계정의 URL과 같이 사용자가 연결을 해제할 수 있는 메커니즘을 제공해야 합니다. 사용자에게 연결 해제 방법을 제공하지 않는 경우 사용자가 연결된 계정을 관리할 수 있도록 Google 계정 링크를 포함하세요.

위험 및 이슈 공유 및 공동작업 (RISC)을 구현하고 사용자 계정 연결 상태 변경사항을 Google에 알릴 수 있습니다. 이를 통해 플랫폼과 Google 모두 업데이트 상태를 새로고침하거나 액세스 토큰 요청에 의존하지 않고도 현재의 일관된 연결 상태를 표시하는 개선된 사용자 환경을 제공할 수 있습니다.

토큰 만료

원활한 사용자 환경을 제공하고 서비스 중단을 방지하기 위해 Google은 전체 기간이 거의 끝나갈 때 리프레시 토큰을 갱신하려고 시도합니다. 유효한 갱신 토큰을 사용할 수 없는 경우 계정을 다시 연결하는 데 사용자 동의가 필요한 시나리오가 있습니다.

만료되지 않은 여러 액세스 토큰과 새로고침 토큰을 지원하도록 플랫폼을 설계하면 클러스터링된 환경 간의 클라이언트-서버 교환에 존재하는 경합 상태를 최소화하고, 사용자 중단을 방지하며, 복잡한 타이밍 및 오류 처리 시나리오를 최소화할 수 있습니다. 최종적으로 일관성이 있지만 이전에 발급된 토큰과 새로 발급된 만료되지 않은 토큰이 모두 클라이언트-서버 토큰 갱신 교환 중과 클러스터 동기화 전에 잠시 사용될 수 있습니다. 예를 들어 이전 만료되지 않은 액세스 토큰을 사용하는 서비스에 대한 Google 요청은 새 액세스 토큰을 발급한 직후, 하지만 Google에서 수신 및 클러스터 동기화가 실행되기 전에 발생합니다. 갱신 토큰 순환의 대체 보안 조치를 사용하는 것이 좋습니다.

기타 이벤트

계정은 비활성 상태, 정지, 악의적인 행위 등 다양한 이유로 연결 해제될 수 있습니다. 이러한 시나리오에서 플랫폼과 Google은 계정 및 연결 상태의 변경사항을 서로 알림으로 전송하여 사용자 계정을 가장 효과적으로 관리하고 다시 연결할 수 있습니다.

Google에서 호출할 토큰 취소 엔드포인트를 구현하고 RISC를 사용하여 토큰 취소 이벤트를 Google에 알림으로 전송하여 플랫폼과 Google이 일관된 사용자 계정 연결 상태를 유지하도록 합니다.

토큰 취소 엔드포인트

OAuth 2.0 토큰 취소 엔드포인트를 지원하는 경우 플랫폼에서 Google의 알림을 받을 수 있습니다. 이를 통해 토큰을 무효화하고 보안 사용자 인증 정보를 삭제하는 등 있습니다.

요청의 형식은 다음과 같습니다.

POST /revoke HTTP/1.1
Host: oauth2.example.com
Content-Type: application/x-www-form-urlencoded

client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET&token=TOKEN&token_type_hint=refresh_token

토큰 취소 엔드포인트는 다음 매개변수를 처리할 수 있어야 합니다.

취소 엔드포인트 매개변수
client_id 요청 출처를 Google로 식별하는 문자열입니다. 이 문자열은 시스템 내에서 Google의 고유 식별자로 등록되어야 합니다.
client_secret 서비스를 위해 Google에 등록한 비밀번호 문자열입니다.
token 취소할 토큰입니다.
token_type_hint (선택사항) 해지되는 토큰의 유형(예: access_token 또는 refresh_token 지정하지 않으면 기본값은 access_token입니다.

토큰이 삭제되거나 잘못된 경우 응답을 반환합니다. 다음을 참고하세요. 예:

HTTP/1.1 200 Success
Content-Type: application/json;charset=UTF-8

어떤 이유로든 토큰을 삭제할 수 없는 경우 503 응답 코드를 반환합니다. 다음과 같습니다.

HTTP/1.1 503 Service Unavailable
Content-Type: application/json;charset=UTF-8
Retry-After: HTTP-date / delay-seconds

Google은 나중에 또는 Retry-After에서 요청한 대로 요청을 다시 시도합니다.

계정 간 보안 (RISC)

If you support Cross-Account Protection, your platform can notify Google when access or refresh tokens are revoked. This allows Google to inform users of link state changes, invalidate the token, cleanup security credentials, and authorization grants.

Cross-Account Protection is based on the RISC standard developed at the OpenID Foundation.

A Security Event Token is used to notify Google of token revocation.

When decoded, a token revocation event looks like the following example:

{
  "iss":"http://risc.example.com",
  "iat":1521068887,
  "aud":"google_account_linking",
  "jti":"101942095",
  "toe": "1508184602",
  "events": {
    "https://schemas.openid.net/secevent/oauth/event-type/token-revoked":{
      "subject_type": "oauth_token",
      "token_type": "refresh_token",
      "token_identifier_alg": "hash_SHA512_double",
      "token": "double SHA-512 hash value of token"
    }
  }
}

Security Event Tokens that you use to notify Google of token revocation events must conform to the requirements in the following table:

Token revocation events
iss Issuer Claim: This is a URL which you host, and it's shared with Google during registration.
aud Audience Claim: This identifies Google as the JWT recipient. It must be set to google_account_linking.
jti JWT ID Claim: This is a unique ID that you generate for every security event token.
iat Issued At Claim: This is a NumericDate value that represents the time when this security event token was created.
toe Time of Event Claim: This is an optional NumericDate value that represents the time at which the token was revoked.
exp Expiration Time Claim: Do not include this field, as the event resulting in this notification has already taken place.
events
Security Events Claim: This is a JSON object, and must include only a single token revocation event.
subject_type This must be set to oauth_token.
token_type This is the type of token being revoked, either access_token or refresh_token.
token_identifier_alg This is the algorithm used to encode the token, and it must be hash_SHA512_double.
token This is the ID of the revoked token.

For more information on field types and formats, see JSON Web Token (JWT).