46
|
1 """
|
|
2 bitsyauth Mozilla persona implementation
|
|
3
|
|
4 https://login.persona.org/
|
|
5 """
|
|
6
|
|
7 import os
|
|
8 from webob import Request, Response, exc
|
|
9
|
|
10 __all__ = ['BitsyauthPersona', 'persona_js']
|
|
11
|
|
12 # persona javascript file path
|
|
13 here = os.path.abspath(os.path.dirname(__file__))
|
|
14 persona_js = None # TODO
|
|
15
|
|
16 class BitsyauthPersona(object):
|
51
|
17 onload = """persona(%(loggedInUser)s, %(onloginURL)s, %(onlogoutURL)s);"""
|
|
18
|
|
19 def __init__(self, app=None, path='/auth'):
|
46
|
20 self.app = app
|
51
|
21 self.path = path.rstrip('/')
|
46
|
22 def __call__(self, environ, start_response):
|
|
23 request = Request(environ)
|