Skip to main content

Configure OKTA as an OIDC Identity Provider in ZITADEL

This guides shows you how to connect OKTA as an identity provider in ZITADEL.

info

In ZITADEL you can connect an Identity Provider (IdP) like OKTA to your instance and provide it as default to all organizations. Also, you can register the IdP to a specific organization only. If you allow so, your organizations members can do the same in self-service.

Open the Generic OIDC Provider Template​

Go to the settings page of your instance or organization and choose "Identity Providers".

In the table you can see all the providers you have configured. Also, you see all provider templates that are available.

Identity Provider Overview

Select the Generic OIDC Provider template.

Click on the ZITADEL Callback URL to copy it to your clipboard. You will have to paste it in the OKTA application later.

Generic OIDC Provider

OKTA Configuration​

Register a new client​

  1. Login to your OKTA Account and go to the applications list: <OKTA-DOMAIN/admin/apps/active>
  2. Click on "Create App Integration" and choose "OIDC - OpenID Connect"
  3. Choose Web application as Application type and give a name
  4. Paste the ZITADEL Callback URL you copied before to the Sign-in redirect URIs
  5. Save the clientid and client secret

Add new OIDC Application in OKTA

ZITADEL Configuration​

  1. Go back to the Generic OIDC Provider template you opened before in ZITADEL.
  2. Add the client ID and secret created before on your Web application.
  3. Give the provider a name, e.g. OKTA. This name will be displayed on the login screen button.
  4. Add the issuer URL of your OKTA account, e.g. https://trial-1925566.okta.com

You can optionally configure the following settings. A useful default will be filled if you don't change anything.

Scopes: The scopes define which scopes will be sent to the provider, openid, profile, and email are prefilled. This information will be taken to create/update the user within ZITADEL. ZITADEL ensures that at least the openid-scope is always sent.

Automatic creation: If this setting is enabled the user will be created automatically within ZITADEL, if it doesn't exist.

Automatic update: If this setting is enabled, the user will be updated within ZITADEL, if some user data is changed withing the provider. E.g if the lastname changes on the OKTA account, the information will be changed on the ZITADEL account on the next login.

Account creation allowed: This setting determines if account creation within ZITADEL is allowed or not.

Account linking allowed: This setting determines if account linking is allowed. When logging in with a OKTA account, a linkable ZITADEL account has to exist already.

info

Either account creation or account linking have to be enabled. Otherwise, the provider can't be used.

Activate IdP​

Once you created the provider, it is listed in the providers overview. Activate it by selecting the tick with the tooltip set as available.

If you deactivate a provider, your users with links to it will not be able to authenticate anymore. You can reactivate it and the logins will work again.

The provider can also be activated via API. As the identity providers are sub-resources of the login settings, this is done by linking the provider to the settings:

Activate the OKTA Provider

Ensure your Login Policy allows External IDPs​

  1. Go to the Settings
    • To allow external IdP logins by default, go to your instance default settings at $YOUR-DOMAIN/ui/console/instance?id=general
    • To allow external IdP logins on an organization, go to $YOUR-DOMAIN/ui/console/org-settings?id=login and ensure you have the right org context.
  2. Modify your login policy in the menu "Login Behavior and Security"
  3. Enable the attribute "External Login allowed"

You can also change the settings through the API directly either in the default settings or on a specific organization:

Allow External IDP

Test the setup​

To test the setup, use incognito mode and browse to your login page. You see a new button which redirects you to your OKTA login screen.

By default, ZITADEL shows what you define in the default settings. If you overwrite the default settings for an organization, you need to send the organization scope in your auth request.

The organization scope looks like this: urn:zitadel:iam:org:id:{id}. You can read more about the reserved scopes or use the ZITADEL OIDC Playground to see what happens with the login when you send different scopes.

OKTA Button

OKTA Login

Optional: Add ZITADEL action to autofill userdata​

You can use a ZITADEL action if you want to prefill the fields firstname, lastname and email verified with Okta data.

  1. Go to the users target organizations settings page.
  2. Add a new action with the body below. Make sure the action name equals the scripts function name. Also change the id in the script to match your provider configurations id.
  3. Add the action to the flow "External Authentication" and trigger it on "Post Authentication"
examples/okta_identity_provider.js
loading...