When using openidm.create() to generate a relationship between a managed user and the authzMembers of a managed role, duplicate entries can be added - this is not possible using the REST endpoint directly.
- Unzip IDM 6.0.0 or 6.5.0
- Start IDM and create a Managed User and a Managed Role
- Collect their _id values to substitute in to the assign.js script below
- Create assign.js within your ../openidm/script directory including the substituted values from above:
- Add the associated endpoint configuration in to the /conf directory:
- Call the endpoint twice:
- Read the managed role and check the authzMembers, e.g.
If you attempt to do the same via the UI, the second request to add the same managed user to the authzMembers attribute returns the following error:
A .HAR file is attached demonstrating this behaviour.