ExScimPhoenix.Plugs.ScimTenant (ex_scim_phoenix v0.2.2)

Copy Markdown View Source

Plug for resolving tenant context from the request.

Place this plug AFTER ScimAuth in the pipeline. It calls the configured ExScim.Tenant.Resolver to determine the tenant, then sets scope.tenant_id.

When no resolver is configured, this plug is a no-op.

Configuration

config :ex_scim, tenant_resolver: MyApp.TenantResolver

Pipeline example

pipeline :scim do
  plug ExScimPhoenix.Plugs.ScimAuth
  plug ExScimPhoenix.Plugs.ScimTenant
end