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.
| Type | Address to register with the IdP |
|---|---|
| OIDC | Callback: {base_url}/api/auth/sso/{id}/callback |
| CAS | Service: {base_url}/api/auth/sso/{id}/callback |
| SAML | SP 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
-
Register a client with the IdP using the callback address above, and note the client ID, client secret and issuer.
-
Add
OIDC_CLIENT_SECRET=<client secret>to.env. -
Add the source under
auth.providersinconfig.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 -
Run
docker compose up -dand thendocker compose restart.
| Setting | Default | Description |
|---|---|---|
issuer, client_id | Required | IdP issuer and client ID |
client_secret | Client secret | |
scopes | [openid, profile, email] | Add the scope your IdP uses for groups if you need group information |
claim_username | preferred_username | User name claim |
claim_display_name | name | Display name claim |
claim_email | email | Email claim |
claim_groups | groups | Groups claim, used to sync departments and admins |
insecure_skip_verify | false | Skip 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: memberOfserver_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).
-
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 -
In
docker-compose.ymlin the installation directory, uncomment the SAML SP certificate mount line (./saml:/etc/rstnav/saml:ro) to mount thesamldirectory into the container read-only. -
Add the source under
auth.providersinconfig.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" -
Run
docker compose up -dand thendocker compose restart. -
In the IdP, add a relying party from the SP metadata address, or enter the ACS address manually.
| Setting | Description |
|---|---|
idp_metadata_url or idp_metadata_file | IdP metadata URL or file; one of the two is required |
sp_cert_file, sp_key_file | SP certificate and private key, required |
entity_id | SP entity ID, the SP metadata address by default |
attr_username | User name attribute. NameID is used when empty |
attr_display_name, attr_email, attr_groups | Display name, email and group attributes |
allow_idp_initiated | Allow 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_groupsbecome 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.
AD/LDAP
Sign in to RST Index with AD or LDAP accounts. Configure a read-only service account in config.yaml, and sync department membership and admin rights from memberOf and OUs. Standard feature.
Feishu
Sign in to RST Index with a Feishu custom app, import Feishu departments and members, and turn on Feishu docs. Configured in the admin console and applied on save.