Set up single sign-on
People sign in to Telesphorepo with the account they have at your identity provider. You add Telesphorepo as an app at the provider, copy the app’s details into Settings › Sign-in options, and choose whether the provider’s groups set each person’s server permissions.
The steps
Before you start
Section titled “Before you start”- The public address of the server is set: the Public base URL on Settings › General, as in Set the public address. The return address of single sign-on starts with it.
- You hold the server permission Manage sign-in options.
- You can add apps at your provider.
Another OpenID Connect provider
- The provider publishes its details at its issuer address with
/.well-known/openid-configurationadded. - The provider can give the app a secret, and sends a
preferred_usernamein the ID token or from its UserInfo address.
Add the app at your provider
Section titled “Add the app at your provider”The provider sends people back to Telesphorepo at the return address: the public address of the server with /api/auth/oidc/callback added, such as https://repo.example.com/api/auth/oidc/callback.
In Telesphorepo
- Open Settings › Sign-in options. Under Connect your provider, copy the Return address.
Okta
In the Okta Admin Console
-
Open Applications and Resources › Applications, click Create App Integration, and choose Classic experience.
-
For Sign-in method, choose OIDC - OpenID Connect. For the application type, choose Web Application, then click Next.
-
Fill in three fields under General Settings.
Field Value App integration name TelesphorepoGrant type Authorization code ticked Sign-in redirect URIs The return address -
Under Assignments, choose who may use the app: everyone in your organization, or Limit access to selected groups. Only these people can sign in to Telesphorepo.
-
Click Save. The page of the app opens. Under Client Credentials, copy the Client ID and the Client secret.
Microsoft Entra ID
In the Microsoft Entra admin center
-
Browse to Entra ID › App registrations, and select New registration.
-
Type
Telesphorepoin Name. Under Supported account types, choose Single tenant only, then select Register. The Overview page of the app opens. -
Copy the Application (client) ID and the Directory (tenant) ID.
-
Under Manage, select Authentication. On the Redirect URI configuration tab, select Add Redirect URI, then the Web tile. Paste the return address in Redirect URI, and select Configure.
-
Select Certificates & secrets › Client secrets › New client secret. Type a description, choose when it expires, and select Add. Copy the Value of the new secret: Entra ID never shows it again.
-
Select Token configuration, then Add optional claim. Choose the ID token type, tick
auth_time, and select Add. Telesphorepo needs it when a person approves a computer for the CLI.
Keycloak
In the Keycloak Admin Console, in your realm
-
Click Clients, then Create client.
-
Leave Client type at OpenID Connect. Type
telesphorepoin Client ID, and click Next. -
Turn on Client authentication, keep Standard flow on, and click Next.
-
Under Login settings, paste the return address in Valid redirect URIs, and click Save.
-
Open the Credentials tab of the client, and copy the Client Secret.
Another OpenID Connect provider
At your provider
-
Add an OpenID Connect app for a web app that runs on a server: a confidential client, which has a secret, and signs in with the authorization code flow.
-
Add the return address to the redirect addresses of the app, exactly as Telesphorepo shows it.
-
Copy the client ID and the client secret of the app.
To approve a computer for the CLI, a person signs in at the provider again. For that, the provider must sign the person in again when Telesphorepo asks for it (prompt=login), and put the time of the sign-in in the ID token (auth_time).
Connect Telesphorepo
Section titled “Connect Telesphorepo”In Telesphorepo, on Settings › Sign-in options
-
Under Connect your provider, fill in the fields.
Field Value Provider address The issuer address of the provider, as below App ID The client ID of the app App secret The client secret of the app Requested details openid profile email, as it isOkta
The provider address is your Okta domain, such as
https://your-org.okta.com, with no path.Microsoft Entra ID
The provider address is
https://login.microsoftonline.com/your-tenant-id/v2.0, with the directory (tenant) ID in place ofyour-tenant-id. Use the tenant ID, not the domain name of the tenant: Entra ID names its issuer with the ID, and Telesphorepo checks that the two match. The App ID is the application (client) ID, and the App secret is the secret value.Keycloak
The provider address is the address of Keycloak,
/realms/and the name of the realm, such ashttps://keycloak.example.com/realms/your-realm.Another OpenID Connect provider
The provider address is the
issuerin the provider’s/.well-known/openid-configurationdocument, character for character, including a slash at the end when it has one. -
Click Test your edits. A line says Connected to and the address of the provider when Telesphorepo reaches it.
-
Click Save in the bar at the bottom.
The first sign-in of a person makes their account, with no server permissions. Its username is the preferred_username that the provider sends, in lowercase, with every character other than letters, digits, ., _ and - changed to -. The account keeps that username when the name changes at the provider later.
Okta
Okta sends the Okta username of the person, which is often an email address: alice@example.com becomes alice-example.com.
Microsoft Entra ID
Entra ID sends the sign-in name of the person, which is often an email address: alice@contoso.com becomes alice-contoso.com.
Keycloak
Keycloak sends the username of the person in the realm.
Server permissions are set on this server unless you choose otherwise below: you give them on the People page, as in Give server permissions. Repository access is always given on the Access tab of each repository.
Let groups set server permissions
Section titled “Let groups set server permissions”With From groups at your provider, each sign-in sets the person’s server permissions from their groups at the provider: the permissions of every listed group they are in. A person in no listed group has no server permissions, and nobody can change them on the People page.
Okta
In the Okta Admin Console, on the page of the app
-
Open the Sign On tab, and click Edit in the OpenID Connect ID Token section.
-
Under Group claim type, choose Filter. Keep the name
groups, choose Matches regex, and type.*. -
Click Save.
Okta puts the groups in the ID token only when Telesphorepo asks for them. In the steps in Telesphorepo below, add groups to Requested details, so it reads openid profile email groups. Type groups in Group field. Each group is named as in Okta.
Microsoft Entra ID
In the Microsoft Entra admin center, on the page of the app
-
Select Token configuration, then Add groups claim.
-
Choose Security groups, or Groups assigned to the application, and select Save.
Type groups in Group field. Entra ID names each group by its object ID, such as 11111111-2222-3333-4444-555555555555, so the groups you list in Telesphorepo are object IDs too. A person in more than 200 groups gets no groups in the token, and so no server permissions. For such people, choose Groups assigned to the application, and assign the groups to the app.
Keycloak
For the groups of the realm, add a mapper to the client.
In the Keycloak Admin Console, on the page of the client
-
Open the Client scopes tab, and click
telesphorepo-dedicated. -
Click Configure a new mapper, or Add mapper › By configuration when the scope has mappers already. Choose Group Membership.
-
Fill in the form, and click Save.
Field Value Name groupsToken Claim Name groupsFull group path Off, so the value is repo-adminsand not/repo-adminsAdd to ID token On
Type groups in Group field.
For realm roles in place of groups, Keycloak puts the roles in the access token only, so turn on the ID token for them: click Client scopes in the menu, then roles, its Mappers tab and realm roles. Turn on Add to ID token, and click Save. Type realm_access.roles in Group field.
Another OpenID Connect provider
Ask the provider to put the person’s groups in a field of the ID token, or of its UserInfo answer, as a list of names or as one name. Type the name of that field in Group field. For a field inside another field, join the names with dots, such as realm_access.roles.
In Telesphorepo, on Settings › Sign-in options
-
Under Server permissions, choose From groups at your provider.
-
Type the field of the groups in Group field.
-
Under Permissions of each group, click Add a group. A dialog opens.
-
Type the Group as the provider sends it, choose its server permissions, and click Add group. Add the other groups the same way.
-
Click Save in the bar at the bottom, then Save changes in the dialog.
To make people who manage the server sign in with single sign-on, see Make managers use single sign-on.
Troubleshooting
Section titled “Troubleshooting”The provider did not answer. Check the provider address.
Telesphorepo reads the provider’s details at the provider address with /.well-known/openid-configuration added, and the issuer in them must be the provider address exactly. Open that address in a browser, and copy its issuer into Provider address.
Your single sign-on account has a username that is not valid here.
The provider sent no preferred_username, or one with no letter or digit. Keep profile in Requested details, and check that the person has a username at the provider.
A local account has the same username, so this single sign-on account cannot sign in.
An account with a password has the username that the provider sends, and Telesphorepo never joins two accounts by name. Change the person’s username at the provider to one that is free on the server.
Single sign-on failed. Try again.
The provider refused the sign-in or the app secret. Check that the App secret is the current secret of the app, and the server log names the step that failed.
Microsoft Entra ID
A client secret of Entra ID expires. Add a new one as in step 6 of Add the app at your provider, and save it in App secret.
Your identity provider did not say when you signed in
This shows when a person approves a computer for the CLI. The ID token has no auth_time.
Microsoft Entra ID
Add the optional claim auth_time to the ID token, as in step 7 of Add the app at your provider.
Keycloak, Okta or another provider
Ask the provider to put auth_time in the ID token of the app.
A person has no server permissions from their groups
The ID token has no groups in the Group field, or holds them in another form than the groups you listed. Permissions change only at the next sign-in, so the person signs out and in again after each change.
Microsoft Entra ID
List each group by its object ID, not its name. A person in more than 200 groups gets none in the token.
Keycloak
With Full group path on, Keycloak sends /repo-admins. Turn it off, or list the group with the slash.
Sign in with Google accounts
Section titled “Sign in with Google accounts”Google sends no preferred_username in its ID token, so Telesphorepo cannot name the account, and the first sign-in stops with “Your single sign-on account has a username that is not valid here.” Google sends no groups either.
To let people sign in with their Google accounts, connect Telesphorepo to a provider that signs people in with Google and sends a username, such as Keycloak with Google added as an identity provider. Then follow the steps of that provider on this page.