Skip to main content
Installation

Single sign-on

Sign in to RST Index with OIDC, CAS 3.0 or SAML 2.0. Addresses to register with the IdP, config.yaml settings, and mapping groups to departments and admins. Enterprise feature.

Single sign-on is an Enterprise feature and is included in the trial licence. OIDC (Keycloak, Entra ID, ADFS and others), CAS 3.0 and SAML 2.0 (ADFS and others) are supported. The sign-in page shows one button per single sign-on source. Staff are redirected to the IdP and return to the portal once signed in.

Single sign-on sources are configured in config.yaml. Without a valid Enterprise licence the sign-in page does not show these buttons, and existing sessions last until they expire. Local accounts, AD/LDAP and Feishu sign-in are not affected.

Addresses to register with the IdP

{base_url} is the access URL in .env, and {id} is the source's id in config.yaml.

TypeAddress to register with the IdP
OIDCCallback: {base_url}/api/auth/sso/{id}/callback
CASService: {base_url}/api/auth/sso/{id}/callback
SAMLSP metadata: {base_url}/api/auth/saml/{id}/metadata; ACS: {base_url}/api/auth/saml/{id}/acs

Set the access URL to the address staff actually use before registering with the IdP. If the access URL changes later, update the IdP as well.

OIDC

  1. Register a client with the IdP using the callback address above, and note the client ID, client secret and issuer.

  2. Add OIDC_CLIENT_SECRET=<client secret> to .env.

  3. Add the source under auth.providers in config.yaml:

    - id: keycloak
      type: oidc
      name: Company sign-in
      oidc:
        issuer: "https://sso.corp.local/realms/corp"
        client_id: rst-index
        client_secret: "${OIDC_CLIENT_SECRET}"
        scopes: [openid, profile, email, groups]
        claim_username: preferred_username
        claim_display_name: name
        claim_email: email
        claim_groups: groups
  4. Run docker compose up -d and then docker compose restart.

SettingDefaultDescription
issuer, client_idRequiredIdP issuer and client ID
client_secretClient secret
scopes[openid, profile, email]Add the scope your IdP uses for groups if you need group information
claim_usernamepreferred_usernameUser name claim
claim_display_namenameDisplay name claim
claim_emailemailEmail claim
claim_groupsgroupsGroups claim, used to sync departments and admins
insecure_skip_verifyfalseSkip IdP certificate verification. Use only for testing

When trust_email is on for an OIDC source, an email address is used for account matching only if email_verified is true.

CAS 3.0

- id: cas
  type: cas
  name: CAS sign-in
  cas:
    server_url: "https://cas.corp.local/cas"
    attr_display_name: displayName
    attr_email: mail
    attr_groups: memberOf

server_url is required. The portal validates tickets with the CAS 3.0 protocol and reads the display name, email and groups from the returned attributes. Register the callback address above as the service on the CAS server.

SAML 2.0

The portal acts as the SP, and sign-in starts at the portal (SP-initiated).

  1. Generate an SP certificate and private key:

    mkdir -p saml
    openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -subj "/CN=rst-index" \
      -keyout saml/sp.key -out saml/sp.crt
  2. In docker-compose.yml in the installation directory, uncomment the SAML SP certificate mount line (./saml:/etc/rstnav/saml:ro) to mount the saml directory into the container read-only.

  3. Add the source under auth.providers in config.yaml. Inside the container the certificate path is /etc/rstnav/saml/:

    - id: adfs
      type: saml
      name: ADFS
      saml:
        idp_metadata_url: "https://adfs.corp.local/FederationMetadata/2007-06/FederationMetadata.xml"
        sp_cert_file: /etc/rstnav/saml/sp.crt
        sp_key_file: /etc/rstnav/saml/sp.key
        attr_username: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"
        attr_display_name: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
        attr_email: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
        attr_groups: "http://schemas.xmlsoap.org/claims/Group"
  4. Run docker compose up -d and then docker compose restart.

  5. In the IdP, add a relying party from the SP metadata address, or enter the ACS address manually.

SettingDescription
idp_metadata_url or idp_metadata_fileIdP metadata URL or file; one of the two is required
sp_cert_file, sp_key_fileSP certificate and private key, required
entity_idSP entity ID, the SP metadata address by default
attr_usernameUser name attribute. NameID is used when empty
attr_display_name, attr_email, attr_groupsDisplay name, email and group attributes
allow_idp_initiatedAllow IdP-initiated sign-in, false by default

Pending SAML sign-in requests are stored in the database for 10 minutes, and each response can be used only once.

Group mapping

Groups returned by single sign-on are used for sync in the same way as AD/LDAP groups:

  • Set a department's external key to a value from the groups, and staff join that department when they sign in.
  • Staff whose groups match auth.admin_groups become company admins.
  • Memberships and admins set manually in the console are not affected by sync.

See AD/LDAP for details.

Linking existing accounts

Under Account and sign-in in the user menu, staff can link OIDC, CAS and SAML identities to their current account and then use any of them to reach the same account. If an identity already belongs to another account it cannot be linked this way, and an admin must merge the accounts on the Users page. See Account and sign-in.

On this page