Set up the Navigation Connect

European Economic Area (EEA) developers

This document describes the steps needed to start using the Navigation Connect.

Google Maps Platform products are secured from unauthorized use by requiring API calls to include an OAuth token.

Create an OAuth token

Navigation Connect supports the use of OAuth 2.0 for authentication. Google supports common OAuth 2.0 scenarios such as those for a web server.

This document describes how to pass an OAuth token to the Navigation Connect call in your development environment. For instructions on using OAuth in a production environment, see Authentication methods at Google.

About OAuth

There are many ways to create and manage access tokens with OAuth based on your deployment environment.

For example, the Google OAuth 2.0 system supports server-to-server interactions, such as those between your application and a Google service. For this scenario you need a service account, which is an account that belongs to your application instead of to an individual end user. Your application calls Google APIs on behalf of the service account, so users aren't directly involved. For more information on authentication methods, see Authentication methods at Google.

Alternatively, you might use the Navigation Connect as part of an Android or iOS mobile app. For general information on using OAuth with the Navigation Connect, including information on managing access tokens for different deployment environments, see Using OAuth 2.0 to Access Google APIs.

About OAuth scopes

To use OAuth with the Navigation Connect, the OAuth token must be assigned the scope:

https://www.googleapis.com/auth/cloud-platform

Example: Try REST API calls in your local development environment

If you want to try the Navigation Connect using an OAuth token, but don't have an environment setup to generate tokens, you can use the procedure in this section to make the call.

This example describes how to use the OAuth token provided by Application Default Credentials (ADC) to make the call. For information about using ADC to call Google APIs using client libraries, see Authenticate using client libraries.

Prerequisites

Before you can make a REST request using ADC, use the Google Cloud CLI to provide credentials to ADC:

  1. Install and initialize the gcloud CLI.
  2. Run the following gcloud command on your local machine to create your credential file:

    gcloud auth application-default login
  3. A login screen is displayed. After you log in, your credentials are stored in the local credential file used by ADC.

For more information, see Set up ADC for a local development environment.

Make a REST request

In this example, you pass two request headers:

  • Pass the OAuth token in the Authorization header by using the following command to generate the token:

    gcloud auth application-default print-access-token

    The returned token has a scope of https://www.googleapis.com/auth/cloud-platform.

  • Pass the ID or name of your Google Cloud project that has billing enabled in the X-Goog-User-Project header.

The following example makes a call to the Navigation Connect using an OAuth token.

  1. Edit the PROJECT_ID field to pass the ID of your Google Cloud project.

    Also edit the following, as applicable:

    • ANDROID_APP_ID: The Android package name of your app.
    • IOS_APP_ID: The iOS Bundle ID of your app.
    #!/bin/bash
    
    trip_id="$(uuidgen)"
    access_token="$(gcloud auth application-default print-access-token)"
    
    curl -X POST "https://navigationconnect.googleapis.com/v1/projects/PROJECT_ID/trips?tripId=${trip_id}" \
      -H "Authorization: Bearer ${access_token}" \
      -H "Content-Type: application/json" \
      -d '{
      "androidAppId": "ANDROID_APP_ID",
      "iosAppId": "IOS_APP_ID",
    }'
  2. Click the copy icon in the code sample, Select the copy icon., to copy the curl command.
  3. Paste the command in a terminal window and run the command.

The response is a JSON object:

{
  "name": "projects/PROJECT_NUMBER/trips/TRIP_ID",
  "authToken": {
    "token": "BASE64_ENCODED_TRIP_TOKEN",
    "expireTime": "2026-03-06T11:09:47.476942Z"
  },
  "state": "NEW",
  "execution": {
    "traveledDistanceMeters": 0,
    "stopAddedInRoute": false
  },
  "createTime": "2026-03-05T23:09:50.768959Z",
  "updateTime": "2026-03-05T23:09:50.768959Z",
}

This response includes the following values:

  • PROJECT_NUMBER: The unique long integer identifier for the project.
  • TRIP_ID: The trip ID generated by your backend in UUIDv4 format.
  • BASE64_ENCODED_TRIP_TOKEN: The authenticated token returned by the createTrip method. Pass this token to your mobile app to initiate tracked turn-by-turn navigation in Google Maps or Waze.

Troubleshooting

If your request returns an error message about end-user credentials not being supported by this API, see Troubleshoot your ADC setup.

What's next

The next step for setting up the Navigation Connect API is to set up your service accounts to enable secure, server-to-server communication between your backend infrastructure and Google Maps and Waze.

Set up your service account