-
Notifications
You must be signed in to change notification settings - Fork 177
Description
Checklist
- I have looked into the Readme and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
We've set up a database connection with optional emails using the Flexible Identifiers and Attributes features. When using the .NET SDK to try to remove a user's email, I haven't been able to get it to work correctly.
When using the API directly, you can set the email
property to null
, which will cause the field to be removed from the user. However, when we call the .NET SDK and set the Email
property to null
, that causes the SDK to omit the property from the request, which results in the field being unchanged on the user.
We alternatively tried setting the Email
property to the empty string ""
, but that resulted in an error.
{
"statusCode": 400,
"error": "Bad Request",
"message": "Payload validation error: 'Object didn't pass validation for format email: ' on property email (Email address of this user).",
"errorCode": "invalid_body"
}
I do not necessarily want to change the behavior of sending null
using the SDK since "leaving a property unchanged" is a useful feature to support patching an existing user. However, with null
being used for that purpose and the empty string producing an error from the API, I am not sure how you should remove a user's email.
Reproduction
- Create a database connection
- Make email optional for users
- Create a user on that connection with some email
- Set up a .NET project using the Auth0 .NET SDK
- Use the SDK to make a user update request with
Email
set tonull
- Observe email is unchanged (reasonable result, but means I cannot remove the email)
Additional context
No response
auth0.net version
7.39.0
.NET version
8