https://github.com/junosuarez/web-login
A maximally minimal proposal for browser-based user identity management
https://github.com/junosuarez/web-login
Last synced: 9 months ago
JSON representation
A maximally minimal proposal for browser-based user identity management
- Host: GitHub
- URL: https://github.com/junosuarez/web-login
- Owner: junosuarez
- Created: 2014-04-04T22:12:03.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T07:27:33.000Z (over 10 years ago)
- Last Synced: 2025-02-15T16:46:23.993Z (over 1 year ago)
- Homepage:
- Size: 4.88 KB
- Stars: 44
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
web-login
=========
bare-bones browser-based identity for the web
## design goals
- support multiple identity providers / protocols
- universal login api for web platform
- small API surface, simple token
- privacy-preserving, doesn't leak additional user information without their knowledge
- no extra features / protocols / barriers to implementation or adoption
## api
```js
navigator.login() => Promise
// Token is a string of a cryptographically secure token representing the user's identity
```
## example
See the [demo](https://jden.github.io/web-login-prollyfill/).
```js
navigator.login().then(function (token) {
// token = eg 7a14d72ae2c75497c7533e63a6ca2720888b204e
return http.post({
location: 'https://example.com/sessions',
data: {token: token}
})
})
.catch(function (err) {
console.log('could not log in:', err)
})
.then(loggedInMain)
```
## sequences
### Normal Login

Depending on the User Agent, users may be able to cache their Identity Provider credentials (for example, a "remember my username and password" checkbox) to eliminate some user-involved steps in this process.
## request for contributions
feedback, issues, and pull requests welcome. **use cases and security review especially welcome**
Come chat about it in IRC in #weblogin on irc.freenode.net