firebase_admin/_user_mgt.py
def create_user(self, uid=None, display_name=None, email=None, phone_number=None,
                    photo_url=None, password=None, disabled=None, email_verified=None):
        """Creates a new user account with the specified properties."""
        payload = {
            'localId': _auth_utils.validate_uid(uid),
            'displayName': _auth_utils.validate_display_name(display_name),
            'email': _auth_utils.validate_email(email),
            'phoneNumber': _auth_utils.validate_phone(phone_number),
            'photoUrl': _auth_utils.validate_photo_url(photo_url),
            'password': _auth_utils.validate_password(password),
            'emailVerified': bool(email_verified) if email_verified is not None else None,
            'disabled': bool(disabled) if disabled is not None else None,
        }
        payload = {k: v for k, v in payload.items() if v is not None}
        try:
            body, http_resp = self._client.body_and_response('post', '/accounts', json=payload)
        except requests.exceptions.RequestException as error:
            raise _auth_utils.handle_auth_backend_error(error)
        else:
            if not body or not body.get('localId'):
                raise _auth_utils.UnexpectedResponseError(
                    'Failed to create new user.', http_response=http_resp)
            return body.get('localId')
Creates a new user account with the specified properties.
Creates a new user account with the specified properties.
Creates a new user account with the specified properties .
def create_user(self, uid=None, display_name=None, email=None, phone_number=None,
                    photo_url=None, password=None, disabled=None, email_verified=None):
        payload = {
            'localId': _auth_utils.validate_uid(uid),
            'displayName': _auth_utils.validate_display_name(display_name),
            'email': _auth_utils.validate_email(email),
            'phoneNumber': _auth_utils.validate_phone(phone_number),
            'photoUrl': _auth_utils.validate_photo_url(photo_url),
            'password': _auth_utils.validate_password(password),
            'emailVerified': bool(email_verified) if email_verified is not None else None,
            'disabled': bool(disabled) if disabled is not None else None,
        }
        payload = {k: v for k, v in payload.items() if v is not None}
        try:
            body, http_resp = self._client.body_and_response('post', '/accounts', json=payload)
        except requests.exceptions.RequestException as error:
            raise _auth_utils.handle_auth_backend_error(error)
        else:
            if not body or not body.get('localId'):
                raise _auth_utils.UnexpectedResponseError(
                    'Failed to create new user.', http_response=http_resp)
            return body.get('localId')
def create_user ( self , uid = None , display_name = None , email = None , phone_number = None , photo_url = None , password = None , disabled = None , email_verified = None ) : payload = { 'localId' : _auth_utils . validate_uid ( uid ) , 'displayName' : _auth_utils . validate_display_name ( display_name ) , 'email' : _auth_utils . validate_email ( email ) , 'phoneNumber' : _auth_utils . validate_phone ( phone_number ) , 'photoUrl' : _auth_utils . validate_photo_url ( photo_url ) , 'password' : _auth_utils . validate_password ( password ) , 'emailVerified' : bool ( email_verified ) if email_verified is not None else None , 'disabled' : bool ( disabled ) if disabled is not None else None , } payload = { k : v for k , v in payload . items ( ) if v is not None } try : body , http_resp = self . _client . body_and_response ( 'post' , '/accounts' , json = payload ) except requests . exceptions . RequestException as error : raise _auth_utils . handle_auth_backend_error ( error ) else : if not body or not body . get ( 'localId' ) : raise _auth_utils . UnexpectedResponseError ( 'Failed to create new user.' , http_response = http_resp ) return body . get ( 'localId' )
Creates a new user account with the specified properties.
Creates a new user account with the specified properties .
"""Creates a new user account with the specified properties."""
self
uid
display_name
email
phone_number
photo_url
password
disabled
email_verified