2017-02-17 74 views
0

我正在使用Auth0 Delegated Administration Extension來管理用戶。當我嘗試創建用戶時,出現此錯誤。Auth0不允許其他屬性:成員資格

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"}

我該如何解決這個問題並創建用戶?

回答

1

在你創建掛鉤,請嘗試以下操作:

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

你必須構建發送到API的對象。有些人想把它存儲在app_metadata.groups其他人app_metadata.departments ...

+0

謝謝。有效。最後一個問題。我怎樣才能通過這個擴展分配角色給用戶? – Bishan

+0

此擴展中尚不支持爲用戶分配角色。您可以使用授權擴展程序,但「最終用戶」尚不可用 –

+0

感謝您的支持 – Bishan