# Generate credentials

Requests to the Bid Manager API must use [OAuth 2.0](https://developers.google.com/identity/protocols/oauth2) for authentication.
This page explains how to generate the OAuth 2.0 credentials and use them to
authenticate your users.

## Choose a project

OAuth 2.0 credentials are generated by a Google Cloud project. You need
to [create or select a project in the Google Cloud console and enable the
API](https://console.cloud.google.com/start/api?id=doubleclickbidmanager.googleapis.com&credential=client_key).

You can create a new project, or use an existing one.

### Create a new project

To create a project and activate the Bid Manager API, follow the steps in the
[Google Cloud console](https://console.cloud.google.com/start/api?id=doubleclickbidmanager.googleapis.com&credential=client_key).

### Use an existing project

To activate the Bid Manager API for an existing project, complete the following
steps:

1. [Open the API Library](https://console.cloud.google.com/apis/library) in the Google Cloud console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity. The Bid Manager API is labeled **DoubleClick Bid Manager API**.
2. If you don't see the API you want to activate in the list, use the search bar to find it.
3. Select the API you want to activate, then click **Enable**.
4. If prompted, activate billing.
5. If prompted, accept the Terms of Service for the API.

## Generate credentials

This section explains how to generate an OAuth 2.0 client ID to authenticate
your Bid Manager API requests, after you've [chosen a project](https://developers.google.com/bid-manager/guides/get-started/generate-credentials#choose_a_project).

To create an OAuth 2.0 client ID to use with the [installed application
flow](https://developers.google.com/identity/protocols/OAuth2InstalledApp), complete the following steps:

1. Configure a [Google Cloud console project](https://developers.google.com/bid-manager/guides/get-started/generate-credentials#choose_a_project).
2. Open the **Credentials** page in the Google Cloud console.
3. Click **Create Credentials** \> **OAuth client ID**.
4. Select an appropriate application type when prompted. The Java and Python code snippets in the Bid Manager API developer guides are for a **Desktop app** . The PHP code snippets are for a **Web application**.
5. Enter any additional required information. If this is your first time creating a client ID, you can configure your consent screen by clicking **Configure consent screen**. You won't get a prompt to configure your consent screen again after you do it the first time, but you can update this information at any time.
6. Click **Create**.

When you're done, you get an OAuth 2.0 client ID and client secret, which you
can download in JSON format and save for later use.

> [!WARNING]
> **Warning:** OAuth credentials are sensitive information. You should download them directly from the Google Cloud console, and shouldn't share them.

## Configure the user consent screen

When you use OAuth 2.0 for authentication, your users are authenticated after
they agree to terms on a user consent screen.

To set up your project's consent screen, complete the following steps:

1. Open the [OAuth consent screen page](https://console.cloud.google.com/apis/credentials/consent) in the Google Cloud console. If prompted, [select a project or create a new one](https://developers.google.com/bid-manager/guides/get-started/generate-credentials#choose_a_project).
2. Fill out the form, then click **Save**.