Prerequisites
- Create a service account for the workload in Nebius AI Cloud.
-
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.
- Create or select an existing Google Cloud project.
- Install and initialize the Google Cloud CLI and configure it to use the target Google Cloud project.
-
Install jq to extract token values from JSON responses:
- 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.
- Create a Google Cloud resource to test access to. This guide uses a Cloud Storage bucket.
Configure Google Cloud trust
-
Set variables for the Google Cloud configuration:
-
Create a Cloud Storage bucket and test object:
-
Create a Google Cloud workload identity pool:
-
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
-
In the Nebius workload, get a Nebius IAM
access_token. For details, see How to authenticate as a service account. -
Export the access token and target audience:
-
Exchange the Nebius
access_tokenfor a Nebiusid_token:
Exchange the Nebius ID token for a Google access token
Exchange the Nebiusid_token by using the Google STS token endpoint:
Verify the result
-
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:
-
Grant the federated principal access to the bucket:
Replace
<nebius_subject>with thesubclaim value from the Nebiusid_token. -
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 thesubject_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 useshttps://sts.nebius.com as the issuer URI, and that the Google STS audience value is the full provider resource name: