0

According to the documentation (https://developers.google.com/identity/one-tap/web/retrieve-credentials), we can get our saved password, just like when we use Credential Management API on Chrome.

I'm already currently logged in to Google in my browser. I have tried to use the googleyolo api, using .retrieve() function as documented:

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));

and it only return the idToken, no password returned.

But weirdly, when I tried using Credential Management API on Chrome my saved credentials popped up.

The question is, 1. What went wrong? 2. Where did googleyolo get its list of credentials? Because I checked at my https://passwords.google.com, and my credentials exists 3. What should I do/troubleshoot to get my password credentials?

Dimitrij Agal
  • 375
  • 1
  • 9

2 Answers2

1

Sorry for the confusion, passwords are only available in browsers that support the Credential Management API (which the library uses to retrieve the passwords). Will update the documentation to clarify that.

Steven
  • 3,812
  • 23
  • 38
0

Not sure where you get the "googleyolo://id-and-password" from in the supportedAuthMethods argument. In your link, it specifically says only Google is supported.

googleyolo gets a list of users from your current browser. You will get more users if you have multiple users logged into a Google account.

When I implemented Google signon, I simply use the idtoken to confirm the identify of the user. No password is return from calling googleyolo.

Once you confirmed the user's identify, you can use the method provided to signin.

useGoogleIdTokenForAuth(credential.idToken);
Wen W
  • 2,434
  • 1
  • 10
  • 15
  • Thanks for your answer. I got it from their documentations here https://developers.google.com/identity/one-tap/web/retrieve-credentials , see the "Request saved credentials" section that states the "googleyolo://id-and-password". Also on the "Handle the credential request result" section that states that password can be retrieved. Or am I maybe misunderstood the documentations? – Dimitrij Agal Feb 21 '18 at 05:16
  • Sounds like you can only retrieve the password when the user enter it through your implementation of the signin process. "optionally googleyolo://id-and-password to retrieve password-based credentials when no Google Accounts are saved." – Wen W Feb 21 '18 at 20:17