Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Google smart lock to a website only

Google Smart Lock on a website

I just visited Pinterest and it has a cool feature. Somehow when I visit the site Chrome can "see" that I have an account. And instead of passively waiting it informs me pro-actively: you do have an account here: would you like to login with 1 click? yes/No

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

Question: I see a lot of json code examples for apps. But how can we proactively add this to a website that a user has a stored uname/passwd for?

Example image

thanks, Sean

like image 609
snh_nl Avatar asked Sep 16 '16 09:09

snh_nl


People also ask

Does Google Smart Lock work with apps?

Google Smart Lock lets you to get right down to work (or play) without needing to remember passwords and security codes. Works with your Android devices, Chromebooks, Chrome browser and select apps.

Is Google Smart Lock free?

The updated Google Smart Lock app on iPhone now lets you log in securely with a single tap. It offers similar functionality to Google's Titan Security Keys but is free. All you need to do is set it up and then confirm you're trying to log in each time you sign in to Google.

Where is Google Smart Lock located?

Turn Smart Lock on or off Select Settings . Under "Connected devices," select your Android phone. Turn Smart Lock on or off.


1 Answers

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

Basically, add a bit of code to the (https) website 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 a complete sample website: https://credential-management-sample.appspot.com/

Once the user has used this credential or you have saved it with navigator.credentials.store(), then in the future, it can retrieved automatically (without a user click).

For more information about this, check out this talk from Google I/O (details on the credential management API start at about 8 minutes).

like image 116
Steven Avatar answered Sep 27 '22 17:09

Steven