Adding Google smart locks to website only

Google smart lock on website

I just visited Pinterest and it has a cool feature. Somehow, when I visit a site, Chrome can “see” that I have an account. And instead of passive waiting, he informs me pro-actively: you have an account here: do you want to log in with 1 click? well no

https://support.google.com/accounts/answer/6160273?hl=en

Question: I see many examples of json code for applications. But how can we actively add this to the site where the user stores uname / passwd for?

Image example

thanks Sean

+7
google-smartlockpasswords
source share
1 answer

Here's an article describing how to add a Smart Lock login to your website: https://developers.google.com/web/updates/2016/04/credential-management-api

Basically, add some code to the website (https) like this (you can try it in the JavaScript console:

navigator.credentials.get({ password: true, // `true` to obtain password credentials }).then(function(cred) { // continuation which submits the credential and signs the user in ... 

Here is the complete sample website: https://credential-management-sample.appspot.com/

As soon as the user used these credentials, or you saved it using navigator.credentials.store() , in the future it can be obtained automatically (without clicking the user).

For more information about this, go into this conversation from Google I / O (details about the credential management API start in about 8 minutes),

+4
source share

All Articles