Setting up an authorization code application
Step 1. Authorization Code Setup
Creating an authorization code app
Log in to the Criteo Partners Portal and create a new app by clicking the ➕ button in theMy apps section.

Create app
App details
- Provide your app name and description. Optionally, add an image to identify your application.
- On your app page, you can define the scope of your application and OAuth parameters. For more details, please refer to our onboarding checklist.

Authentication method
- Choose your app’s authentication method. You can select between Client Credentials or Authorization Code. Use the guide above to determine which option best suits your organization.

App activation
Service
- Choose the Criteo service for your API application. Select C-Growth for marketing solutions or C-Max for retail media.

Authorizations
Domains
- Choose the domains that define the permission access your application needs.

Activate app to activate the application.
Redirect URI
- For applications using the authorization code workflow, you need to specify a Redirect URI as part of your app scope.

Step 2. Set Up Your OAuth Parameters
After defining your application’s scope, set up the necessary parameters for the authorization code workflow.
You can now publish the app and initiate the authorization code workflow.
Consent URL Creation
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, using the following structure:
Authorization Code v. Client Credentials Consent URLsIf 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.- The consent link directs users to the
Criteo Consent page, where they can select which advertisers to grant access to and approve the request.

The Criteo Consent page allows selecting the advertisers to grand access to
NotesA consent request will not be displayed if:
- The
client_iddoes not match a published API app. - The
redirect_uriis unauthorized. - There is an unexpected backend error.
Redirection and Access Code
Upon completing the Consent Delegation, users are redirected to a URL similar to the example below:redirect_uri and the following query parameters:
If consent is denied, the redirect will include an
error query parameter instead of a code.
Step 3. Exchanging Access Code For Access Token
With an authorization code, you can request an access token via aPOST request:
Example
The response from Criteo API will be the following:
Using the refresh token
To renew an access token, use the following request:
The response will be the same as when issuing an access token
Demo
Below is a demo application code (index.js) in NodeJS using the Express JS framework:Run the demo
- Run
npm install, - Connect to the developer portal and create an app.
- Create an “Authorization code” app.
- Generate app credentials and enter the
client_idandclient_secretinindex.js. - Register “http://localhost:3000/criteo-auth/callback” as the redirect URI.
- Run
npm run start, - Open http://localhost:3000.
What’s Next