根据文档( https://developers.google.com/identity/one-tap/web/retrieve-credentials ),我们可以获取我们保存的密码,就像我们在 Chrome 上使用 Credential Management API 一样。
我目前已在浏览器中登录 Google。
我尝试使用 googleyolo api,使用文档中的 .retrieve()
函数:
const retrievePromise = googleyolo.retrieve({
supportedAuthMethods: [
"https://accounts.google.com",
"googleyolo://id-and-password"
],
supportedIdTokenProviders: [
{
uri: "https://accounts.google.com",
clientId: "*********-**********.apps.googleusercontent.com"
}
]
}).then(res => console.log(res));
它只返回idToken
,不返回密码。
但奇怪的是,当我尝试在 Chrome 上使用凭据管理 API 时,我保存的凭据会弹出。
问题是, 1. 出了什么问题? 2. googleyolo 从哪里获得其凭据列表?因为我查了我的https://passwords.google.com ,并且我的凭据存在 3. 我应该做什么/排除故障才能获取我的密码凭证?
最佳答案
很抱歉造成混淆,密码仅在支持凭据管理 API(库用于检索密码)的浏览器中可用。将更新文档以澄清这一点。
关于javascript - Google Smart Lock/Google Yolo 未返回保存的密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48679372/