[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eGoogle Sign-In library support is deprecated, and migration to FedCM APIs will be mandatory soon, requiring an impact assessment.\u003c/p\u003e\n"],["\u003cp\u003eAfter user sign-in, you can access basic profile information like Google ID, name, profile URL, and email address.\u003c/p\u003e\n"],["\u003cp\u003eInstead of Google IDs or profile data, utilize ID tokens for secure backend server authentication.\u003c/p\u003e\n"],["\u003cp\u003eGoogle account email addresses are subject to change, so use the account's ID for user identification on both client and backend.\u003c/p\u003e\n"]]],[],null,["# Getting profile information\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\nAfter you have signed in a user with Google using the default scopes, you can\naccess the user's Google ID, name, profile URL, and email address.\n| **Important:** Do not use the Google IDs returned by `getId()` or the user's profile information to communicate the currently signed in user to your backend server. Instead, [send ID tokens](/identity/sign-in/web/backend-auth), which can be securely validated on the server.\n\nTo retrieve profile information for a user, use the [`getBasicProfile()`](/identity/sign-in/web/reference#googleusergetbasicprofile)\nmethod. For example: \n\n // auth2 is initialized with gapi.auth2.init() and a user is signed in.\n\n if (auth2.isSignedIn.get()) {\n var profile = auth2.currentUser.get().getBasicProfile();\n console.log('ID: ' + profile.getId());\n console.log('Full Name: ' + profile.getName());\n console.log('Given Name: ' + profile.getGivenName());\n console.log('Family Name: ' + profile.getFamilyName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail());\n }\n\n| **Note:** A Google account's email address can change, so don't use it to identify a user. Instead, use the account's ID, which you can get on the client with `getBasicProfile().getId()`, and on the backend from the `sub` claim of the ID token."]]