Okta Fails to Return a Refresh Token From the Authorization Server
Last Updated:
Overview
Okta fails to return a refresh token from the authorization server when the OpenID Connect (OIDC) application lacks the required grant type configuration. An API call to obtain a refresh token from the Okta authorization server or a custom authorization server using the Authorization Code, Authorization Code w/ PKCE, or Resource Owner Password flow does not return a refresh token. This failure occurs even when the request includes the offline_access scope. Resolve this issue by enabling the refresh token grant type in the application settings.
Example /token request:
POST https://{OktaDomain}.okta.com/oauth2/v1/token
grant_type=password
&username=user%40example.com
&password=a.gReAt.pasSword
&scope=openid%20offline_accessApplies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- OAuth 2.0
- OpenID Connect (OIDC)
Cause
The /token request may be formed correctly, but if the OIDC application does not have the refresh token grant type enabled, Okta will return an error.
Solution
How to enable the refresh token grant type?
Enable the refresh token grant type by navigating to the OIDC application in the Admin Console and selecting the appropriate setting on the general tab.
- Navigate to the OIDC application in the Admin Console.
- Choose the General tab.
- Locate Grant type in the General settings section.
- Select Refresh Token.
Verify the refresh token grant type selection in the application settings.
