Authorization Code Flow — Web

OAuth 2.0 / OpenID Connect Authentication for Web Applications

Configuration
Authentication
1
CLIENT APP

User Authentication (SSO)

Redirect the user to Okta for authentication/authorization. After successful authentication, Okta returns an authorization code which is exchanged for tokens.

Use Existing
Configuration
/oauth2/v1/
Configure Okta Domain and Auth Server to load scopes
code token id_token
cURL Commands
1. Direct user to authorize endpoint for standard OAuth flow:

          
2. Exchange authorization code for tokens:

          
        
view log

Optional APIs

Use the endpoints below to inspect, revoke, or end sessions for the tokens obtained above.

Call the /userinfo endpoint with the access token to retrieve the authenticated user's profile claims. API Reference ↗

cURL Command

              
            

Call the /introspect endpoint to inspect the token and verify its active status, scopes, and metadata. API Reference ↗

cURL Command

              
            

Call the /revoke endpoint to revoke an access or refresh token, rendering it unusable. API Reference ↗

cURL Command

              
            

Exchange a refresh token for new access and ID tokens using the /token endpoint with grant_type=refresh_token. Docs ↗

cURL Command

              
            

End the user's Okta session using RP-Initiated Logout. Will open in a new browser window. API Reference ↗

Auto from Step 1
cURL Command

              
            

App Management APIs

Use the Okta Management API to view and update the application. Requires management scopes (e.g. okta.apps.read, okta.apps.manage).

Call GET /api/v1/apps/{appId} with the access token to retrieve the application object from Okta. API Reference ↗

cURL Command

              
            

Call PUT /api/v1/apps/{appId} to update the application. Use "Load Current" to fetch the current app JSON, edit it, then send the update. API Reference ↗

cURL Command