Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tổng quan
Người dùng có thể thu hồi sự đồng ý chia sẻ mã thông báo nhận dạng.
Khi đăng nhập lần đầu, người dùng sẽ được nhắc đồng ý chia sẻ thông tin hồ sơ Tài khoản Google của họ với nền tảng của bạn.
Nếu người dùng đồng ý, thông tin xác thực Mã thông báo web JSON (JWT) còn gọi là mã thông báo nhận dạng sẽ được chia sẻ khi bất kỳ nút Đăng nhập bằng Google, Một lần nhấn hoặc Tự động đăng nhập nào được tải.
Một trường hợp phổ biến là tài khoản người dùng mới được tạo trên nền tảng của bạn trong quá trình đăng ký. Sau đó, người dùng có thể chọn xoá tài khoản của họ và "huỷ liên kết" nền tảng của bạn khỏi Tài khoản Google của họ, ngừng chia sẻ mã thông báo giấy tờ tuỳ thân.
Để gọi phương thức thu hồi, chủ sở hữu Tài khoản Google phải đồng ý lại việc chia sẻ mã thông báo nhận dạng trong lần truy cập tiếp theo vào trang web của bạn.
Phương thức thu hồi
Google sử dụng quyền cấp OAuth 2.0 để quản lý sự đồng ý của người dùng và việc chia sẻ mã nhận dạng với Mã ứng dụng của nền tảng. Việc thu hồi sự đồng ý sẽ ngăn Google chia sẻ mã thông báo nhận dạng khi bất kỳ trang nào trên trang web của bạn tải thư viện ứng dụng.
Bạn có thể sử dụng các phương thức này để thu hồi sự đồng ý,
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-11-21 UTC."],[[["\u003cp\u003eUser consent to share an ID token, allowing your platform access to their Google Account profile information, can be revoked at any time.\u003c/p\u003e\n"],["\u003cp\u003eUsers can revoke consent either through their Google Account settings or your platform can initiate it programmatically using the \u003ccode\u003egoogle.accounts.id.revoke\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eRevoking consent requires the user to re-consent to share their ID token when they next visit your site, essentially "unlinking" your platform from their Google Account.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle.accounts.id.revoke\u003c/code\u003e method specifically manages ID token sharing and does not affect OAuth2.0 authorization scopes or grants.\u003c/p\u003e\n"]]],[],null,["# Revoke ID tokens\n\nOverview\n--------\n\nUser consent to share an ID token can be revoked.\n\nUsers signing in for the first time are prompted for consent to share their\nGoogle Account profile information with your platform.\n\nIf user consent is given a JSON Web Token (JWT)\n[credential](/identity/gsi/web/reference/js-reference#credential) known as an\nID token is shared when any of the Sign In With Google, One Tap or Automatic\nsign-in buttons are loaded.\n\nA common scenario is for a new user account to be created on your platform\nduring sign up. Later, a user may choose to delete their account and \"unlink\"\nyour platform from their Google Account, stopping ID token sharing.\n\nCalling the revoke method requires the Google Account owner to re-consent to\nshare the ID token on their next visit to your site.\n\nRevocation methods\n------------------\n\nGoogle uses an OAuth 2.0 grant to manage user consent and ID token sharing to\nyour platform's Client ID. Revoking consent stops Google from sharing the\nID token when the client library is loaded by any pages on your site.\n\nThese methods can be used to revoke consent,\n\n1. Users sign in to their Google Account, find your app in the [Third-party apps with account access](https://myaccount.google.com/permissions) settings and select **Remove Access**.\n2. Your platform calls [`google.accounts.id.revoke`](/identity/gsi/web/reference/js-reference#google.accounts.id.revoke).\n\nThe following code sample shows how to use the `revoke` method. \n\n```transact-sql\n google.accounts.id.revoke('user@google.com', done =\u003e {\n console.log('consent revoked');\n });\n```\n\n\u003cbr /\u003e\n\n| **Key Point:** This method applies only to ID token sharing and cannot be used to manage OAuth2.0 authorization scopes. OAuth revocation methods cannot be used to manage ID token grants."]]