|
| 1 | +--- |
| 2 | +title: Integrate with Semaphore UI |
| 3 | +sidebar_label: Semaphore |
| 4 | +--- |
| 5 | + |
| 6 | +# Semaphore UI |
| 7 | + |
| 8 | +<span class="badge badge--secondary">Support level: Community</span> |
| 9 | + |
| 10 | +## What is Semaphore UI |
| 11 | + |
| 12 | +> Semaphore UI is a modern web interface for managing popular DevOps tools. |
| 13 | +> -- https://semaphoreui.com/ |
| 14 | +> |
| 15 | +> This guide explains how to configure Semaphore UI to use authentik as the OAuth provider for logging in to the Web GUI. |
| 16 | +
|
| 17 | +## Preparation |
| 18 | + |
| 19 | +The following placeholders are used in this guide: |
| 20 | + |
| 21 | +- `semaphore.company` is the FQDN of the Semaphore install. |
| 22 | +- `authentik.company` is the FQDN of the authentik install. |
| 23 | + |
| 24 | +## authentik configuration |
| 25 | + |
| 26 | +[Create](https://docs.goauthentik.io/docs/add-secure-apps/applications/manage_apps#add-new-applications) an OAuth2/OpenID provider and an application in authentik. Use the following parameters for the OAuth2/OpenID provider: |
| 27 | + |
| 28 | +**Provider:** |
| 29 | + |
| 30 | +- Name: `SP-semaphore` |
| 31 | +- Client type: `Confidential` |
| 32 | +- Redirect URIs/Origins (RegEx): `https://semaphore.company/api/auth/oidc/authentik/redirect/` |
| 33 | +- Signing Key: `authentik Self-signed Certificate` |
| 34 | + |
| 35 | +Take note of the Client ID and Client Secret, you'll need to give them to Semaphore UI in Step 3. |
| 36 | + |
| 37 | +Leave the rest as default values. The durations can be changed as needed. |
| 38 | + |
| 39 | +**Application:** |
| 40 | + |
| 41 | +- Name: `Semaphore UI` |
| 42 | +- Slug: `semaphore` |
| 43 | +- Launch URL: `https://semaphore.company/` |
| 44 | + |
| 45 | +## Semaphore UI configuration |
| 46 | + |
| 47 | +Log in to your Semaphore UI host via SSH. Edit the `config.json` file (should be located under `/etc/semaphore`) file with the text editor of your choice. |
| 48 | + |
| 49 | +Before the last curly brace, add the following content: |
| 50 | + |
| 51 | +``` |
| 52 | +"oidc_providers": { |
| 53 | + "authentik": { |
| 54 | + "display_name": "SSO-Login", |
| 55 | + "provider_url": "https://authentik.company/application/o/semaphore/", |
| 56 | + "client_id": "<client-id>", |
| 57 | + "client_secret": "<<< Client Secret >>>", |
| 58 | + "redirect_url": "https://semaphore.company/api/auth/oidc/authentik/redirect/", |
| 59 | + "username_claim": "username", |
| 60 | + "name_claim": "name", |
| 61 | + "email_claim": "email", |
| 62 | + "scopes": ["openid", "profile", "email"] |
| 63 | + } |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +:::info |
| 68 | +It is mandatory to include 'authentik' in lowercase letters. There should also be another curly brace above these lines. Make sure to add a `,` after it to maintain proper formatting. |
| 69 | +::: |
| 70 | + |
| 71 | +More information on this can be found in the Semaphore documentation https://docs.semaphoreui.com/administration-guide/openid/authentik/. |
| 72 | + |
| 73 | +Leave the rest as default. |
| 74 | + |
| 75 | +## Test the login |
| 76 | + |
| 77 | +- Open a browser of your choice and open the URL `https://semaphore.company`. |
| 78 | +- Click on the SSO-Login button. |
| 79 | +- You should be redirected to authentik (with the login flows you created) and then authentik should redirect you back to `https://semaphore.company` URL. |
| 80 | +- If you are redirected back to the `https://semaphore.company` URL you did everything correct. |
| 81 | + |
| 82 | +:::note Users are created upon logging in with authentik. They will not have the rights to create anything initially. These permissions must be assigned later by the local admin created during the first login to the Semaphore UI. ::: |
0 commit comments