1 Resources oauth_roles
Forgejo Actions edited this page 2026-11-26 09:28:48 +00:00

openwebui_oauth_roles (Resource)

Owns the two OAuth/OIDC role lists: OAUTH_ALLOWED_ROLES (who may sign in) and OAUTH_ADMIN_ROLES (who becomes an administrator). Only these two are written. The plan fails unless OAuth role management is on, the roles claim is roles_claim, and settings are persisted (not set by environment), because then these lists would not take effect. Destroying the resource leaves the lists in place.

Example Usage

# Who may sign in through OIDC, and who becomes an administrator. Role
# management and the groups claim must already be configured in Open WebUI.
resource "openwebui_oauth_roles" "this" {
  allowed_roles = ["admin", "ai_admin", "user"]
  admin_roles   = ["admin", "ai_admin"]
  roles_claim   = "groups"
}

Schema

Required

  • admin_roles (Set of String) Group names given the admin role (OAUTH_ADMIN_ROLES). Order is not meaningful.
  • allowed_roles (Set of String) Group names allowed to sign in (OAUTH_ALLOWED_ROLES). Order is not meaningful.
  • roles_claim (String) The claim the identity provider puts the groups in. Checked, never written: it must equal OAUTH_ROLES_CLAIM.

Read-Only

  • id (String) Always oauth_roles.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Open WebUI holds one set of role lists, so this resource is a singleton.
terraform import openwebui_oauth_roles.this oauth_roles