Hesapların bağlantısını kaldırma

Bağlantı kaldırma işlemi platformunuzdan veya Google'dan başlatılabilir. Her ikisinde de tutarlı bir bağlantı durumunun gösterilmesi en iyi kullanıcı deneyimini sağlar. Google Hesabı Bağlantısı için jeton iptali uç noktası veya Hesaplar Arası Koruma desteği isteğe bağlıdır.

Hesapların bağlantısı aşağıdakilerden herhangi biriyle kaldırılabilir:

    • kullanıcısından gelen istek
    • bir Google uygulaması veya Google Hesabı ayarları
    • Platformunuz
  • Süresi dolmuş bir yenileme jetonunun yenilenememesi
  • Sizin veya Google'ın başlattığı diğer etkinlikler. Örneğin, kötüye kullanım ve tehdit algılama hizmetleri tarafından hesabın askıya alınması.

Kullanıcı, Google ile bağlantının kaldırılmasını istedi

Kullanıcının Google Hesabı veya uygulaması üzerinden başlatılan hesap bağlantısını kaldırma işlemi, daha önce verilen tüm erişim ve yenileme jetonlarını siler, kullanıcı iznini kaldırır ve isteğe bağlı olarak, jeton iptali uç noktanızı (bir uç nokta uygulamayı seçtiyseniz) çağırır.

Kullanıcı, platformunuzla bağlantının kaldırılmasını istedi

Kullanıcılara bağlantıyı kaldırma mekanizması (ör. hesaplarının URL'si) sağlamanız gerekir. Kullanıcılara bağlantıyı kaldırma seçeneği sunmuyorsanız Google Hesabı'na bir bağlantı ekleyin. Böylece kullanıcılar bağlı hesaplarını yönetebilir.

Risk ve Olay Paylaşımı ve İşbirliği'ni (RISC) uygulamayı ve kullanıcı hesabı bağlantı durumundaki değişiklikleri Google'a bildirmeyi seçebilirsiniz. Bu sayede, bağlantı durumunu güncellemek için yenileme veya erişim jetonu isteğine güvenmeye gerek kalmadan hem platformunuzun hem de Google'ın güncel ve tutarlı bir bağlantı durumu gösterdiği gelişmiş bir kullanıcı deneyimi sağlanır.

Jetonun son kullanma tarihi

Google, sorunsuz bir kullanıcı deneyimi sağlamak ve hizmet kesintisini önlemek için yenileme jetonlarını kullanım ömürlerinin sonuna doğru yenilemeye çalışır. Bazı senaryolarda, geçerli bir yenileme jetonu kullanılamadığında hesapların yeniden bağlanması için kullanıcı izni gerekebilir.

Platformunuzu, süresi dolmamış birden fazla erişim ve yenileme jetonunu destekleyecek şekilde tasarlamak, kümelenmiş ortamlar arasındaki istemci-sunucu değişimlerinde bulunan yarış durumlarını en aza indirebilir, kullanıcı kesintilerini önleyebilir ve karmaşık zamanlama ile hata işleme senaryolarını en aza indirebilir. Sonunda tutarlı hale gelecek olsa da istemci-sunucu jeton yenileme değişimi sırasında ve küme senkronizasyonundan önce, hem önceki hem de yeni verilen ve süresi dolmamış jetonlar kısa bir süre için kullanılabilir. Örneğin, süresi dolmamış önceki erişim jetonunu kullanan hizmetinize yönelik bir Google isteği, yeni bir erişim jetonu yayınlamanızdan hemen sonra ancak Google'da makbuz ve küme senkronizasyonu gerçekleşmeden önce gönderilir. Yenileme jetonu döndürme için alternatif güvenlik önlemleri önerilir.

Diğer etkinlikler

Hesapların bağlantısı, hareketsizlik, askıya alınma, kötü amaçlı davranış gibi çeşitli nedenlerle de kaldırılabilir. Bu gibi senaryolarda platformunuz ve Google, hesap ve bağlantı durumundaki değişiklikleri birbirine bildirerek kullanıcı hesaplarını ve yeniden bağlantı oluşturma işlemlerini en iyi şekilde yönetebilir.

Google'ın çağırabileceği bir jeton iptali uç noktası uygulayın ve platformunuz ile Google'ın tutarlı bir kullanıcı hesabı bağlantı durumu sürdürmesini sağlamak için RISC'yi kullanarak Google'ı jeton iptali etkinliklerinizden haberdar edin.

Jeton iptali uç noktası

If you support an OAuth 2.0 token revocation endpoint, your platform can receive notifications from Google. This lets you inform users of link state changes, invalidate a token, and cleanup security credentials and authorization grants.

The request has the following form:

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

Your token revocation endpoint must be able to handle the following parameters:

Revocation endpoint parameters
client_id A string that identifies the request origin as Google. This string must be registered within your system as Google's unique identifier.
client_secret A secret string that you registered with Google for your service.
token The token to be revoked.
token_type_hint (Optional) The type of token being revoked, either an access_token or refresh_token. If unspecified, defaults to access_token.

Return a response when the token is deleted or invalid. See the following for an example:

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

If the token can't be deleted for any reason, return a 503 response code, as shown in the following example:

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

Google retries the request later or as requested by Retry-After.

Hesaplar Arası Koruma (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).