Sau khi người dùng đăng nhập bằng Google bằng các phạm vi mặc định, bạn có thể truy cập vào mã nhận dạng Google, tên, URL hồ sơ và địa chỉ email của người dùng.
Để truy xuất thông tin hồ sơ của người dùng, hãy sử dụng phương thức getBasicProfile(). Ví dụ:
// auth2 is initialized with gapi.auth2.init() and a user is signed in.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-22 UTC."],[[["Google Sign-In library support is deprecated, and migration to FedCM APIs will be mandatory soon, requiring an impact assessment."],["After user sign-in, you can access basic profile information like Google ID, name, profile URL, and email address."],["Instead of Google IDs or profile data, utilize ID tokens for secure backend server authentication."],["Google account email addresses are subject to change, so use the account's ID for user identification on both client and backend."]]],[]]