forked from mozilla/persona
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved all static to dynamic views with templates
- Loading branch information
Showing
6 changed files
with
191 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<script src="js/highlight.js"></script> | ||
<script>hljs.initHighlightingOnLoad();</script> | ||
<div class="why"> | ||
<p> | ||
BrowserID provides a <b>simple</b> and <b>sophisticated</b> | ||
login process that your <b>users will love</b>. It can be | ||
integrated in three easy steps: | ||
</p> | ||
</div> | ||
<div class="step"> | ||
<div class="number">1.</div> | ||
<p><b>Enable BrowserID:</b> Include the BrowserID JavaScript library in your site by adding a script tag to your <tt><head></tt></p> | ||
|
||
<pre><code><script src="https://browserid.org/include.js" type="text/javascript"></script></code></pre> | ||
</div> | ||
<div class="step"> | ||
<div class="number">2.</div> | ||
<p> | ||
<b>Identify the User:</b> Instead of displaying a form on your | ||
site which takes a username and password, use the BrowserID | ||
JavaScript API when the user clicks your login button: | ||
</p> | ||
<pre><code class="javascript">navigator.id.getVerifiedEmail(function(assertion) { | ||
if (assertion) { | ||
// This code will be invoked once the user has successfully | ||
// selected an email address they control to log in with. | ||
} else { | ||
// something went wrong! the user isn't logged in. | ||
} | ||
}); | ||
</code></pre> | ||
<p> | ||
Upon a successful login, you'll be called back with | ||
an <i>assertion</i>, a string containing a signed claim that proves | ||
the user is who they say they are. | ||
</p> | ||
<p> | ||
<b>NOTE:</b> While completely optional, you might consider | ||
replacing your login/signin button with a pretty BrowserID button: | ||
|
||
<div class="buttonbox"> | ||
<div><img src="i/sign_in_red.png"></div> | ||
<div><img src="i/sign_in_blue.png"></div> | ||
<div><img src="i/sign_in_orange.png"></div> | ||
<div><img src="i/sign_in_green.png"></div> | ||
<div><img src="i/sign_in_grey.png"></div> | ||
</div> | ||
</p> | ||
</div> | ||
<div class="step"> | ||
<div class="number">3.</div> | ||
<p> | ||
<b>Verify the User's Identity:</b> You must verify the <i>assertion</i> | ||
is authentic, and extract the user's email address from it. | ||
The easiest way to do these is to use the | ||
free verification service provided by BrowserID. | ||
</p><p> | ||
To use it, you send a request | ||
to <tt>https://browserid.org/verify</tt> with two GET parameters: | ||
</p> | ||
<ol> | ||
<li> <tt>assertion</tt>: The encoded assertion | ||
<li> <tt>audience</tt>: The hostname and optional port of your site | ||
</ol> | ||
<p> | ||
The verifier will check the the assertion was meant for your site and | ||
is valid, here's an example: | ||
</p> | ||
<pre><code>$ curl "https://browserid.org/verify?assertion=<ASSERTION>&audience=mysite.com" | ||
{ | ||
"status": "okay", | ||
"email": "lloyd@mozilla.com", | ||
"audience": "mysite.com", | ||
"valid-until": 1308859352261, | ||
"issuer": "browserid.org:443" | ||
} | ||
</pre></code> | ||
</p> | ||
<p> | ||
<b>NOTE:</b> You may choose to validate assertions on your own | ||
server. While a bit more complicated you can reduce your | ||
dependencies on others. Refer | ||
to <a href="https://wiki.mozilla.org/Identity/Verified_Email_Protocol">the | ||
specification</a> and the <a href="https://github.com/mozilla/browserid/tree/master/verifier">source for the reference | ||
validator</a>. | ||
</p> | ||
</div> | ||
<div class="step"> | ||
<p><b>Complete the log in!</b> Having completed the steps | ||
above, you can trust that the present user really owns the | ||
email address returned by the verifier. You don't need to | ||
perform any additional authentication unless you want to! | ||
From here, you can perform whatever post-authentication steps | ||
you like. | ||
</p> | ||
</div> | ||
<div class="why"> | ||
<p> | ||
You're done! <b>Welcome to BrowserID!</b> For more details, have a look at | ||
our <a href="http://myfavoritebeer.org/">demonstration</a>, and view | ||
<a href="https://github.com/lloyd/myfavoritebeer.org/">the code</a> behind it. | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="why"> | ||
<p> | ||
Manage your email addresses in BrowserID. | ||
</p> | ||
</div> | ||
<div id="emailList"> | ||
</div> | ||
<div id="cancelaccount"> | ||
You may, at any time, <a href="#" id="cancellink">cancel your account</a>. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="why"> | ||
<p> | ||
This page is dedicated to the <b>Identity Providers</b>. | ||
These are dudes like Yahoo!, Google, Twitter, Facebook, and | ||
even github. If someone new wants to join they party, hey, | ||
they <a href="http://www.mozilla.org/about/manifesto">should | ||
be able to</a>. | ||
</p> | ||
<p> | ||
But there's a catch. This page hasn't been written yet! No no, don't | ||
get frustrated, just go write something and | ||
then <a href="https://github.com/mozilla/browserid/blob/master/authority/static/primaries.html">contribute | ||
it on github</a>. | ||
</p> | ||
<br><br><br> | ||
</div> |