Skip to main content

Command Palette

Search for a command to run...

Okta Single Sign-On (SSO) Setup: A Step-by-Step Guide

Updated
12 min read

Configuring SSO authentication in Okta

After logging into the Okta panel, you will be redirected to the dashboard. From here, we will configure Okta to enable Single Sign-On (SSO) authentication for our application.

Image description

Assigning users to group

We need to add groups and add the required users to the appropriate group.

!Note: Only users who are members of this group will be able to sign in to your application.

In the side menu, navigate to the Groups page

Image description

then click to the Add group button

Image description

A modal window will appear with the configuration form.

Fill this form with the group name and description, then click the Save button.

Image description

In the side menu, navigate to the People page, then choose a particular person in the list and click to navigate to the Person page

Image description

Click on the Groups subtitle to navigate to the profile page

Image description

Click on the Search field and enter the group name that you want to assign the user with, then click to the appearing group.

Image description

Creating an application

An application refers to a cloud or on-premises service integrated with Okta for single sign-on, enabling users to securely access and authenticate across multiple applications with a single set of credentials.

Next, navigate to the Applications page (as shown in the screenshot)

Image description

Click on the Create App Integration button

Image description

A modal window will appear with configuration options. Select the options as shown in the screenshot, then click the Next button.

Image description

You will be redirected to the configuration page:

Follow the instructions below and configure the settings as marked in the next two screenshots:

  1. I will set my app name to "SSO OIDC", but you can use just "your application".

  2. Sign-in redirect URIs: The format should be: https://<your-user-pool-domain>/oauth2/idpresponse where <your-user-pool-domain> is your Cognito User Pool Domain

(example: https://eu-north-2uasd2wr7mv.auth.eu-north-1.amazoncognito.com/oauth2/idpresponse).

  1. Sign-out redirect URIs: This ensures users are properly signed out when logging out of our application. Input: https://yourapp.com/

  2. Right holder access: choose the Limit access to selected groups option and enter group names you want to give access to your application application.

  3. Click on the Save button.

Image description Image description

You will then be redirected to the newly created application's page.

Image description

Configuring a User Okta profile (Add Roles to Profile)

In Okta, we can define roles for users to manage permissions within our application.

These roles determine the level of access a user has, such as admin, manager, etc.

In the side menu, navigate to the Profile Editor page

Click to User (default) link to open User Okta Profile edit page:

Image description

Click on the Add Attribute button to add a new attribute for roles in the Okta User profile:

Image description

A modal window will appear with configuration form.

Fill this form as shown in the following screenshot, then click the Save button.

Image description

Configuring an OIDC client profile for the app

In the side menu, navigate to the Profile Editor page:

Image description

Click on the SSO OIDC User (name of our application) link to navigate to the OIDC Client Profile edit page:

Image description

Click on the Add Attribute button to add a new attribute for roles in the OIDC Client Profile.

Image description

A modal window will appear with configuration form.

Fill this form as shown in the following screenshot, then click the Save button.

Image description

Click on the Mappings button to configure the mapping between the Okta User Profile and the OIDC Client Profile:

Image description

A modal window will appear with configuration fields for each relation.

Image description

Slide to the last field, type in the field user.userRoles. Click on the relation button which mark on the following screenshot:

Image description

Choose an Apply mapping on user create and update option:

Image description

Now, this should look like as shown below. Click on the Save Mappings button.

Image description

Configuring an API Authorization

In the side menu, navigate to the API page

Click on the default link (I use default_2, because default in my account already configured), which is marked in the following screenshot:

Image description

Configuring a group scope

Now, let's configure scopes to define the permissions our application can request.

Click on the Scopes subtitle to navigate to the scopes configuration page:

Image description

Click on the Add Scope button to add a new scope, which will be used for groups

Image description

A modal window will appear with configuration form. Fill this form as shown in the following screenshot, then click the Create button.

!Important: Scope name must be "groups", values in the "Display phrase" and "Description" fields are not that important.

Image description

Configuring role scope

Click on the Add Scope button to add a new scope, which will be used for roles

Image description

A modal window will appear with configuration form. Fill this form as shown in the following screenshot, then click the Create button.

Image description

Configuring a new groups claim

Configuring a claim after the scope for Okta SSO ensures that the appropriate user attributes are securely included in the authentication token, enabling seamless access control and personalized experiences across integrated applications.

Click on the Claims subtitle to navigate to the claims configuration page:

Image description

Click on the Add Claim button to add a new claim, which will be used for groups:

Image description

A modal window will appear with configuration form. Fill this form as shown in the following screenshot, then click the Create button.

!Important: Claim name must be "groups" and all other values must be identical as on screenshot!

Image description

Configuring a new roles claim

Click on the Add Claim button to add a new claim, which will be used for roles.

A modal window will appear with configuration form. Fill this form as shown in the following screenshot, then click the Create button.

Image description

Configuring a new access policy

Access policies and rules in Okta SSO allow administrators to define and enforce conditions for user authentication, ensuring secure and granular control over who can access applications based on factors like location, device, and user group.

Click on the Access Policies subtitle to navigate to the access policies configuration page:

Image description

Click on the Add Policy button to add a new policy:

Image description

A modal window will appear with a configuration form. Fill this form as shown in the following screenshot, then click the Create Policy button.

Image description

Click on the Add rule button to add a new rule

Image description

A modal window will appear with the configuration form. Fill in this form as shown in the screenshot.

In the "User is" section, select the group you want to allow access to your application. In my case, it is the users from "test_group".

You can also add individual users if needed.

Then, click the Create rule button.

Only users who are members of the selected group (and assigned the app) will be able to sign in.

Image description

Configuring a new Event Hooks

Event Hooks in Okta SSO allow your application to track IAM related events. We will create an event hook that listens for two specific events:

  • User removed from group

  • User deleted

These events will trigger a soft delete of the corresponding user in your application.

In the side menu, navigate to the Event hooks page:

Image description

Click on the Create Event Hook button to add an event hook

Image description

A modal window will appear with a configuration form.

Fill this form as shown in the following screenshot, then click the Save & Continue button.

Image description

Another more modal window will appear with a configuration form.

Click Verify to confirm that the webhook is active and reachable.

Image description

You will then be redirected to the newly created event hook page.

Image description

Assigning user roles

In the side menu, navigate to the People page, then choose a particular person in the list and click to navigate to the Person page

Image description

Click on the Profile subtitle to navigate to the profile page

Image description

Click on the Edit button to enable editing attributes of the profile. Slide down to the bottom of the page.

Image description

Now, you can choose any number of roles from the list for the particular user. Click the Save button.

Image description

Deleting users

Delete user from group:

To trigger a soft-delete of a user in your application, you need to either remove the user from an Okta group or fully delete the user from Okta IAM.

To soft-delete a user from all rights holders where the user was, you need to remove the user from the corresponding Okta group (the group with the Group name defined in your SSO Client Provider).

In the side menu, navigate to the Groups page and click on the group which you want to remove users:

Image description

Next to the user you want to remove, click on the cross (x) icon and the user will be removed.

Image description

Once the user is removed from the group, they will be soft-deleted in your application.

Note: Users will be removed only when deleted from groups that are present in your app SSO Providers Group name, if not this event hook will be skipped.

Delete user from IAM:

In the side menu, navigate to the People page and select the the user which you want to delete:

Image description

You will be redirected to the User Profile page. Click on the More Actions button, then click Deactivate to deactivate the user.

Image description

A modal window will appear with. Click Deactivate.

Image description

Then after the user deactivated, the Delete button will appear. Click Delete to completely delete the user from IAM.

Image description

A modal window will appear with. Click Delete.

Image description

After this, the selected user will be completely deleted from Okta IAM.

If a user with the same email exists in your application, that user will also be soft-deleted in your application.

(Optional) Multi Factor Authentication

Configuring Global Session Policy

Multi-Factor Authentication (MFA) adds an additional layer of security to user login. When enabled, users must verify their identity using a second factor, such as the Okta Verify app, in addition to their password.

In the side menu, navigate to the Global Session Policy page. Сlick Add policy button

Image description

A modal window will appear. Enter Policy name, Policy Description and assign it to the group you want to enforce MFA for. In my case this will be a group of Everyone. Click Create policy and add rule.

Image description

Another modal window will appear with adding policy rule. Enter Rule name, Set MFA to Required, In User will be prompted for MFA, select the desired option. Then click Create rule.

Image description Image description

Configuring authentication policies

In the side menu, navigate to the Authentication Policies page and click on App sign-in button:

Image description

You will be redirected to the App sign-in policies page. Click Create policy to add a new policy.

Image description

In the modal window, provide a Policy name and Description, then click Create Policy.

Image description

You will be redirected to your policy page. Click Add rule.

Image description

A modal window will appear. Enter rule name, select the Groups you want to enforce MFA for.Configure other fields as shown in the screenshots below. Then click Save.

Image description Image description Image description

Your new authentication policy rule will be added.

Configuring Authenticators

In the side menu, navigate to the Authenticators page and click on Enrollment tab:

Image description

Then click Actions next to the default policy and select Edit.

Image description

In the modal window that appears, ensure that Okta Verify is set to Required, then click Save.

Image description

✅ That's it!

Okta Multi-Factor Authentication (MFA) is now successfully configured.

How to connect to your application

To enable Okta login for your users in your application, you need to retrieve the following three parameters:

  1. Client ID

  2. Client Secret

  3. Okta domain

You can find this data on our Application details page. In the side menu (Okta panel), navigate to the Applications

Choose an application which you created previously. In my case, it is an SSO OIDC (marked below)

Image description

Instructions for copying the whole information that we should fill in your application can see below

Image description Image description

Copy a issuer URL

To obtain the Issuer URL for your application, open: https://{yourOktaDomain}/.well-known/openid-configuration (In my case it is: https://integrator-1609932.okta.com/.well-known/openid-configuration)

Then copy the value of the issuer field from the returned JSON:

Image description

Now, you have all the required credentials to connect to your application!

Enterprise SSO with Django

Part 5 of 6

A hands-on series on implementing enterprise Single Sign-On (SSO) in a Django application. Covers configuring Azure AD and Okta as identity providers, setting up AWS Cognito as the OIDC broker, wiring SSO providers through the Django admin panel, and testing the full login, logout, and group validation flow end-to-end.

Up next

Azure Single Sign-On (SSO) Setup: A Step-by-Step Guide

To enable Single Sign-On (SSO) for your application, we first need to register it in Azure Active Navigate to Microsoft Entra ID: Click to Add button and select App registration: Fill in the Name