Auth0 Additional properties not allowed: memberships

1.5k views Asked by At

I am using Auth0 Delegated Administration Extension to manage users. When I am trying to create user, I am getting this error.

Oh snap! You got an error!

An error occurred while creating the user: {"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Additional properties not allowed: memberships (consider storing them in app_metadata or user_metadata. See \"Users Metadata\" in https://auth0.com/docs/api/v2/changes for more details)'.","errorCode":"invalid_body"}

How could I solve this and create users?

1

There are 1 answers

3
Sandrino Di Mattia On BEST ANSWER

In your create hook, try the following:

return cb(null, { ... app_metadata: { memberships: memberships } });

You have to construct the object that is sent to the API. Some people want to store it in app_metadata.groups others in app_metadata.departments ...