{
  "realm": "eddi",
  "enabled": true,
  "sslRequired": "none",
  "registrationAllowed": false,
  "loginWithEmailAllowed": true,
  "duplicateEmailsAllowed": false,
  "resetPasswordAllowed": true,
  "editUsernameAllowed": false,
  "bruteForceProtected": true,
  "defaultRole": {
    "name": "default-roles-eddi",
    "description": "Default roles assigned to every new user on registration",
    "composite": true,
    "composites": {
      "realm": ["eddi-user"]
    },
    "clientRole": false
  },
  "roles": {
    "realm": [
      {
        "name": "eddi-admin",
        "description": "Full EDDI administration access"
      },
      {
        "name": "eddi-editor",
        "description": "Create and edit agents, configs, and secrets"
      },
      {
        "name": "eddi-user",
        "description": "End-user access — can start and talk to conversations, access own memories"
      },
      {
        "name": "eddi-viewer",
        "description": "Read-only access to EDDI resources"
      },
      {
        "name": "default-roles-eddi",
        "description": "Default roles assigned to every new user on registration",
        "composite": true,
        "composites": {
          "realm": ["eddi-user"]
        },
        "clientRole": false
      }
    ]
  },
  "clientScopes": [
    {
      "name": "openid",
      "description": "OpenID Connect scope — required for userinfo endpoint access",
      "protocol": "openid-connect",
      "attributes": {
        "include.in.token.scope": "true",
        "display.on.consent.screen": "false"
      }
    }
  ],
  "clients": [
    {
      "clientId": "eddi-backend",
      "name": "EDDI Backend",
      "description": "Server-side OIDC client for the EDDI Quarkus backend — validates Bearer tokens only",
      "enabled": true,
      "publicClient": false,
      "bearerOnly": true,
      "standardFlowEnabled": false,
      "directAccessGrantsEnabled": false
    },
    {
      "clientId": "eddi-frontend",
      "name": "EDDI Manager",
      "description": "Public SPA client for the EDDI Manager dashboard",
      "enabled": true,
      "publicClient": true,
      "bearerOnly": false,
      "standardFlowEnabled": true,
      "directAccessGrantsEnabled": true,
      "redirectUris": [
        "http://localhost:*",
        "https://localhost:*"
      ],
      "webOrigins": [
        "+",
        "http://localhost:7070",
        "https://localhost:7070",
        "http://localhost:7071",
        "https://localhost:7071",
        "https://localhost:7443",
        "http://localhost:3000",
        "http://localhost:5173"
      ],
      "defaultClientScopes": [
        "openid",
        "web-origins",
        "acr",
        "profile",
        "roles",
        "email"
      ],
      "protocolMappers": [
        {
          "name": "realm-roles",
          "protocol": "openid-connect",
          "protocolMapper": "oidc-usermodel-realm-role-mapper",
          "config": {
            "claim.name": "realm_access.roles",
            "multivalued": "true",
            "id.token.claim": "true",
            "access.token.claim": "true",
            "userinfo.token.claim": "true"
          }
        },
        {
          "name": "eddi-backend-audience",
          "protocol": "openid-connect",
          "protocolMapper": "oidc-audience-mapper",
          "consentRequired": false,
          "config": {
            "included.client.audience": "eddi-backend",
            "id.token.claim": "false",
            "access.token.claim": "true"
          }
        }
      ]
    }
  ],
  "users": [
    {
      "username": "eddi",
      "firstName": "EDDI",
      "lastName": "Admin",
      "email": "eddi@localhost",
      "enabled": true,
      "emailVerified": true,
      "credentials": [
        {
          "type": "password",
          "value": "eddi",
          "temporary": true
        }
      ],
      "realmRoles": [
        "eddi-admin",
        "eddi-editor"
      ]
    },
    {
      "username": "viewer",
      "firstName": "EDDI",
      "lastName": "Viewer",
      "email": "viewer@localhost",
      "enabled": true,
      "emailVerified": true,
      "credentials": [
        {
          "type": "password",
          "value": "viewer",
          "temporary": true
        }
      ],
      "realmRoles": [
        "eddi-viewer"
      ]
    },
    {
      "username": "user",
      "firstName": "EDDI",
      "lastName": "User",
      "email": "user@localhost",
      "enabled": true,
      "emailVerified": true,
      "credentials": [
        {
          "type": "password",
          "value": "user",
          "temporary": true
        }
      ],
      "realmRoles": [
        "eddi-user"
      ]
    }
  ]
}
