Single sign-on for the portal¶
With single sign-on (SSO), the administrators of BastionXP sign in to the web portal with their company account, at your identity provider. Your identity provider checks the password and the second factor. BastionXP does not store a password for these administrators.
This is useful because you manage who is an administrator in one place, your identity provider. When somebody leaves the company, their access to the portal ends when their account ends.
BastionXP supports these identity providers:
- Microsoft Entra ID
- Google Workspace
- Okta
- Keycloak
- Any other identity provider that supports OpenID Connect
This page is about the portal only
Single sign-on for the portal is different from single sign-on for the people who get certificates. The administrators of the portal sign in with the setting that this page describes. The people who get certificates with the bxp-cli client use an OIDC verifier of an authority. See Certificate authorities and OIDC SSO.
Who can sign in¶
After you set up SSO, a person can sign in to the portal when both of these are true:
- BastionXP knows the person. Your identity provider tells BastionXP about its users and groups with SCIM. Set up SCIM first.
- The person is a member of the group
pki-adminsin your identity provider, or the person is an owner of your organization.
The group name must be exactly pki-admins. Create the group in your identity provider, add your administrators to it, and make sure that it is sent to BastionXP with SCIM.
BastionXP finds the person by their email address. For Microsoft Entra ID, BastionXP uses the person's user principal name, which is the sign-in name, for example [email protected]. This name must be the same as the email address that SCIM gave to BastionXP.
BastionXP does not ask for a second factor after SSO, because your identity provider has already asked for one. Turn on multi-factor authentication in your identity provider for these administrators.
Step 1: Register BastionXP with your identity provider¶
In your identity provider, create an app for BastionXP. Use the type Web application with OpenID Connect. Each identity provider has its own steps. Follow its documentation.
Give the app this redirect URI, also called the callback URL:
- If you run BastionXP yourself,
<domain>is thedomainsetting of your configuration file, for examplehttps://ca.example.com/oidc/callback. If you changedhttps_port, add the port, for examplehttps://ca.example.com:8443/oidc/callback. - If you use the BastionXP cloud service, the portal shows the exact address, in the Redirect URI box on the Single sign-on page. Copy it from there.
There is no slash at the end of the address.
Note the values that your identity provider gives you:
| Identity provider | Values to note | Permissions the app needs |
|---|---|---|
| Microsoft Entra ID | Application (client) ID, a client secret, and the Directory (tenant) ID | Microsoft Graph, delegated permission User.Read |
| Google Workspace | Client ID and client secret | The scopes email and profile |
| Okta | Client ID, client secret, and your Okta address, for example https://example.okta.com |
The scopes openid, profile and email |
| Keycloak | Client ID, client secret, and the realm's address, for example https://sso.example.com/realms/example |
The scopes openid, profile and email |
| Another OpenID Connect provider | Client ID, client secret, and the issuer address | The scopes openid, profile and email |
For Okta, Keycloak and other OpenID Connect providers, BastionXP finds the technical addresses of your identity provider by itself, from the issuer address. The issuer must start with https://. In the cloud service, the issuer must also be a public address on the internet. BastionXP refuses an address that points into a private network.
Step 2: Connect BastionXP¶
How you do this depends on how you use BastionXP.
-
In the portal, choose Settings at the bottom of the menu, and then Single sign-on.
-
Choose the Identity provider.
- Fill in the fields that appear. For Microsoft, this is the Directory (tenant) ID. For Okta, Keycloak and other OpenID Connect providers, it is the Issuer URL.
- Fill in the Client ID and the Client secret.
- Choose Save.
BastionXP checks the settings before it saves them. For Keycloak and other OpenID Connect providers, it also contacts your identity provider. If something is wrong, the portal says what, for example that the issuer cannot be used. If your plan does not include single sign-on, the page says Not in your plan.
The page never shows the client secret again. When you change other settings later, leave Client secret empty to keep the saved secret.
Add a dashboard_oidc section to the configuration file, /etc/bastionxp/config.yaml:
dashboard_oidc:
name: okta
client_id: 0oa1b2c3d4example
secret: your-client-secret
issuer: https://example.okta.com
| Setting | What it means |
|---|---|
name |
Your identity provider: microsoft, google, okta, keycloak or generic for another OpenID Connect provider. |
client_id, secret |
The client ID and the client secret that your identity provider gave you. |
tenant_id |
The Directory (tenant) ID. Only for microsoft. |
issuer |
The issuer address. For okta, keycloak and generic. |
Restart BastionXP:
On a self-hosted BastionXP, single sign-on is set in the configuration file, so the portal has no Single sign-on page. Setting dashboard_oidc also makes single sign-on required, as described below.
Require single sign-on¶
When single sign-on is required, administrators can no longer sign in with a password. Everybody must use your identity provider.
- If you use the cloud service, you choose this with the switch Require single sign-on on the Single sign-on page. It is off at first, so that you can test the sign-in before you require it.
- If you run BastionXP yourself, single sign-on is always required once you set
dashboard_oidc.
Two kinds of administrators can still sign in with a password and their second factor, even when single sign-on is required:
- the owners of your organization. On a self-hosted BastionXP, this is the administrator whose address is the
emailsetting, and - the break-glass admins, whom an owner chooses.
This is deliberate. Your identity provider can fail: a client secret can expire, somebody can delete the BastionXP app, or the provider can have an outage. Without a way in that does not depend on the identity provider, nobody could sign in to fix the settings.
Every password sign-in around required single sign-on is written to the audit log as a warning. It should be rare.
Before you require single sign-on
Test it first. Sign in with SSO from a private browser window, while you are still signed in as the owner in your normal window. Add a break-glass admin. Then require SSO.
Turn single sign-on off¶
In the cloud service, choose Turn off single sign-on on the Single sign-on page, and confirm. The saved settings are deleted, and your administrators sign in with a password and a second factor again.
On a self-hosted BastionXP, remove the dashboard_oidc section from the configuration file, and restart BastionXP.
Troubleshooting¶
When something goes wrong after you sign in at your identity provider, the browser shows a short message from BastionXP, or the sign-in page shows an error.
| What you see | What to check |
|---|---|
| The sign-in page says Single sign-on failed. Try again, or sign in with your password. | Your identity provider refused the sign-in. Check that the user is allowed to use the BastionXP app in your identity provider, and look at the sign-in log of your identity provider. |
this user is not an admin here |
BastionXP does not know the person. Check that SCIM synchronized the user, and that the email address in BastionXP is the same as the one that your identity provider uses. For Microsoft, it is the user principal name. |
this user is not a member of pki-admins |
Add the person to the pki-admins group in your identity provider, and wait for SCIM to synchronize the group. |
the identity provider cannot be reached |
BastionXP cannot connect to your identity provider. Check the issuer address, and the network between BastionXP and the provider. |
the identity provider did not say who logged in |
The app did not return an email address. Check the permissions in the table in Step 1. |
the login expired or was not started here: please log in again |
Start again from the portal's sign-in page. Do not open the identity provider's answer directly, and do not wait too long at your identity provider. |
| Your identity provider says that the redirect URI does not match | The redirect URI in your identity provider is not exactly the address of Step 1. Check the domain name, https, the port, and that there is no slash at the end. |
Every refused sign-in is written to the audit log, with the reason. Look for events in the area Sign-in that failed.
