Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-491: Add OIDC SSO with Okta #1336

Merged
merged 9 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
---
title: 'Palette SSO with Okta'
metaTitle: 'Set up Palette SSO with Okta'
metaDescription: 'Set up Palette SSO with Okta'
icon: ""
hideToC: false
fullWidth: false
hideToCSidebar: false
hiddenFromNav: false
---

import Tabs from 'shared/components/ui/Tabs';
import WarningBox from 'shared/components/WarningBox';
import InfoBox from 'shared/components/InfoBox';


# Enable SSO with Okta

Single sign-on (SSO) is an authentication method that enables users to log in to multiple applications and websites with one set of credentials. SSO works upon a trust relationship established and maintained between the service provider (SP) and an identity provider (IdP) using certificates. Palette supports SSO based on either SAML or OIDC.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

The following steps will guide you to enable Palette SSO with [Okta Workforce Identity Cloud](https://www.okta.com/products/single-sign-on/) based on OIDC.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved


# Prerequisites
In order to setup OIDC-based SSO with Okta, you need to have either a free or paid subscription with Okta. Okta provides free [developer subscriptions](https://developer.okta.com/signup/) for testing purposes.

If you want to use the same Okta application for OIDC-based SSO into your Kubernetes cluster itself, you need to install [kubelogin](https://github.com/int128/kubelogin) on your workstation to handle retrieval of access tokens for your cluster.


# Enablement
## Create the Okta Application

1. Log in to your Okta Admin console (`https://{your-okta-account}-admin.okta.com/admin/getting-started`) and navigate to **Applications** --> **Applications**. Click the **Create App Integration** button.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved


2. In the screen that opens, select `OIDC - OpenID Connect` for the sign-in method, then select `Web Application` for the application type. Then click **Next**.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved


3. The next screen allows you to configure the new Web App Integration. On the **App integration name** field, change the name from `My Web App` to `Spectro Cloud Palette OIDC`. If desired, you can also upload a logo for the application here. Leave the **Grant type** to its default of just the `Authorization Code` option.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Configure General Settings](/oidc-okta-images/oidc-okta_okta-general-settings.png)

<br />


4. Open a web browser and navigate to your Palette subscription. Navigate to **Tenant Settings** --> **SSO** and click **OIDC**. Click the button next to **Callback URL** to copy this value to the clipboard:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Copy Callback URL](/oidc-okta-images/oidc-okta_copy-callback-url.png)

<br />

5. Switch back to your Okta Admin console and paste the copied value into the **Sign-in redirect URIs** field, replacing the existing value:

![Paste Redirect URI](/oidc-okta-images/oidc-okta_paste-redirect-uri.png)

<br />

6. Switch back to Palette in the web browser and click the button next to **Logout URL** to copy this value to the clipboard:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Copy Logout URL](/oidc-okta-images/oidc-okta_copy-logout-url.png)

<br />

7. Switch back to your Okta Admin console and paste the copied value into the **Redirect URI** field, then click **Add** to add it to the list:

![Paste Logout URI](/oidc-okta-images/oidc-okta_paste-logout-uri.png)

<br />

8. These two redirect URIs are required for SSO to work with Palette. You can also add additional redirect URIs. The URIs in the table below are useful when you want to use Okta for OIDC authentication into your Kubernetes clusters.

| URL | Type of Access |
| --- | --- |
| `http://localhost:8000` | Using kubectl with the kube-login plugin from a workstation |
| `https://console.spectrocloud.com/v1/shelly/oidc/callback` | Using the web-based kubectl console |
| `https://<fqdn_of_k8s_dashboard>/oauth/callback` | Using OIDC authentication into Kubernetes Dashboard |
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved
<br />

9. When you have completed entering redirect URIs, scroll down to the **Assignments** section and section and select **Allow everyone in your organization to access**. Leave the **Enable immediate access with Federation Broker Mode** option enabled and click **Save**.

![Configure Assignments](/oidc-okta-images/oidc-okta_assignments.png)

<br />

10. You have now created the Okta Application! Next, we need to retrieve the Client ID and Client Secret information, which we'll need to provide in other steps. You should have landed on the **General** tab of your Okta Application. Click the **Copy to clipboard** button next to the Client ID to copy the secret value and save it somewhere. You will need this value for later:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Copy Client ID](/oidc-okta-images/oidc-okta_copy-client-id.png)

<br />

11. Click the **Copy to clipboard** button next to the Client Secret to copy the secret value and save it somewhere. You will need this value for later:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Copy Shared Secret](/oidc-okta-images/oidc-okta_copy-shared-secret.png)

<br />

## Create an Okta Authorization Server

To ensure Okta issues OIDC tokens with the correct claims, we need to create a custom Authorization Server. This is necessary since Okta issues so called "thin-id" tokens by default, which do not contain enough information for Palette (or Kubernetes) to work with. So we will create our own that includes the necessary claims.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved
<br />

12. Navigate to **Security** --> **API** and on the **Authorization Servers** tab and click **Add Authorization Server**:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Add Authorization Server](/oidc-okta-images/oidc-okta_add-authz-server.png)

<br />

13. Enter a name for the server, for example `Palette OIDC`. For the **Audience** field, enter the client identifier that you saved in step **10**. Optionally provide a description. Then click **Save**:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Name Authorization Server](/oidc-okta-images/oidc-okta_name-authz-server.png)

<br />

14. Navigate to the **Claims** tab and click **Add Claim**:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Add Claims](/oidc-okta-images/oidc-okta_add-claims.png)

<br />

Enter the required information from the tables below and click **Create**. Use this flow to create 3 claims in total. First create two claims for the user info:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

| Claim Name | Include in token type | Value Type | Value | Disable claim | Include In |
|------------|-----------------------|------------|-------|---------------|------------|
| u_first_name | ID Token (Always) | Expression | `user.firstName` | Unchecked | Any scope |
| u_last_name | ID Token (Always) | Expression | `user.lastName` | Unchecked | Any scope |

Next create a claim for group membership:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

| Claim Name | Include in token type | Value Type | Filter | Disable claim | Include In |
|------------|-----------------------|------------|-------|---------------|------------|
| groups | ID Token (Always) | Groups | Starts with: `palette-` | Unchecked | Any scope |

The example above will include the names of any groups that the Okta user is a member of, that start with `palette-`, in the `groups` claim of the ticket. For Palette SSO, Palette will make the user a member of Teams in Palette that have the identical name.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Claims Result](/oidc-okta-images/oidc-okta_claims-result.png)

<br />

15. Click **<-- Back to Authorization Servers** at the top of the page to navigate back to the list of all servers. You should now see the server we just created in the list. Select the **Issuer URI** shown and copy it to the clipboard. Save this value somewhere, you will need this value for later:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Get Issuer URI](/oidc-okta-images/oidc-okta_get-issuer-uri.png)

<br />

16. Navigate to the **Access Policies** tab and click **Add Policy**:
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Add Access Policy](/oidc-okta-images/oidc-okta_add-access-policy.png)

<br />

17. Set the **Name** and **Description** fields to `Palette`, then change the **Assign to** option to the Okta Application we created in step **3** (`Spectro Cloud Palette OIDC`). Find this by typing in the first few characters of the Application and wait for a search result to come up that you can click on.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

![Name Access Policy](/oidc-okta-images/oidc-okta_name-access-policy.png)

<br />

18. Click the **Add rule** button to add a rule to this Access Policy:

![Add Policy Rule](/oidc-okta-images/oidc-okta_add-policy-rule.png)

<br />

19. Set the **Rule Name** to `AuthCode`. Then deselect all Grant types but one, only leaving **Authorization Code** selected. Then click **Create Rule**.

![Configure Policy Rule](/oidc-okta-images/oidc-okta_configure-policy-rule.png)

<br />

You have now completed all configuration steps in Okta.
<br />

## Enable OIDC SSO in Palette

20. Open a web browser and navigate to your [Palette](https://console.spectrocloud.com) subscription.

Navigate to **Tenant Settings** --> **SSO** and click on **OIDC**. Enter the following information.

| Parameter | Value |
|-------------------|--------------------------------------------------------------------|
| Issuer URL | The Issuer URI that you saved in step **15**.|
| Client ID | The client identifier that you saved in step **10**. |
| Client Secret | The shared secret that you generated in step **11**. |
| Default Teams | Leave blank if you don't want users without group claims to be assigned to a default group. If you do, enter the desired default group name. If you use this option, be careful with how much access you give to the group. |
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved
| Scopes | Keep `openid`, `profile` and `email` as the default. |
| Email | Keep `email` as the default. |
| First Name | Set this to `u_first_name`. |
| Last Name | Set this to `u_last_name`. |
| Spectro Team | Keep `groups` as the default. |

![Enable Palette OIDC SSO](/oidc-okta-images/oidc-okta_configure-palette-oidc.png)

<br />

21. When all the information has been entered, click **Enable** to enable SSO. You will receive a message stating **OIDC configured successfully**.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved


## Create Teams in Palette

The remaining step is to create teams in Palette for the group that you allowed to be passed in the OIDC ticket in Okta, and give them the appropriate permissions. For this example, you will create the `palette-tenant-admins` team and give it **Tenant Admin** permissions. You can repeat this for any other team that you have a matching Okta group for.

22. Open a web browser and navigate to your Palette subscription. Navigate to **Tenant Settings** --> **Users & Teams** --> **Teams** tab, and click **+ Create Team**.

![Create Palette Team](/oidc-okta-images/oidc-okta_create-team.png)

<br />

23. Specify `palette-tenant-admins` in the **Team name** field. You don't need to set any members now, as this will happen automatically from the SSO. Click **Confirm** to create the team.

![Name Palette Team](/oidc-okta-images/oidc-okta_name-team.png)

<br />

24. The list of teams displays again. Select the newly created **palette-tenant-admins** team to review its details. To give this team administrative access to the entire tenant and all the projects in it, assign the **Tenant Admin** role. Select **Tenant Roles** and click **+ Add Tenant Role**:

![Palette Tenant Roles](/oidc-okta-images/oidc-okta_tenant-roles.png)

<br />

25. Click on **Tenant Admin** to enable the role. Click **Confirm** to add the role.

![Add Tenant Role](/oidc-okta-images/oidc-okta_add-tenant-role.png)

<br />

You will receive a message stating **Roles have been updated**. Repeat this procedure for any other teams, taking care to ensure they are given the appropriate permissions.
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

26. Click the **X** next to **Team Details** in the top left corner to exit this screen.

You have now successfully configured Palette SSO based on OIDC with Okta.


# Validate

1. Log in to Palette through SSO as a user that is a member of the `palette-tenant-admins` group in Okta to verify that users are automatically added to the `palette-tenant-admins` group in Palette.

If you're still logged into Palette with a non-SSO user, log out by selecting **Logout** in the **User Menu** at top right.

![User Logout](/oidc-okta-images/oidc-okta_user-logout.png)
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

<br />


2. The Palette login screen now displays a **Sign in** button and no longer presents a username and password field. Below the **Sign In** button, there is an **SSO issues? --> Use your password** link. This link can be used to bypass SSO and log in with a local Palette account in case there is an issue with SSO and you need to access Palette without SSO.

Click on the **Sign in** button to log in via SSO.

![User SSO Login](/oidc-okta-images/oidc-okta_palette-login.png)
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

<br />

3. If this is the first time you are logging in with SSO, you will be redirected to the Okta login page. Depending on your organization's SSO settings, this could be a simple login form or require MFA (Multi-Factor Authentication).
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved

Make sure you log in as a user that is a member of the `palette-tenant-admins` group in Okta. Once authenticated, you will automatically be redirected back to Palette and logged into Palette as that user.

<br />

4. You are now automatically added to the `palette-tenant-admins` team in Palette. To verify, navigate to the left **Main Menu**, select **Tenant Settings** --> **Users & Teams** --> **Teams** tab. Click the **palette-tenant-admins** team and view the team members section.


The user you logged in as has automatically been added to this team.


# Resources

- [Okta Workforce Identity Cloud](https://www.okta.com/products/single-sign-on/)

- [Palette User Management](/user-management)

- [Palette SSO](/user-management/saml-sso)
kreeuwijk marked this conversation as resolved.
Show resolved Hide resolved