PKCE Overview
Proof Key for Code Exchange (PKCE) is an extension of the OAuth 2.0 Authorization Code flow that enhances security for public or mobile clients that cannot safely store a client secret. It adds a verification step between the authorization request and token exchange to prevent intercepted authorization codes from being reused by malicious actors. You should use PKCE if your application is a mobile app, single-page app (SPA), or any client that cannot securely store a client secret. If your application is a traditional server-side (confidential) client, you can continue using the standard Authorization Code flow.PKCE in the App details page.
Step 1. Consent URL
Once your app parameters are set, you can implement the authorization code flow.Consent URL
To request access, create a Consent link that redirects the user.Authorization Code vs. Client Credentials Consent URLs
If you’re familiar with the Client Credentials workflow, you might notice that the Generate Consent URL button is not present in the partner portal for the authorization code workflow. This is because, with the authorization code method, you need to provide a redirect URI specific to your organization. Therefore, these URLs must be configured directly within your workflow.Parameter | Required | Description |
|---|---|---|
| Yes | Indicates that an authorization code is expected as outcome. |
| Yes | Your public key from the app credentials section. |
| Yes | The URL to redirect the user after consent. Must match the configured URI. |
| No | Optional string to prevent Cross-Site Request Forgery attacks. |
| Yes when PKCE is enabled | A challenge derived from the |
| No | The method used to derive
|
Step 2. Exchanging the Authorization Code for an Access Token
code_verifier. The client_secret is optional — the code_verifier authenticates the request in its place. If you do send a client_secret, it must be valid.
Example Request
Example Response (Success)
Parameters
Parameter | Required | Description |
|---|---|---|
| Yes | Indicates that you are providing an authorization code. |
| Yes | Authorization code returned during redirection. |
| Yes | Must match the |
| Yes | Your public key from the app credentials. |
| No | Your secret key. Optional for PKCE applications — the |
| Yes | A high-entropy random string created by the client (usually 43–128 characters). |
Step 3. Using the Refresh Token
PKCE refresh tokens are short-lived and the session has a hard cap. The table below summarizes the differences from a standard app.invalid_grant and the user must re-authorize through the full authorization code and PKCE flow. Always store the latest refresh token — previous ones are invalidated on each refresh.
Example Request
Parameters
Parameter | Required | Description |
|---|---|---|
| Yes | Indicates that you are providing a refresh token. |
| Yes | The refresh token returned when issuing the access token. Always use the most recently issued one. |
| Yes | Your public key from the app credentials section. Must match the client the token was issued to. |
| No | Optional for PKCE applications. If provided, it must be valid. Required for confidential (non-PKCE) clients. |