Skip to content

OIDC server setup

1. Register BastionXP CA at your provider

Register BastionXP CA as a web application ("confidential client"):

Setting at the provider Value
Application type Web / confidential client (with a client secret)
Redirect URI server.url + /v1/oidc/callback, e.g. https://ca.example.com:8443/v1/oidc/callback
Scopes openid, profile, email (and groups where the provider needs it)
Credentials Create a client secret

If you want rules by group, tell the provider to put the person's groups into the ID token. The provider pages show how.

2. Store the client secret

sudo install -m 600 -o bastionxp-ca /dev/null /etc/bastionxp-ca/oidc-client-secret
sudo vi /etc/bastionxp-ca/oidc-client-secret      # paste the secret

Keep it in client_secret_file, readable only by the user that runs the server; then the configuration file holds no secret. (An inline client_secret works too, and makes the configuration file sensitive.)

3. Configure BastionXP CA

server:
  url: https://ca.example.com:8443         # what browsers use; required

oidc:
  issuer: https://login.microsoftonline.com/<tenant-id>/v2.0
  client_id: 00000000-0000-0000-0000-000000000000
  client_secret_file: /etc/bastionxp-ca/oidc-client-secret
  # username_claim: preferred_username   # the default
  # groups_claim: groups                 # the default
  # scopes: [openid, profile, email]     # the default

access:
  - groups: [linux-users]
    ssh_principals: ["{short_username}"]
  - groups: [ca-admins]
    admin: true
Key Default Meaning
oidc.issuer The provider's issuer URL (https://). BastionXP CA discovers the rest from it.
oidc.client_id From the registration.
oidc.client_secret_file File with the client secret.
oidc.client_secret The secret inline (not both).
oidc.username_claim preferred_username The claim that names the person.
oidc.groups_claim groups The claim with their groups.
oidc.scopes openid, profile, email Scopes asked for.
oidc.x509.cert_profile tls-client The profile of people's own TLS client certificates (bxp tls).
oidc.ssh.cert_profile ssh-user The profile of people's own SSH certificates (bxp ssh).

The two cert_profile settings may name one of your profiles: based on tls-client and ssh-user.

See Access rules for access.

4. Restart and check

sudo systemctl restart bastionxp-ca
sudo -u bastionxp-ca bxp doctor --config /etc/bastionxp-ca/bastionxp-ca.yaml

doctor checks that the provider is reachable and accepts the CA. The server started log line says oidc_login=true. Later changes to access only need a reload.

Requirements and notes

  • server.url is required: the provider sends browsers back to it.
  • People's browsers must trust the CA. During a login the browser visits the CA's address, and the CA's own certificate comes from its own root. Install root.crt in the trust store of the machines people log in from (see Trust the CA); otherwise the browser shows a certificate warning.
  • With username_claim: email, BastionXP CA accepts the address only if the provider says it verified it (email_verified), and refuses the login otherwise. Some providers let people set an address they do not own; with Microsoft Entra ID, use preferred_username, never email.
  • The CA must reach the provider over HTTPS (discovery, keys, token exchange).
  • OIDC and LDAP can be on at the same time; they share the access rules.