Hi, looking at SCIM integration docs <https://docs...
# permit-saas
o
Hi, looking at SCIM integration docs https://docs.permit.io/integrations/SCIM/EntraID and can't find much information in regards to tenant assignment. Currently when users are provisioned and role is assigned it assigns it to the
default
tenant. How it can be configured to assign role to another tenant?
a
Hi @Oleg Chekan, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
Based on the available documentation, the SCIM integration guides for both Entra ID and Okta don't explicitly cover configuring tenant assignment during the provisioning process (1) (2) . However, you can control tenant assignment programmatically after SCIM provisioning using Permit.io's SDK or API. When syncing users, you can specify the tenant parameter. For example, using the Node.js SDK:
Copy code
await permit.api.users.assignRole({
  user: "user_key",
  role: "role_name",
  tenant: "your_tenant_key"
}) ;
(3) Users are assigned to tenants via a role, and you can assign the same user to multiple tenants with different roles (4) . The tenant represents an isolated space within your application where roles, resources, and permissions are separated (3) . To change the default tenant assignment behavior, you would need to: 1. Let SCIM provision the user initially (which assigns to
default
) 2. Use the Permit.io API or SDK to reassign or add the user to your desired tenant with the appropriate role Alternatively, you could implement a webhook or automation that triggers when users are provisioned via SCIM to automatically assign them to the correct tenant based on your business logic. I don't have specific documentation showing how to configure the SCIM integration itself to provision directly to a non-default tenant. You may want to reach out over Email for guidance on whether this can be configured at the SCIM integration level.
To learn more, see the sources I considered: [[1] SCIM Integration with Permit.io via Entra ID (Azure AD)](https://docs.permit.io/integrations/SCIM/EntraID) [[2] SCIM Integration with Permit.io via Okta](https://docs.permit.io/integrations/SCIM/OKTA) [[3] Sync your First User](https://docs.permit.io/overview/sync-your-first-user-with-sdk) [[4] Multi-Tenant Authorization](https://docs.permit.io/concepts/multi-tenant-authorization)
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
d
Hi @Oleg Chekan, the bot provided a nice workaround for assigning tenants retroactively. I will check with the team if there is a way to do it upon scim provisioning
👍 1
o
yeah, that is possible workaround, but I don't see any mentions of webhooks in the documentation, Does permit have such an option?
d
Permit doesn't expose a user-provisioning webhook, but depending on your architecture you can build one upstream (e.g., on the Entra ID side) that reacts to provisioning events and calls Permit's API. If that is too complicated a simpler approach would be to specify the tenants after the users are provisioned (see the node.js example above). Im still checking to see if there is a native SCIM approach that is preferred.
Hi @Oleg Chekan, we are releasing a new version of SCIM soon that will include this updated feature. I will update you when released
🙏 1
Hi @Oleg Chekan , the new version should be released next week. Apologies for the delay, testing has taken more time than expected 🙏
🎉 1
o
Hi @david Was it released?
d
Hi @Oleg Chekan, great timing - it is being released momentarily. Will update you when it is ready
pink heart 1
Hi @Oleg Chekan, the new version is up and you can now provision tenant directly with scim! Your previous scim url looked something like this
Copy code
<https://scim.permit.io/scim/v2/{permit_project_id}/{permit_env_id}>
To add a tenant, change the url to this
Copy code
<https://scim.permit.io/scim/v2/{permit_project_id}/{permit_env_id}/v2/{tenant_id}>
Please note that the tenant must exist, otherwise the users will be added to 'unassigned'. Give it a try and let me know if you have any questions 🙂
o
thanks! will let you know if we will have any questions, I guess EU endpoint was also updated?
d
Yes EU was updated as well