with the credential management API
James Allardice
You can sync passwords across devices.
Federated identity providers
Assertion about an entity which enables a trust decision
⚠️
The code you're about to see is
likely to change soon!
https://developers.google.com/web/updates/2017/06/credential-management-updates
navigator.credentials
const credentials = new PasswordCredential({
id: username,
password: password,
});
fetch('/login', {
method: 'POST',
headers: {
Accept: 'application/json',
},
credentials: passwordCredentials,
});
navigator.credentials.store(credentials)
.then(() => {
// Done
});
// Ask the browser for the stored password credential.
navigator.credentials.get({
password: true,
})
.then((credentials) => {
// Make request.
});
// Prevent automatic logins for the rest of the session.
navigator.credentials.requireUserMediation()
.then(() => {
// Redirect to login page.
});
@james_allardice