<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
How to Retrieve a Refresh Token and What Are the Supported Authentication Flows
API Access Management
Okta Classic Engine
Okta Identity Engine
Overview

This article explains how to retrieve a refresh token and what authentication flows are supported.

Applies To
Cause

The authentication flows available for obtaining a refresh token:

The OIDC application settings required from Okta Admin Dashboard > Applications > (select the OIDC client) > General Settings > Grant type.

  • The refresh token grant type must be enabled.

Refresh Token Grant Type

Solution
  1. How to retrieve the refresh token using Authorization Code flow:

Example:

https://{yourOktaDomain}/oauth2/v1/authorize?
   client_id=0oabucvyc38HLL1ef0h7&
   response_type=code&scope=openid offline_access&
   redirect_uri=https%3A%2F%2Fexample.com&
   state=state-296bc9a0-a2a2-4a57-be1a-d0e2fd9bb601

In this case, the next step of the flow is the /token call. (grant_type: authorization_code)

The response returned from the /token request will contain the id_token, access_token, and refresh_token.

 

  1. How to retrieve the refresh token using Resource Owner Password:
    • The offline_access scope must be included in the /token request.

Example:

curl --location 'https://{yourOktaDomain}/oauth2/v1/token' \
--header 'Accept: application/json' \
--header 'Authorization: Basic MG9hYn...' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=testuser@example.com' \
--data-urlencode 'password=%7CmCovrlnU9oZU4qWGrhQSM' \
--data-urlencode 'scope=openid offline_access'

In this case, the /token call is the only step of the flow, and the response will contain the id_token, access_token, and refresh_token.

 

Related References

Loading
How to Retrieve a Refresh Token and What Are the Supported Authentication Flows