@@ -36,18 +36,38 @@ def login(self, client_id, username, password, connection, id_token=None,
3636 headers = {'Content-Type' : 'application/json' }
3737 )
3838
39- def signup (self , client_id , email , password , connection ):
40- """Signup using username and password.
39+ def signup (self , client_id , email , password , connection , username = None ,
40+ user_metadata = None ):
41+ """Signup using email and password.
42+
43+ Args:
44+ client_id (str): ID of the application to use.
45+
46+ email (str): The user's email address.
47+
48+ password (str): The user's desired password.
49+
50+ connection (str): The name of the database connection where this user should be created.
51+
52+ username (str, optional): The user's username, if required by the database connection.
53+
54+ user_metadata (dict, optional): Additional key-value information to store for the user.
55+ Some limitations apply, see: https://auth0.com/docs/metadata#metadata-restrictions
56+
57+ See: https://auth0.com/docs/api/authentication#signup
4158 """
59+ body = {
60+ 'client_id' : client_id ,
61+ 'email' : email ,
62+ 'password' : password ,
63+ 'connection' : connection ,
64+ 'username' : username ,
65+ 'user_metadata' : user_metadata
66+ }
4267
4368 return self .post (
4469 'https://{}/dbconnections/signup' .format (self .domain ),
45- data = {
46- 'client_id' : client_id ,
47- 'email' : email ,
48- 'password' : password ,
49- 'connection' : connection ,
50- },
70+ data = body ,
5171 headers = {'Content-Type' : 'application/json' }
5272 )
5373
0 commit comments