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.
Khi người dùng đăng nhập bằng Tài khoản Google của họ trong một trình duyệt web hoặc trên thiết bị Android, họ có thể đăng nhập liền mạch trên các trình duyệt web và thiết bị Android bằng cùng một Tài khoản Google. Tính năng này cho phép người dùng có được trải nghiệm tốt nhất trên nhiều thiết bị bằng cách giúp họ đăng nhập vào dịch vụ của bạn dễ dàng hơn.
Khi được tải trên web, nút này sẽ ngay lập tức kiểm tra xem người dùng có uỷ quyền cho ứng dụng hay không. Quy trình kiểm tra này được gọi là "chế độ tức thì" và nếu thành công, máy chủ của Google sẽ trả về một mã thông báo truy cập và chuyển một đối tượng kết quả uỷ quyền mới đến lệnh gọi lại. Nếu nút không thể thực hiện việc uỷ quyền ở chế độ tức thì, người dùng phải nhấp vào nút đăng nhập để kích hoạt luồng truy cập.
Cách bật tính năng đăng nhập một lần trên nhiều nền tảng:
Ứng dụng Android và ứng dụng web phải được đăng ký trong cùng một dự án Google API Console.
Phạm vi được yêu cầu trên mỗi nền tảng phải khớp với phạm vi của các nền tảng khác.
Tính năng đăng nhập một lần trên nhiều nền tảng sẽ hoạt động cho người dùng khi đáp ứng các yêu cầu sau:
Người dùng đăng nhập vào Google trong trình duyệt hoặc trên thiết bị Android.
Trước đây, người dùng đã uỷ quyền cho ứng dụng của bạn đối với các phạm vi tương tự.
Trải nghiệm này tương tự như khi người dùng mở ứng dụng Android lần thứ hai. Nếu trước đó người dùng đã uỷ quyền ứng dụng, thì người dùng vẫn duy trì trạng thái đăng nhập: người dùng sẽ không nhấp vào nút đăng nhập mỗi khi mở ứng dụng.
Khi người dùng đăng nhập liền mạch, Google sẽ hiển thị lời nhắc rằng họ đang đăng nhập bằng Tài khoản Google của mình. Lời nhắc này chỉ xuất hiện một lần trên mỗi thiết bị.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eGoogle Sign-In library support is deprecated and will require using FedCM APIs in the future.\u003c/p\u003e\n"],["\u003cp\u003eCross-platform single sign-on enables seamless sign-in across web and Android using the same Google Account, provided the user has previously authorized the app with matching scopes.\u003c/p\u003e\n"],["\u003cp\u003eUsers will experience automatic sign-in if they have previously authorized the app, similar to using an Android app for the second time.\u003c/p\u003e\n"],["\u003cp\u003eUpon seamless sign-in, users will see a one-time reminder on each device indicating they are logged in with their Google Account.\u003c/p\u003e\n"]]],[],null,["# Cross-platform single sign-in\n\n| **Warning:** The Google Sign-In library optionally uses FedCM APIs, and their use will become a requirement. [Conduct an impact assessment](/identity/sign-in/web/gsi-with-fedcm) to confirm that user sign-in continues to function as expected. \n|\n| Support for the Google Sign-In library is deprecated, see the [Deprecation and Sunset](/identity/sign-in/web/deprecation-and-sunset) guide for more.\n\nWhen a user signs in with their Google Account in a web browser or on an\nAndroid device, they can be seamlessly signed in across web browsers and\nAndroid devices using the same Google Account. This feature allows users to\nget the best experience out of multiple devices by making it\neasier for them to sign in to your service.\n\nWhen the button is loaded on the web, it immediately checks to see if the\nuser has authorized the application. This check is called \"immediate mode\"\nand if successful, the Google servers return an access token and pass a new\nauthorization result object to the callback. If the button cannot make an\nimmediate-mode authorization, the user must click the sign-in button to\ntrigger the access flow.\n\nTo enable cross-platform single sign-on:\n\n1. The Android and web app must be registered in the same [Google API Console](https://console.cloud.google.com/) project.\n2. The requested scopes on each platform must match the scopes from other platforms.\n\nCross-platform single sign-on works for the user when the following\nrequirements are met:\n\n1. The user is signed in to Google in the browser or on the Android device.\n2. The user has previously authorized your app for the same scopes.\n\nThis experience is similar to when a user opens an Android app the second\ntime. If the user previously authorized the app, then the user remains signed\nin: users don't click the sign-in button every time they open the app.\n\nWhen a user is seamlessly signed in, Google displays a reminder that they are\nlogged in using their Google Account. This reminder only appears\nonce per device."]]