https://github.com/thinkphp/browserid-mootools
This is a MooTools client library for the BrowserID Protocol.
https://github.com/thinkphp/browserid-mootools
Last synced: 3 months ago
JSON representation
This is a MooTools client library for the BrowserID Protocol.
- Host: GitHub
- URL: https://github.com/thinkphp/browserid-mootools
- Owner: thinkphp
- Created: 2012-03-18T10:38:03.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-03-19T09:08:39.000Z (almost 14 years ago)
- Last Synced: 2024-04-14T14:54:24.099Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://thinkphp.ro/apps/js-hacks/browserID-MooTools/Demos/
- Size: 107 KB
- Stars: 14
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
BrowserID
=========
This is a MooTools client library for the BrowserID Protocol. BrowserID is a new way for users to log into web sites using their email address.
It aims to provide a secure way of proving your identity to servers across the internet, without having to create separate usernames and passwords each time.
Instead of a new username, it uses your email address as you identity which allows it to be descentralized since anyone can send you an
email verification message.

How to Use
----------
Include the BrowserID include.js library in your site by adding the following script tag to your pages:
Adding a pretty button:
#HTML

When DOM is ready:
#JS
window.addEvent('domready', function(){
$('login').addEvent('click',function(){
navigator.id.getVerifiedEmail(function(assertion){
if(assertion) {
//got an assertion, now send it up to the server for verification
verify(assertion)
} else {
alert("I still don't know you")
}
})
})
})
function verify(assertion) {
var browserid = new BrowserID(assertion, {
onComplete: function(response){
//if the server successfully verifies the assertion we
//updating the UI by calling 'loggedIn()'
if(response.status == 'okay') {
loggedIn(response.email)
//otherwise we handle the login failure by calling 'failure()'
} else {
failure(response)
}
}
})
}
function loggedIn(email) {
//do stuff with email
var p = new Element('p').set('text','Logged In as: ' + email)
$('login').parentNode.replaceChild(p,$('login'))
}
function failure(f) {
//do stuff with failure
alert('Failure reason: ' + f.reason)
}
References:
- https://browserid.org/
- https://developer.mozilla.org/en/BrowserID
- https://browserid.org/developers
- http://identity.mozilla.com/post/7616727542/introducing-browserid-a-better-way-to-sign-in
- http://identity.mozilla.com/post/17207734786/id-provider-support-now-live-on-browserid
- https://github.com/mozilla/browserid/wiki