Assign a default scope to a client
keycloak_client_scope_assignAssign an existing realm client scope to a client as a default scope. Idempotent write operation returns confirmation or reason if not assigned.
Instructions
Assigns an existing realm client scope to a client as a default scope. This is a write operation; it is idempotent, so re-assigning an already-assigned scope leaves the client unchanged. Use keycloak_client_scopes_list to find a valid scope name and keycloak_client_default_scopes_get to check current assignments before calling this. Returns a confirmation message when the scope is assigned, or a message starting with "Not assigned:" with the reason (for example when the client or scope does not exist).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | The name of an existing realm client scope to assign as a default scope, for example "profile" or "email". Must match a scope returned by keycloak_client_scopes_list. Required. | |
| clientId | Yes | The internal Keycloak UUID of the client (the "id" field, not the human-readable clientId), for example "a1b2c3d4-5678-90ab-cdef-1234567890ab". Required. |