synapse/handlers/register.py
def register_saml2(self, localpart):
        """
        Registers email_id as SAML2 Based Auth.
        """
        if types.contains_invalid_mxid_characters(localpart):
            raise SynapseError(
                400,
                "User ID can only contain characters a-z, 0-9, or '=_-./'",
            )
        user = UserID(localpart, self.hs.hostname)
        user_id = user.to_string()

        yield self.check_user_id_not_appservice_exclusive(user_id)
        token = self.macaroon_gen.generate_access_token(user_id)
        try:
            yield self.store.register(
                user_id=user_id,
                token=token,
                password_hash=None,
                create_profile_with_localpart=user.localpart,
            )
        except Exception as e:
            yield self.store.add_access_token_to_user(user_id, token)
            # Ignore Registration errors
            logger.exception(e)
        defer.returnValue((user_id, token))

        Registers email_id as SAML2 Based Auth.
        
Registers email_id as SAML2 Based Auth.
Registers email_id as SAML2 Based Auth .
def register_saml2(self, localpart):
        if types.contains_invalid_mxid_characters(localpart):
            raise SynapseError(
                400,
                "User ID can only contain characters a-z, 0-9, or '=_-./'",
            )
        user = UserID(localpart, self.hs.hostname)
        user_id = user.to_string()
        yield self.check_user_id_not_appservice_exclusive(user_id)
        token = self.macaroon_gen.generate_access_token(user_id)
        try:
            yield self.store.register(
                user_id=user_id,
                token=token,
                password_hash=None,
                create_profile_with_localpart=user.localpart,
            )
        except Exception as e:
            yield self.store.add_access_token_to_user(user_id, token)
            logger.exception(e)
        defer.returnValue((user_id, token))
def register_saml2 ( self , localpart ) : if types . contains_invalid_mxid_characters ( localpart ) : raise SynapseError ( 400 , "User ID can only contain characters a-z, 0-9, or '=_-./'" , ) user = UserID ( localpart , self . hs . hostname ) user_id = user . to_string ( ) yield self . check_user_id_not_appservice_exclusive ( user_id ) token = self . macaroon_gen . generate_access_token ( user_id ) try : yield self . store . register ( user_id = user_id , token = token , password_hash = None , create_profile_with_localpart = user . localpart , ) except Exception as e : yield self . store . add_access_token_to_user ( user_id , token ) logger . exception ( e ) defer . returnValue ( ( user_id , token ) )
Registers email_id as SAML2 Based Auth.
Registers email_id as SAML2 Based Auth .
"""
        Registers email_id as SAML2 Based Auth.
        """ # Ignore Registration errors
self
localpart