Hiện tại, các nhà phát triển đã có thể sử dụng rộng rãi tiện ích bổ sung của Google Lớp học! Vui lòng xem tài liệu về tiện ích bổ sung để biết thêm thông tin.
Hãy xem trang đăng nhập liền mạch để biết hướng dẫn triển khai tính năng Đăng nhập một lần bằng Google trong các tiện ích bổ sung của Lớp học. Hướng dẫn đăng nhập liền mạch cũng đề cập đến kế hoạch kiểm thử mà bạn có thể dùng để đảm bảo tiện ích bổ sung của mình tuân thủ các phương pháp hay nhất về đăng nhập.
Quy trình đăng nhập
Để giảm bớt phiền hà cho người dùng khi đăng nhập, Google Lớp học cung cấp tham số truy vấn login_hint khi một iframe được mở. login_hint là mã nhận dạng duy nhất của người dùng trên Google và được cung cấp sau khi người dùng đăng nhập vào tiện ích bổ sung của bạn lần đầu tiên. Tham số này cung cấp bối cảnh về người dùng đã đăng nhập vào Google Lớp học. Hãy xem trang hướng dẫn về các tham số đăng nhập của chúng tôi để biết thêm thông tin chi tiết về các tham số truy vấn này.
Bạn phải hiển thị hộp thoại đăng nhập bằng Google nếu tham số truy vấn login_hint của người dùng Google Lớp học hiện tại không khớp với bất kỳ người dùng nào đã đăng nhập vào tiện ích bổ sung. Nút này phải tuân thủ nguyên tắc sử dụng thương hiệu của Google. Nếu đã đăng nhập, người dùng sẽ không được nhắc đăng nhập lại.
Hình 1. Luồng đăng nhập khi người dùng lần đầu chạy tiện ích bổ sung của bạn.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[],[],null,["# Sign in\n\nGoogle Classroom add-ons **must** use Google single sign-on (SSO) to identify\nand authenticate users.\n\nSee [Google Identity's OpenID Connect Guide](https://developers.google.com/identity/protocols/oauth2/openid-connect) for more information on SSO. We\nalso recommend referencing Google's official documentation on user sign-up and\nsign-in for [automatic sign in](https://developers.google.com/identity/gsi/web) and [Sign-In Branding Guidelines](https://developers.google.com/identity/branding-guidelines).\n\nSee the [frictionless sign-in page](/workspace/classroom/add-ons/developer-guides/frictionless-signin) for implementation guidance for Google SSO\nin Classroom add-ons. The frictionless sign-in guide also refers\nto the [test plan](/static/workspace/classroom/assets/classroom_add_ons_test_plan.pdf) that can be used to ensure your add-on is\nfollowing sign-in best practices.\n\nSign in flow\n------------\n\nTo reduce sign-in friction for users, Google Classroom provides the\n`login_hint` query parameter when an iframe is opened. `login_hint` is a user's\nunique Google ID, and is provided *after* the user has signed into your add-on\nfor the first time. This parameter provides context on the user that's signed\ninto Google Classroom. See our [sign-in parameters guide page](/workspace/classroom/add-ons/developer-guides/iframes#sign-in_related_parameters) for a more\ndetailed discussion of these query parameters.\n\nYou must display a Google sign-in dialog if the `login_hint` query parameter of\nthe current Google Classroom user doesn't match any signed-in user of the\nadd-on. The button must adhere to [Google's branding guidelines](https://developers.google.com/identity/branding-guidelines). If the user is\nalready signed in, they shouldn't be prompted to sign-in again.\n\n**Figure 1.** Sign in flow when a user initially launches\nyour add-on.\n| **Important:** The sign in button should only be seen when the add-on doesn't have a signed in user to compare against the `login_hint` query parameter. The sign in button is unnecessary if the add-on matches the signed in user using the value of `login_hint`; in this case, the add-on should keep the user signed in."]]