I seem to be able to create Users via the management API that I can not retrive.
user_ids like CK10596
and u22759of6c92c
seem to work fine. But I also have uids like email@example.com
.
If I want to create a User with the user_id email@example.com
twice I get an “400: The user already exists” on the second try - which is correct.
But If I then try to get the user via /api/v2/users/email@example.com
I get a “404: The user does not exist.” - so I wonder if I’, there is an API limitation or just encoding issues in the Python Library I use.
Pseudo code is like this:
payload = {
"connection": 'DefaultDatabase',
"email": credential.email,
"password": credential.secret,
"user_id": credential.uid,
}
try:
newuser = auth0api.users.create(payload)
except Auth0Error as ex:
if ex.status_code == 400 and ex.message == u'The user already exists.':
try:
newuser = auth0api.users.get('auth0|{}'.format(credential.uid))
except Auth0Error as ex:
if ex.status_code == 404 and ex.message == u'The user does not exist. ':
# WTF? First we get told it does exist
# then they complain it does not?
return