Skip to main content

Auth Code Flow

Step 1: Configure the App

  1. On the Create a new app integration page, select OIDC - OpenID Connect.
  2. For Application type, select Web Application.
  3. Click Next. Create a new app integration page with OIDC and Web Application selected
  4. On the General Settings page, enter an App integration name.
  5. For Grant type, select the following:
    • Authorization Code
    • Refresh Token: it is recommended to select Rotate token after every use for the refresh token behavior.
    • Implicit (hybrid): select the options to allow the ID Token and Access Token with the implicit grant type.
  6. Enter the Sign-in redirect URIs:
    • http://localhost:8585/callback
    • http://localhost:8585/silent-callback
  7. Enter the Sign-out redirect URIs.
  8. Enter the Base URIs.
  9. Select the required option for Controlled access.
  10. Click Save. General Settings page with the grant types and redirect URIs The app is now configured. Configured application overview, first part Configured application overview, second part

Step 2: Add an Authorization Server to Get the Issuer URL

It is recommended to create a separate authorization server for each application. The authorization server needs an endpoint, which is the Issuer URL.

New Authorization Server

  1. In the left navigation panel, click Security > API. Security menu with the API option
  2. On the Authorization Servers tab, click Add Authorization Server. Authorization Servers tab with the Add Authorization Server button
  3. Enter a Name and Description.
  4. Enter an Audience for the server. The Audience is the Client ID of the application that you created in Step 1. See Step 6 to find the Client ID.
  5. Click Save. Okta generates the Issuer URL. Add Authorization Server form with the name, audience, and description
  1. In the left navigation panel, click Security > API. Security menu with the API option
  2. On the Authorization Servers tab, click the default server. Authorization Servers tab with the default server

Step 3: Change the Issuer URL from Dynamic to Okta URL

  1. Go to Security > API > Authorization Servers and click the authorization server that you created in Step 2. Authorization Servers list with the new server
  2. The Issuer shows as Dynamic by default. Change it to the Okta URL and save the changes. Server settings with the Issuer set to the Okta URL

Step 4: Create a Default Scope

  1. Go to Security > API and click the authorization server. Authorization Servers list with the server to open
  2. Click the Scopes tab.
  3. Click Add Scope. Scopes tab with the Add Scope button
  4. Set the scope as a Default Scope. Add Scope dialog with Set as a default scope selected

Step 5: Add a New Access Policy and Rule

  1. Go to Security > API and click the authorization server.
  2. Click the Access Policies tab.
  3. Click Add New Access Policy. Access Policies tab with the Add New Access Policy button
  4. Enter a Name and Description.
  5. Assign the policy to the required clients. Add Policy form with the clients assigned
  6. Add a Rule inside the policy. A rule needs only a few grant type details, such as Client Credentials, Authorization Code, Device Authorization, and Token Exchange.
  7. Click Create Rule. Add Rule form with the grant types

Step 6: Find the Credentials

  1. Go to Applications > Applications.
  2. Click your application in the list. Applications list with your application
  3. Find your Client ID and Okta domain. Client authentication is enabled by default.
  4. In the General Settings section, click Edit.
  5. Clear the User consent option and save the changes. General Settings with the User consent option cleared
  6. Click the Sign On tab.
  7. For OpenID Connect ID Token, click Edit.
  8. For Issuer, change the Dynamic (based on request domain) option to the Okta URL option. The Audience is the same as the Client ID. Sign On tab with the Edit button for the OpenID Connect ID Token
After the applying these steps, you can update the configuration of your deployment:

Docker

Configure Okta SSO for Docker deployment.

Kubernetes

Configure Okta SSO for Kubernetes deployment.

Bare Metal

Configure Okta SSO for Bare Metal deployment.

OKTA

Go to okta Configuration