A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/ below:

Implement authorization by grant type

Before you can implement authorization, you need to register your app in Okta by creating an app integration from the Admin Console.

The following sections outline the main requests required to implement the Authorization Code flow using direct calls to the OIDC & OAuth 2.0 API (opens new window). Typically, you don't need to make direct calls if you're using one of the Okta SDKs.

Request an authorization code

To get an authorization code, your app redirects the user to your authorization server's /authorize endpoint. If you're using the org authorization server, then your request URL would look something like this:

Note the parameters that are being passed:

See the OAuth 2.0 API reference (opens new window) for more information on these parameters.

If the user doesn't have an existing session, this request opens the Okta sign-in page. If they have an existing session, or after they authenticate, they arrive at the specified redirect_uri along with a code. For example:

This code remains valid for 300 seconds, during which it can be exchanged for tokens.

Exchange the code for tokens

To exchange this code for access and ID tokens, you pass it to your authorization server's /token endpoint. If you’re using the org authorization server, then your request would look something like this:

Important: The call to the /token endpoint requires authentication. In this case, it's Basic Authentication with the client ID and secret Base64-encoded. You can find the client ID and secret on your app integration's General tab. This requirement is why this call is only appropriate for applications that can guarantee the confidentiality of the client secret. See Client Authentication Methods (opens new window).

Note the parameters that are being passed:

See the OAuth 2.0 API reference (opens new window) for more information on these parameters.

If the code is still valid, your application receives back access and ID tokens:

Validate access token

When your application passes a request with an access_token, the resource server needs to validate it. See Validate access tokens.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4