> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Security OAuth 2.0 connector profile – StackOne setup guide

> Set up a connector profile using OAuth 2.0 for Google Cloud Security in StackOne to allow users to link their accounts.

> [!WARNING]
>
> Security Admin or Organization Admin privileges in Google Cloud are required to complete this setup.

Select Actions to adjust the guideSome actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.

Select all
Clear

ActionScope(s)

Loading actions...No actions match your search.

Dynamic Guide URL

Copy URL

Scopes Selected

<pre role="textbox" aria-readonly="true" tabIndex="0" />

Separator

Copy scopes

## Create or select a Google Cloud project

To use the IAM and Security APIs with OAuth 2.0, you need a Google Cloud project.

**1. Sign in to Google Cloud**

Sign in to your [Google Cloud Console](https://console.cloud.google.com/).

**2. Create or select a project**

Select an existing project from the dropdown at the top of the page, or create a new one by clicking **New Project** and filling in the **Project name**, **Organization**, and **Parent resource** fields, then clicking **Create**.

## Enable the required APIs

Navigate to **APIs & Services** > **Library**, search for each API below, click on it, then click **Enable**. If it already shows **Manage**, the API is already enabled.

<ul>
  <li>Identity and Access Management (IAM) API</li>
  <li>IAM Service Account Credentials API</li>
  <li>Secret Manager API</li>
  <li>Cloud Resource Manager API</li>
</ul>

## Configure Google Auth Platform

Before creating OAuth credentials, ensure Google Auth Platform is configured.

**1. Navigate to Google Auth Platform**

In the Google Cloud Console, go to **APIs & Services** > **OAuth consent screen**. This will open the Google Auth Platform dashboard.

**2. Start configuration**

If you have already configured Auth Platform (the OAuth Overview page with usage metrics is shown), skip this step and navigate to the **Branding** page from the sidebar. Otherwise, you will see a **Get started** button — click it to begin the configuration process.

**3. Enter app information**

Fill in the required fields for your application.

<ul>
  <li>**App name**: Enter a name for your application (e.g., StackOne GCP IAM & Security Integration).</li>
  <li>**User support email**: Select an email for user inquiries.</li>
  <li>Click **Next** to continue.</li>
</ul>

**4. Select audience**

Choose the appropriate user type for your application.

<ul>
  <li>**Internal**: Only users within your Google Workspace organization can authorize (no app verification required).</li>
  <li>**External**: Any Google account can authorize (requires app verification for production use).</li>
  <li>Click **Next** to continue.</li>
</ul>

**5. Enter contact information**

Provide email addresses for Google to notify you about any changes to your project. Click **Next** to continue.

**6. Finish configuration**

Review your settings, agree to the Google API Services User Data Policy, and click **Create** to complete the setup.

## Configure scopes

In Google Auth Platform, go to **Data Access** and click **Add or Remove Scopes** to configure the OAuth scopes your application needs.

**1. Add scopes**

Enables actions: Access Secret Version, Add Secret Version, Create Folder, Create Project, Create Project Role, Create Secret, Create Service Account, Create Service Account Key, Delete Folder, Delete Project, Delete Project Role, Delete Secret, Delete Service Account, Delete Service Account Key, Destroy Secret Version, Disable Secret Version, Disable Service Account, Disable Service Account Key, Enable Secret Version, Enable Service Account, Enable Service Account Key, Get Folder, Get Organization, Get Project, Get Project IAM Policy, Get Role, Get Secret, Get Secret IAM Policy, Get Secret Version, Get Service Account, Get Service Account Key, Get Tag Key, Get Tag Value, List Folders, List Predefined Roles, List Project Roles, List Projects, List Secret Versions, List Secrets, List Service Account Keys, List Service Accounts, List Tag Keys, List Tag Values, Search Folders, Search Organizations, Search Projects, Set Project IAM Policy, Set Secret IAM Policy, Test Project IAM Permissions, Undelete Project Role, Undelete Service Account, Update Folder, Update Project, Update Project Role, Update Secret, Update Service Account

Add the required Google Cloud Platform scopes for your integration.

<ul>
  <li>
    [https://www.googleapis.com/auth/cloud-platform](https://www.googleapis.com/auth/cloud-platform)
  </li>

  <li>
    [https://www.googleapis.com/auth/cloud-platform.read-only](https://www.googleapis.com/auth/cloud-platform.read-only)
  </li>
</ul>

**2. Select scopes from the list**

In the **Update selected scopes** side panel that opens, check the required scopes from the list.

**3. Manually add scopes (if needed)**

If a required scope is not shown in the list, use the **Manually add scopes** section.

<ul>
  <li>Enter the full scope URL in the input field.</li>
  <li>Click **Add to table**.</li>
</ul>

**4. Apply and save**

Confirm and persist your scope configuration.

<ul>
  <li>Click **Update** to apply the selected scopes. The side panel will close.</li>
  <li>On the **Data Access** page, click **Save** to persist the scope configuration.</li>
</ul>

## Create OAuth 2.0 client credentials

Set up OAuth client credentials to authenticate with the GCP IAM and Security APIs. If you already have an existing OAuth 2.0 client, you can reuse it by adding the StackOne redirect URI and generating a new secret.

**1. Navigate to Credentials**

In the Google Cloud Console, go to **APIs & Services** > **Credentials**.

**2. Option A — Create a new OAuth client**

Skip this step if you are using an existing client.

<ul>
  <li>Click **+ Create Credentials** and select **OAuth client ID**.</li>
  <li>Select **Web application** as the application type.</li>
  <li>Enter a **Name** for your OAuth client (e.g., StackOne Cloud Security Integration).</li>
  <li>Under **Authorized redirect URIs**, click **Add URI** and enter the **Callback URL** from your Connector Profile.</li>
  <li>Click **Create**. A dialog will display your **Client ID** and **Client Secret** — copy and store them securely.</li>
</ul>

**3. Option B — Use an existing OAuth client**

Skip this step if you created a new client above.

<ul>
  <li>Click on your existing OAuth 2.0 client ID from the list.</li>
  <li>Under **Authorized redirect URIs**, click **Add URI**, enter the **Callback URL** from your Connector Profile, and click **Save**.</li>
  <li>Under **Client secrets**, click **+ Add secret** to generate a new secret. Copy it and store it securely — it will not be shown again.</li>
  <li>Your **Client ID** is shown on the same page under **Additional information**.</li>
</ul>

## Google Cloud session control and token expiry

Google Workspace administrators can enforce a **Google Cloud session control** window of 1 to 24 hours that applies to Google Cloud OAuth scopes. While it is enforced, the refresh token for this connection stops working once the window elapses, and the connected account keeps failing until a user re-authenticates interactively.

<ul>
  <li>**Symptom** — the connected account periodically fails with a `refresh token expired` error even though the credentials and the OAuth client are unchanged.</li>
  <li>**Cause** — Google Cloud session control requires interactive re-authentication for Google Cloud scopes. Google scopes outside Google Cloud (for example Sheets, Drive or Directory) are not affected.</li>
  <li>**Fix** — in the Google Admin console, go to **Security** > **Access and data control** > **Google Cloud session control** and select **Session never expires**, or add this OAuth app to the trusted (exempted) apps list. Without one of these, periodic re-linking of the account is expected.</li>
</ul>

## Create the StackOne Connector Profile

**1. Create a Connector Profile**

Enable the connector and create a Connector Profile in your project. See [Setup Connector Profile](https://docs.stackone.com/gateway/quickstart.md#setup-connector-profile).

**2. Link an Account**

Once the Connector Profile is created, continue to [link an account](https://docs.stackone.com/connectors/googlecloudsecurity/guides/link-account/oauth-2-0.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.