changeset 23:21124b238feb

stub persona/browserid example
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 26 Dec 2013 20:04:08 -0800
parents 9aa73d2d5aa8
children bdb005ae848b
files example/persona.html example/persona.py
diffstat 2 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/persona.html	Thu Dec 26 20:04:08 2013 -0800
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>bistyauth Mozilla persona test page</title>
+
+<!-- Suppressing Compatability Mode for IE
+https://developer.mozilla.org/en-US/Persona/Quick_Setup?redirectlocale=en-US&redirectslug=Persona%2FQuick_Setup#Suppressing_Compatibility_Mode -->
+<meta http-equiv="X-UA-Compatible" content="IE=Edge">
+
+<script src="https://login.persona.org/include.js"></script>
+<script>
+var signinLink = document.getElementById('signin');
+if (signinLink) {
+  signinLink.onclick = function() { navigator.id.request(); };
+}
+
+var signoutLink = document.getElementById('signout');
+if (signoutLink) {
+  signoutLink.onclick = function() { navigator.id.logout(); };
+}
+</script>
+</head>
+
+<body>
+<h1>
+<a href="https://login.persona.org/">Mozilla persona</a>
+<a href="http://k0s.org/hg/bitsyauth/">bitsyauth</a>
+test page
+</h1>
+
+<div>
+  <a id="signin">sign in</a>
+</div>
+
+<h2>Resources</h2>
+<ul>
+  <li>
+  <a href="https://developer.mozilla.org/en-US/Persona/branding">
+  branding
+  </a>:
+  buttons and what not
+  </li>
+</ul>
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/persona.py	Thu Dec 26 20:04:08 2013 -0800
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import optparse
+import os
+import sys
+
+"""
+test Mozilla persona auth
+
+https://login.persona.org/about
+"""
+
+here = os.path.dirname(os.path.realpath(__file__))
+page = os.path.join(here, 'persona.html')
+
+def main(args=sys.argv[1:]):
+
+    usage = '%prog [options]'
+    parser = optparse.OptionParser(usage=usage, description=__doc__)
+    parser
+    options, args = parser.parse_args(args)
+
+if __name__ == '__main__':
+    main()