def javascript_passw_login(self, info): if self.javascript_login_authn is None: self.init_mako() end_points = self.config.AUTHENTICATION["JavascriptLogin"][ "END_POINTS"] full_end_point_paths = [ "{}{}".format(self.issuer, ep) for ep in end_points ] self.javascript_login_authn = JavascriptFormMako( None, "javascript_login.mako", self.lookup, self.config.PASSWD, "{}authorization".format(self.issuer), None, full_end_point_paths) PASSWORD_END_POINT_INDEX = 2 JAVASCRIPT_POINT_INDEX = 1 password_end_point = self.config.AUTHENTICATION["UserPassword"][ "END_POINTS"][PASSWORD_END_POINT_INDEX] javascript_end_point = info["END_POINTS"][JAVASCRIPT_POINT_INDEX] multi_password = AuthnIndexedEndpointWrapper( self.username_password_authn, PASSWORD_END_POINT_INDEX) multi_javascript = AuthnIndexedEndpointWrapper( self.javascript_login_authn, JAVASCRIPT_POINT_INDEX) auth_modules = [(multi_password, r'^' + password_end_point), (multi_javascript, r'^' + javascript_end_point)] return setup_multi_auth(self.ac, self.urls, auth_modules)
def javascript_login(self, info): if self.javascript_login_authn is None: self.init_mako() end_points = self.config.AUTHENTICATION[ "JavascriptLogin"]["END_POINTS"] full_end_point_paths = [ "{}{}".format(self.issuer, ep) for ep in end_points] self.javascript_login_authn = JavascriptFormMako( None, "javascript_login.mako", self.lookup, self.config.PASSWD, "{}authorization".format(self.issuer), None, full_end_point_paths) self.ac.add("", self.javascript_login_authn, "", "") JAVASCRIPT_END_POINT_INDEX = 0 end_point = info["END_POINTS"][JAVASCRIPT_END_POINT_INDEX] authn = AuthnIndexedEndpointWrapper(self.javascript_login_authn, JAVASCRIPT_END_POINT_INDEX) self.urls.append((r'^' + end_point, make_auth_verify(authn.verify))) return authn
# Ensure javascript_login_authn to be defined try: javascript_login_authn except NameError: javascript_login_authn = None if "JavascriptLogin" == authkey: if not javascript_login_authn: end_points = config.AUTHENTICATION["JavascriptLogin"][ "END_POINTS"] full_end_point_paths = [ "%s/%s" % (config.issuer, ep) for ep in end_points ] javascript_login_authn = JavascriptFormMako( None, "javascript_login.mako", LOOKUP, PASSWD, "%s/authorization" % config.issuer, None, full_end_point_paths) ac.add("", javascript_login_authn, "", "") JAVASCRIPT_END_POINT_INDEX = 0 end_point = config.AUTHENTICATION[authkey]["END_POINTS"][ JAVASCRIPT_END_POINT_INDEX] authn = AuthnIndexedEndpointWrapper(javascript_login_authn, JAVASCRIPT_END_POINT_INDEX) URLS.append((r'^' + end_point, make_auth_verify(authn.verify))) if "SAML" == authkey: from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST if not saml_authn: saml_authn = SAMLAuthnMethod(None, LOOKUP,
# Ensure javascript_login_authn to be defined try: javascript_login_authn except NameError: javascript_login_authn = None if "JavascriptLogin" == authkey: if not javascript_login_authn: end_points = config.AUTHENTICATION["JavascriptLogin"][ "END_POINTS"] full_end_point_paths = [ "{}{}".format(_issuer, ep) for ep in end_points ] javascript_login_authn = JavascriptFormMako( None, "javascript_login.mako", LOOKUP, PASSWD, "{}authorization".format(_issuer), None, full_end_point_paths) ac.add("", javascript_login_authn, "", "") JAVASCRIPT_END_POINT_INDEX = 0 end_point = config.AUTHENTICATION[authkey]["END_POINTS"][ JAVASCRIPT_END_POINT_INDEX] authn = AuthnIndexedEndpointWrapper(javascript_login_authn, JAVASCRIPT_END_POINT_INDEX) _urls.append((r'^' + end_point, make_auth_verify(authn.verify))) if "SAML" == authkey: from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST if not saml_authn: saml_authn = SAMLAuthnMethod(None, LOOKUP,