IAM Tutorial
How to create a group of employees with a specific set of access controls
To specify user access level in a particular service resource, you need to create a group of users that share the same access controls. For the purposes of this tutorial, you will create an employee group with manager rights in Catalog API service.
Before you start
Ensure you have a tenant and users created.
Retrieve a list of available access controls
To assign specific access control level to a group, first you need to retrieve a list of predefined access controls available for your tenant by sending a request to the Retrieving all access controls endpoint.
curl -i -X GET
'https://api.emporix.io/iam/{tenant}/access-controls?pageNumber=1&pageSize=60&metadataModifiedAt=2022-01-01&roleId=1rl5e52e-6e27-4ac5-9471-2467d3fb7503&resourceId=string&expand=role%2Cresource'
-H 'Accept-Language: string'
-H 'Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}'
-H 'X-Total-Count: true'Create an employee group
Employee groups aggregate users that share the same access control within a particular service and resource. Create an employee group and assign access controls to it by sending a request to the Creating a new group endpoint.
Assign users to an employee group
By assigning a user to a particular employee group, you grant them a specific access control level. Create assignments by calling the Adding a user to a group endpoint.
How to manage custom scopes
In addition to the standard authorization model, the IAM Service also supports tenant-specific custom scopes, allowing you to extend access control beyond the default capabilities. Custom access controls can be created as collections of scopes and assigned to groups representing employees, customers, or technical users.
When a group is linked to one of these tenant-defined custom access controls, its users automatically inherit both the platform’s default scopes and any tenant-specific scopes included in that custom access control.
Typical flow:
Create or update a custom scope in IAM.
Create or update a tenant-specific custom access control that resolves to this scope.
Assign the custom access control to a user group.
Assign users to the group and request OAuth2 tokens.
Verify the assigned controls and scopes.
Create or update a custom scope
To create or update a custom scope, call the Upserting a custom scope endpoint.
Create or update an access control that uses custom scopes
Access controls map roles and resources to resolved scopes and are assigned to groups. To create or update an access control, call the Upserting an access control endpoint.
Assign access controls through groups
To assign access controls, call the Creating a new group endpoint and include your access control IDs in the payload.
Then call the Adding a user to a group endpoint.
Verify resolved scopes for a user
To validate IAM configuration, call the Retrieving all scopes granted to a user endpoint.
Custom scopes for custom entities
When you create a custom entity for a tenant, Emporix automatically generates a standard set of custom scopes for this entity. This ensures consistency across APIs and reduces the effort required to design and maintain permission models.
For each custom entity, the platform creates a predefined set of scopes following the reserved naming pattern custom.{lowerCaseType}_{action}:
custom.{lowerCaseType}_readcustom.{lowerCaseType}_managecustom.{lowerCaseType}_read_owncustom.{lowerCaseType}_manage_own
For example, for a Document custom entity, the generated scopes include custom.document_read, custom.document_manage, custom.document_read_own, and custom.document_manage_own.
These scopes are immediately available for use in IAM and can be included in your custom access controls. They are also exposed through OAuth2.
Last updated
Was this helpful?

