-# Copyright (C) 2014 Ipsilon project Contributors, for licensee see COPYING
+# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING
from ipsilon.providers.common import ProviderPageBase
-from ipsilon.util.trans import Transaction
from ipsilon.util.user import UserSession
+from ipsilon.util.endpoint import allow_iframe
import base64
import cherrypy
self.trans = None
def _preop(self, *args, **kwargs):
- try:
- # generate a new id or get current one
- self.trans = Transaction('persona', **kwargs)
- if self.trans.cookie.value != self.trans.provider:
- self.debug('Invalid transaction, %s != %s' % (
- self.trans.cookie.value, self.trans.provider))
- except Exception, e: # pylint: disable=broad-except
- self.debug('Transaction initialization failed: %s' % repr(e))
- raise cherrypy.HTTPError(400, 'Invalid transaction id')
+ self.trans = self.get_valid_transaction('persona', **kwargs)
def pre_GET(self, *args, **kwargs):
self._preop(*args, **kwargs)
return True
return False
+ @allow_iframe
def POST(self, *args, **kwargs):
if 'email' not in kwargs or 'publicKey' not in kwargs \
or 'certDuration' not in kwargs or '@' not in kwargs['email']:
class SignInResult(AuthenticateRequest):
+ @allow_iframe
def GET(self, *args, **kwargs):
user = UserSession().get_user()
self.result = SignInResult(*args, **kwargs)
self.trans = None
+ @allow_iframe
def GET(self, *args, **kwargs):
username = None
domain = None
self.SignIn = SignIn(*args, **kwargs)
self.trans = None
+ @allow_iframe
def GET(self, *args, **kwargs):
user = UserSession().get_user()
return self._template('persona/provisioning.html',