Skip to main content
This guide explains how to configure access to Google Cloud resources for Nebius workloads using OpenID Connect (OIDC) ID tokens. The setup is based on Google Cloud Workload Identity Federation. For details on how trust works from the Nebius side, see Nebius workloads access to external resources overview.

Prerequisites

  1. Create a service account for the workload in Nebius AI Cloud.
  2. Configure the workload to authenticate as this service account:
    • For a virtual machine (VM), attach the service account to the VM and retrieve an IAM token from the instance metadata service.
    • If you cannot use the metadata service, create an authorized key for the service account or provide an IAM token to the workload by using your approved secret delivery method.
    Do not put service account authorized keys into container images, startup scripts, source code or logs.
  3. Create or select an existing Google Cloud project.
  4. Install and initialize the Google Cloud CLI and configure it to use the target Google Cloud project.
  5. Install jq to extract token values from JSON responses:
  6. Make sure that you can create a Google Cloud workload identity federation (WIF) pool and OIDC provider and grant IAM access to the target resource in that project.
  7. Create a Google Cloud resource to test access to. This guide uses a Cloud Storage bucket.

Configure Google Cloud trust

  1. Set variables for the Google Cloud configuration:
  2. Create a Cloud Storage bucket and test object:
  3. Create a Google Cloud workload identity pool:
  4. Register Nebius Security Token Service (STS) as an OIDC identity provider:
    Google Cloud will use Nebius OIDC discovery to resolve Nebius STS metadata and signing keys.

Exchange a Nebius access token for a Nebius ID token

  1. In the Nebius workload, get a Nebius IAM access_token. For details, see How to authenticate as a service account.
  2. Export the access token and target audience:
  3. Exchange the Nebius access_token for a Nebius id_token:

Exchange the Nebius ID token for a Google access token

Exchange the Nebius id_token by using the Google STS token endpoint:

Verify the result

  1. Try to read the test object:
    If the Google Cloud principal does not have access to the bucket yet, Google Cloud returns an error similar to this:
  2. Grant the federated principal access to the bucket:
    Replace <nebius_subject> with the sub claim value from the Nebius id_token.
  3. Read the object again:
    The result must be:

Troubleshooting

The workload cannot get a Nebius access token

Make sure that the workload has a Nebius service account attached or that the service account authorized key or IAM token is available inside the workload. For Compute VMs, see Getting service account information.

The Nebius token exchange fails

Check that the subject_token value contains a valid Nebius IAM access_token, and that audience is the target system audience that will validate the resulting id_token.

The Google token exchange fails

Check that the Google Cloud workload identity provider uses https://sts.nebius.com as the issuer URI, and that the Google STS audience value is the full provider resource name:

The Google access token cannot read the resource

Check the Google Cloud IAM policy on the target resource. A successful token exchange only proves that Google Cloud trusts the Nebius identity assertion. It does not grant access to resources unless the federated principal has the required Google Cloud IAM role.