Skip to main content
The steps in this guide require Admin or Owner privileges within Google Cloud.

Create or select a Google Cloud project

To use the Cloud Text-to-Speech API with OAuth 2.0, you need a Google Cloud project.

1

Sign in to Google Cloud

Sign in to your Google Cloud Console.

Google Cloud Console Sign In
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.

Google Cloud Console Select a resource dialog

Enable the Cloud Text-to-Speech API

Enable the Cloud Text-to-Speech API for your project. This step is required whether you created a new project or selected an existing one. Billing must be enabled on the project before the API can be activated.

Google Cloud Console Enable Cloud Text-to-Speech API
1

Open the API Library

In the Google Cloud Console, navigate to APIs & Services > Library.

2

Enable Cloud Text-to-Speech API

Search for “Cloud Text-to-Speech API” and click on it.

  • New project: Click Enable to activate the API.
  • Existing project: If the API is already enabled, the page shows API Enabled and the button shows Manage. If it shows Enable, click it to enable the API.
  • Billing required: If the project has no billing account, clicking Enable opens a Billing required dialog stating “Cloud Text-to-Speech API requires a project with a billing account.” Click Enable billing and link an existing billing account to the project, or set up a new billing account if you don’t have one. Then return to the API page and click Enable. A billing account with administrator access is required.
Billing required dialog with the Enable billing button highlighted

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 overview page.

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.

  • App name: Enter a name for your application (e.g., StackOne Integration).
  • User support email: Select an email address for user inquiries.
  • Click Next to continue.
  • Note: If you already have an existing OAuth consent screen configuration, you can edit the details in this and the following steps.
Enter branding information
4

Select audience

Choose the appropriate user type, or go to the Audience page from the left sidebar to select the user type.

  • Internal: Only users within your Google Workspace organization can authorize (no app verification required). Refresh tokens do not expire after 7 days when the user type is Internal, even if the app remains in Testing status.
  • External: Any Google account can authorize (requires app verification for production use). Note: While the app is in Testing status, refresh tokens expire after 7 days. You must publish the app to Production for long-lived tokens.
Select audience
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.

Select scopes
1

Add scopes

Enables actions: Cancel Operation, Delete Operation, Get Operation, List Operations, List Voices, Synthesize Long Audio, Synthesize Speech

Add the required Cloud Text-to-Speech scope for your integration. If the Scopes field in the StackOne Connector profile is left empty, this scope is requested by default.

2

Select scopes from the list

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

Select scopes from side panel
3

Manually add scopes (if needed)

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

  • Enter the full scope URL in the input field.
  • Click Add to table.
Manually add scopes
4

Apply and save

Confirm and save your scope configuration.

  • Click Update to apply the selected scopes. The side panel will close.
  • On the Data Access page, click Save to save the scope configuration.

Create OAuth 2.0 client credentials

Set up OAuth client credentials to authenticate with the Cloud Text-to-Speech API. 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.

Create OAuth 2.0 navigation
1

Navigate to Credentials

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

Create OAuth 2.0 form
2

Option A — Create a new OAuth client

Skip this step if you are using an existing client.

  • Click + Create credentials and select OAuth client ID.
  • Select Web application as the application type.
  • Enter a Name for your OAuth client (e.g., StackOne Integration).
  • Under Authorized redirect URIs, click Add URI and enter the Callback URL from your Connector Profile.
  • Click Create. A dialog will display your Client ID and Client secret — paste them into the Client ID and Client Secret fields in the StackOne Connector profile and store them securely. The client secret is only displayed once, so click Download JSON to keep a copy.
Create a new OAuth client
3

Option B — Use an existing OAuth client

Skip this step if you created a new client above.

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

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.

  • Symptom — the connected account periodically fails with a refresh token expired error even though the credentials and the OAuth client are unchanged.
  • 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.
  • 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.

Creating the StackOne Connector Profile

To create the Connector Profile in StackOne for Google Text-to-Speech:
1

Open the connector

Log in to StackOne, open Connectors, and select Google Text-to-Speech.
2

Choose actions and events

  • Click Add Profile.
  • If the connector offers more than one authentication method, set the Auth Method filter to OAuth 2.0.
  • Select the actions, and any events, to enable for this Connector Profile.
  • Click Continue.
3

Set up authentication

  • Select Authentication Type as OAuth 2.0.
  • Fill out the fields using details retrieved from your provider:
    • Client ID
    • Client Secret
    • Scopes (Optional)
  • Click Create Profile.
Congratulations! The new Connector Profile now shows up on the connector page. If you created it as a project member rather than an admin, it starts disabled until a project admin enables it. You can now continue to Link Accounts for Google Text-to-Speech.