Hi there,
In my tenant i allow my users login with an email and an optional username.
I have a requirement to prevent corporate users from logging in using the username ( the username should be null for corporate users.
how am i doing it so far:
i have a integration worker that grabs events on my internal system and uses the management api to create and update users.
The worker here is using the c# SDK from Auth0.
when this worker executes a specific use case it checks if the user it is updating is a corporate user or not .
on this, if i try to update the username for an empty string, the api will throw an exception with a message stating that the username length is wrong.
if i try to issue an update using just the username field and setting it to null , the managemt API will not accept it and return a message stating that required fields where not present on the request.
i am able to do this on the management web UI
On the management UI, if i grab a user that has a username, clear the textbox and submit, the username is cleared from the user in question.
i inspected the http PATCH issued by the management UI on my browser and the UI sends a HTTP Patch with a json object containing only the username field and a null value.
Something like:
{“username”:null} on the patch body.
The diference here being: the request is sent to a relative URL of the web UI so, im guessing that the web UI uses a BFF of sorts to proxy the requests.
Since the webUI is able to set the username to a null value , im wondering if its possible to do the same using the management API using the C# SDK.
Thank you