# OIDC connector loaded from almad.d at startup. Replace the
# claim/value pair with the SSO claim that should grant the first
# administrator access.
#
# Place in /etc/almaforge/almad.d/ on each host.
# Replace the issuerURL placeholder below with your IdP's OIDC
# discovery base. ${env:ALMA_SSO_CLIENT_ID} and
# ${env:ALMA_SSO_CLIENT_SECRET} are interpolated from
# /etc/almaforge/almad.env.
apiVersion: almaforge.com/v1
kind: OIDCConnector
metadata:
  name: corp
spec:
  issuerURL: <paste-from-your-IdP>
  clientID: ${env:ALMA_SSO_CLIENT_ID} # read from environment (almad.env)
  clientSecret: ${env:ALMA_SSO_CLIENT_SECRET} # read from environment (almad.env)
  scope:
    - openid
    - email
    - profile
    # Uncomment for Microsoft Entra, Okta, and other providers.
    # Google rejects this scope. Use googleAdminEmail and
    # googleServiceAccount instead.
    # https://almaforge.com/sso/google/
    # - groups
  claimsToRoles:
    # Map IdP groups to AlmaForge roles. Every claimsToRoles entry
    # is evaluated on every sign-in, and the user receives the union
    # of all matched roles.
    #
    # `claim` is the OIDC claim name as your IdP emits it. `groups`
    # is the convention for Okta, Entra ID, Keycloak, and Auth0.
    # If your IdP does not emit groups, map `email` or another claim
    # that your IdP includes in the ID token.
    #
    # `value` has to match what the provider actually sends, which is
    # often not the name you see in its admin console:
    #
    #   Okta              group-name
    #   Microsoft Entra   GUID of the group
    #   Google            group-name@example.com
    #
    # `roles` is a list of AlmaForge role names. Built-in roles are
    # `admin` (everything), `auditor` (read-only plus audit),
    # `access` (use resources), `member` (see and request access),
    # and `reviewer` (review access requests). Define custom roles as
    # additional drop-ins under almad.d/.
    - claim: groups
      value: admins
      roles:
        - admin
    - claim: groups
      value: auditors
      roles:
        - auditor
