{
  "realm": "slurm",
  "enabled": true,
  "sslRequired": "none",
  "registrationAllowed": false,
  "loginWithEmailAllowed": false,
  "duplicateEmailsAllowed": false,
  "resetPasswordAllowed": false,
  "editUsernameAllowed": false,
  "bruteForceProtected": false,
  "clients": [
    {
      "clientId": "slurm-web",
      "name": "Slurm-web",
      "enabled": true,
      "protocol": "openid-connect",
      "publicClient": false,
      "secret": "{{ client_secret }}",
      "standardFlowEnabled": true,
      "implicitFlowEnabled": false,
      "directAccessGrantsEnabled": false,
      "serviceAccountsEnabled": false,
      "frontchannelLogout": true,
      "fullScopeAllowed": true,
      "redirectUris": [
        "http://localhost:{{ gateway_port }}/api/oidc/callback",
        "http://127.0.0.1:{{ gateway_port }}/api/oidc/callback"
      ],
      "webOrigins": [
        "http://localhost:{{ frontend_port }}",
        "http://localhost:{{ gateway_port }}",
        "+"
      ],
      "attributes": {
        "pkce.code.challenge.method": "S256"
      },
      "protocolMappers": [
        {
          "name": "groups",
          "protocol": "openid-connect",
          "protocolMapper": "oidc-group-membership-mapper",
          "consentRequired": false,
          "config": {
            "claim.name": "groups",
            "full.path": "false",
            "id.token.claim": "true",
            "access.token.claim": "true",
            "userinfo.token.claim": "true"
          }
        },
        {
          "name": "preferred-username",
          "protocol": "openid-connect",
          "protocolMapper": "oidc-usermodel-attribute-mapper",
          "consentRequired": false,
          "config": {
            "user.attribute": "username",
            "claim.name": "preferred_username",
            "jsonType.label": "String",
            "id.token.claim": "true",
            "access.token.claim": "true",
            "userinfo.token.claim": "true"
          }
        }
      ]
    }
  ],
  "components": {
    "org.keycloak.storage.UserStorageProvider": [
      {
        "name": "firehpc-ldap",
        "providerId": "ldap",
        "config": {
          "enabled": ["true"],
          "priority": ["0"],
          "connectionUrl": ["ldap://{{ ldap_host }}:{{ ldap_port }}"],
          "bindDn": [""],
          "bindCredential": [""],
          "bindType": ["none"],
          "authType": ["simple"],
          "vendor": ["other"],
          "usernameLDAPAttribute": ["uid"],
          "rdnLDAPAttribute": ["uid"],
          "uuidLDAPAttribute": ["uid"],
          "userObjectClasses": ["posixAccount", "inetOrgPerson"],
          "usersDn": ["ou=people,dc=cluster,dc={{ ldap_cluster }}"],
          "editMode": ["READ_ONLY"],
          "syncRegistrations": ["false"],
          "importEnabled": ["true"],
          "searchScope": ["2"],
          "pagination": ["false"]
        },
        "subComponents": {
          "org.keycloak.storage.ldap.mappers.LDAPStorageMapper": [
            {
              "name": "username",
              "providerId": "user-attribute-ldap-mapper",
              "config": {
                "ldap.attribute": ["uid"],
                "user.model.attribute": ["username"],
                "read.only": ["true"],
                "always.read.value.from.ldap": ["true"],
                "is.mandatory.in.ldap": ["true"]
              }
            },
            {
              "name": "full name",
              "providerId": "full-name-ldap-mapper",
              "config": {
                "ldap.full.name.attribute": ["cn"],
                "read.only": ["true"]
              }
            },
            {
              "name": "email",
              "providerId": "user-attribute-ldap-mapper",
              "config": {
                "ldap.attribute": ["mail"],
                "user.model.attribute": ["email"],
                "read.only": ["true"],
                "always.read.value.from.ldap": ["true"],
                "is.mandatory.in.ldap": ["false"]
              }
            },
            {
              "name": "first name",
              "providerId": "user-attribute-ldap-mapper",
              "config": {
                "ldap.attribute": ["givenName"],
                "user.model.attribute": ["firstName"],
                "read.only": ["true"],
                "always.read.value.from.ldap": ["true"],
                "is.mandatory.in.ldap": ["false"]
              }
            },
            {
              "name": "last name",
              "providerId": "user-attribute-ldap-mapper",
              "config": {
                "ldap.attribute": ["sn"],
                "user.model.attribute": ["lastName"],
                "read.only": ["true"],
                "always.read.value.from.ldap": ["true"],
                "is.mandatory.in.ldap": ["false"]
              }
            },
            {
              "name": "groups",
              "providerId": "group-ldap-mapper",
              "config": {
                "groups.dn": ["ou=groups,dc=cluster,dc={{ ldap_cluster }}"],
                "group.name.ldap.attribute": ["cn"],
                "group.object.classes": ["posixGroup"],
                "membership.ldap.attribute": ["memberUid"],
                "membership.attribute.type": ["UID"],
                "membership.user.ldap.attribute": ["uid"],
                "mode": ["READ_ONLY"],
                "user.roles.retrieve.strategy": ["LOAD_GROUPS_BY_MEMBER_ATTRIBUTE"],
                "memberof.ldap.attribute": [""],
                "preserve.group.inheritance": ["false"],
                "drop.non.existing.groups.during.sync": ["false"]
              }
            }
          ]
        }
      }
    ]
  }
}
