我正在尝试为谷歌我的业务创建一个平台,并且我已经实现了一键登录,并且我获得了凭据,但没有获得完整的信息。这是我尝试过的代码
\n <script>\n window.onload = function () {\n google.accounts.id.initialize({\n client_id: "clientid.apps.googleusercontent.com",\n callback: handleCredentialResponse,\n });\n google.accounts.id.prompt((notification) => {\n if (notification.isNotDisplayed() || notification.isSkippedMoment()) {\n console.log("opted out");\n }\n });\n function handleCredentialResponse(response) {\n console.log(response)\n // window.location = "https://github.com/";\n }\n };\n </script>\nRun Code Online (Sandbox Code Playgroud)\n这是我收到的回复
\n{\n clientId:\n "clientid.apps.googleusercontent.com",\n credential:\n "eyJhbGciOiJSUzI1NiIsImtpZCI6ImYwNTQxNWIxM2FjYjk1OT\xe2\x80\xa640Jk8v3LcOvtopFD_tI2HMlFjg0dK96XrqNiOD0H3Akl",\n select_by: "user",\n};\nRun Code Online (Sandbox Code Playgroud)\n