Skip to content

Commit d2f19a5

Browse files
Adds offline_access scope to support refresh tokens (#313)
OKTA-801628 Add offline_access scope to support refresh tokens
1 parent a31f3fb commit d2f19a5

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

custom-login/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ This example is built with [Create React App][].
99
Before running this sample, you will need the following:
1010

1111
* An Okta Developer Account, you can sign up for one at https://developer.okta.com/signup/.
12-
* An Okta Application, configured for Single-Page App (SPA) mode. This is done from the Okta Developer Console, you can see the [OIDC SPA Setup Instructions][]. When following the wizard, use the default properties. They are are designed to work with our sample applications.
12+
* An Okta Application, configured for Single-Page App (SPA) mode. This is done from the Okta Developer Console, you can see the [OIDC SPA Setup Instructions][]. When following the wizard, use the default properties. They are designed to work with our sample applications.
13+
14+
## Enable Refresh Tokens
15+
16+
Add a required setting to your SPA Okta app to avoid third-party cookies. Navigate to **Applications** > **Applications** and select this application to edit. Find the **General Settings** and press **Edit**. Enable **Refresh Token** in the **Grant type** section. **Save** your changes.
1317

1418
## Running This Example
1519

custom-login/src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
clientId: CLIENT_ID,
2424
issuer: ISSUER,
2525
redirectUri: REDIRECT_URI,
26-
scopes: ['openid', 'profile', 'email'],
26+
scopes: ['openid', 'profile', 'email', 'offline_access'],
2727
pkce: true,
2828
disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK,
2929
useInteractionCode: USE_INTERACTION_CODE,

okta-hosted-login/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ This example is built with [Create React App][].
99
Before running this sample, you will need the following:
1010

1111
* An Okta Developer Account, you can sign up for one at https://developer.okta.com/signup/.
12-
* An Okta Application, configured for Single-Page App (SPA) mode. This is done from the Okta Developer Console, you can see the [OIDC SPA Setup Instructions][]. When following the wizard, use the default properties. They are are designed to work with our sample applications.
12+
* An Okta Application, configured for Single-Page App (SPA) mode. This is done from the Okta Developer Console, you can see the [OIDC SPA Setup Instructions][]. When following the wizard, use the default properties. They are designed to work with our sample applications.
13+
14+
## Enable Refresh Tokens
15+
16+
Add a required setting to your SPA Okta app to avoid third-party cookies. Navigate to **Applications** > **Applications** and select this application to edit. Find the **General Settings** and press **Edit**. Enable **Refresh Token** in the **Grant type** section. **Save** your changes.
1317

1418
## Running This Example
1519

okta-hosted-login/src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
clientId: CLIENT_ID,
2323
issuer: ISSUER,
2424
redirectUri: REDIRECT_URI,
25-
scopes: ['openid', 'profile', 'email'],
25+
scopes: ['openid', 'profile', 'email', 'offline_access'],
2626
pkce: true,
2727
disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK,
2828
},

0 commit comments

Comments
 (0)