Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created July 22, 2011 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaydson/1098967 to your computer and use it in GitHub Desktop.
Save jaydson/1098967 to your computer and use it in GitHub Desktop.
BrowserID test for Blog Post in Jaydson.org
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' type="text/javascript"></script>
<script src="https://browserid.org/include.js"></script>
</head>
<body>
<img id="sign-in" src="https://browserid.org/i/sign_in_green.png" alt="Sign in">
<div id="logged" style='display:none'></div>
<script>
$("#sign-in").bind("click", function(){
navigator.id.getVerifiedEmail(function(assertion){
if(assertion){
$.ajax({
url: "https://browserid.org/verify?assertion="+assertion+"&audience=jaydson.org",
success: function(data){
var user = JSON.parse(data);
$('#logged').html("<h1>Welcome, "+user.email+"</h1>").fadeIn();
}
});
}else{
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment