계정 연결 해제

플랫폼 또는 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 요청한대로 요청을 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).