Example #1
0
    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)
Example #2
0
    def saml_pass_login(self, info):
        from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST

        if self.saml_authn is None:
            self.init_mako()

            self.saml_authn = SAMLAuthnMethod(None,
                                              self.lookup,
                                              self.config.SAML,
                                              self.config.SP_CONFIG,
                                              self.issuer,
                                              "{}authorization".format(
                                                  self.issuer),
                                              userinfo=self.config.USERINFO)

        PASSWORD_END_POINT_INDEX = 1
        SAML_END_POINT_INDEX = 1
        password_end_point = self.config.AUTHENTICATION['UserPassword'][
            "END_POINTS"][PASSWORD_END_POINT_INDEX]
        saml_endpoint = info["END_POINTS"][SAML_END_POINT_INDEX]

        end_point_indexes = {
            BINDING_HTTP_REDIRECT: 1,
            BINDING_HTTP_POST: 1,
            "disco_end_point_index": 1
        }
        multi_saml = AuthnIndexedEndpointWrapper(self.saml_authn,
                                                 end_point_indexes)
        multi_password = AuthnIndexedEndpointWrapper(
            self.username_password_authn, PASSWORD_END_POINT_INDEX)

        auth_modules = [(multi_saml, r'^' + saml_endpoint),
                        (multi_password, r'^' + password_end_point)]
        return setup_multi_auth(self.ac, self.urls, auth_modules)
Example #3
0
            saml_endpoint = config.AUTHENTICATION["SAML"]["END_POINTS"][
                SAML_END_POINT_INDEX]

            end_point_indexes = {
                BINDING_HTTP_REDIRECT: 1,
                BINDING_HTTP_POST: 1,
                "disco_end_point_index": 1
            }
            multi_saml = AuthnIndexedEndpointWrapper(saml_authn,
                                                     end_point_indexes)
            multi_password = AuthnIndexedEndpointWrapper(
                username_password_authn, PASSWORD_END_POINT_INDEX)

            auth_modules = [(multi_saml, r'^' + saml_endpoint),
                            (multi_password, r'^' + password_end_point)]
            authn = setup_multi_auth(ac, URLS, auth_modules)

        if "JavascriptPass" == 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)

            PASSWORD_END_POINT_INDEX = 2
            JAVASCRIPT_POINT_INDEX = 1
Example #4
0
            saml_endpoint = config.AUTHENTICATION["SAML"]["END_POINTS"][
                SAML_END_POINT_INDEX]

            end_point_indexes = {
                BINDING_HTTP_REDIRECT: 1,
                BINDING_HTTP_POST: 1,
                "disco_end_point_index": 1
            }
            multi_saml = AuthnIndexedEndpointWrapper(saml_authn,
                                                     end_point_indexes)
            multi_password = AuthnIndexedEndpointWrapper(
                username_password_authn, PASSWORD_END_POINT_INDEX)

            auth_modules = [(multi_saml, r'^' + saml_endpoint),
                            (multi_password, r'^' + password_end_point)]
            authn = setup_multi_auth(ac, _urls, auth_modules)

        if "JavascriptPass" == 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)

            PASSWORD_END_POINT_INDEX = 2
            JAVASCRIPT_POINT_INDEX = 1
Example #5
0
            SAML_END_POINT_INDEX = 1
            password_end_point = config.AUTHENTICATION["UserPassword"][
                "END_POINTS"][PASSWORD_END_POINT_INDEX]
            saml_endpoint = config.AUTHENTICATION["SAML"]["END_POINTS"][
                SAML_END_POINT_INDEX]

            end_point_indexes = {BINDING_HTTP_REDIRECT: 1, BINDING_HTTP_POST: 1,
                                 "disco_end_point_index": 1}
            multi_saml = AuthnIndexedEndpointWrapper(saml_authn,
                                                     end_point_indexes)
            multi_password = AuthnIndexedEndpointWrapper(
                username_password_authn, PASSWORD_END_POINT_INDEX)

            auth_modules = [(multi_saml, r'^' + saml_endpoint),
                            (multi_password, r'^' + password_end_point)]
            authn = setup_multi_auth(ac, _urls, auth_modules)

        if "JavascriptPass" == 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)

            PASSWORD_END_POINT_INDEX = 2
            JAVASCRIPT_POINT_INDEX = 1
Example #6
0
            SAML_END_POINT_INDEX = 1
            password_end_point = config.AUTHENTICATION["UserPassword"][
                "END_POINTS"][PASSWORD_END_POINT_INDEX]
            saml_endpoint = config.AUTHENTICATION["SAML"]["END_POINTS"][
                SAML_END_POINT_INDEX]

            end_point_indexes = {BINDING_HTTP_REDIRECT: 1, BINDING_HTTP_POST: 1,
                                 "disco_end_point_index": 1}
            multi_saml = AuthnIndexedEndpointWrapper(saml_authn,
                                                     end_point_indexes)
            multi_password = AuthnIndexedEndpointWrapper(
                username_password_authn, PASSWORD_END_POINT_INDEX)

            auth_modules = [(multi_saml, r'^' + saml_endpoint),
                            (multi_password, r'^' + password_end_point)]
            authn = setup_multi_auth(ac, URLS, auth_modules)

        if "JavascriptPass" == 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)

            PASSWORD_END_POINT_INDEX = 2
            JAVASCRIPT_POINT_INDEX = 1