Auth Code Flow
Step 1: Configure the App
- On the Create a new app integration page, select OIDC - OpenID Connect.
- For Application type, select Web Application.
-
Click Next.

- On the General Settings page, enter an App integration name.
-
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.
-
Enter the Sign-in redirect URIs:
http://localhost:8585/callbackhttp://localhost:8585/silent-callback
- Enter the Sign-out redirect URIs.
- Enter the Base URIs.
- Select the required option for Controlled access.
-
Click Save.
The app is now configured.


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
-
In the left navigation panel, click Security > API.

-
On the Authorization Servers tab, click Add Authorization Server.

- Enter a Name and Description.
- Enter an Audience for the server. The Audience is the Client ID of the application that you created in Step 1.
-
Click Save. Okta generates the Issuer URL.

Default Authorization Server (Not Recommended)
-
In the left navigation panel, click Security > API.

-
On the Authorization Servers tab, click the default server.

Step 3: Change the Issuer URL from Dynamic to Okta URL
-
Go to Security > API > Authorization Servers and click the authorization server that you created in Step 2.

-
The Issuer shows as Dynamic by default. Change it to the Okta URL and save the changes.

Step 4: Create a Default Scope
-
Go to Security > API and click the authorization server.

- Click the Scopes tab.
-
Click Add Scope.

-
Set the scope as a Default Scope.

This flow uses the Refresh Token grant type, so include the
offline_access scope among the requested scopes. Okta requires offline_access to issue refresh tokens under the Authorization Code flow.Step 5: Add a New Access Policy and Rule
- Go to Security > API and click the authorization server.
- Click the Access Policies tab.
-
Click Add New Access Policy.

- Enter a Name and Description.
-
Assign the policy to the required clients.

- 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.
-
Click Create Rule.

Step 6: Find the Credentials
- Go to Applications > Applications.
-
Click your application in the list.

- Find your Client ID and Okta domain. Client authentication is enabled by default.
- In the General Settings section, click Edit.
-
Clear the User consent option and save the changes.

- Click the Sign On tab.
- For OpenID Connect ID Token, click Edit.
-
For Issuer, change the Dynamic (based on request domain) option to the Okta URL option. The Audience is the same as the Client ID.
