GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Users can't specify non-default scopes for code running on GKE Workload Identity (and possibly AppEngine flex) · Issue #458 · googleapis/google-auth-library-java

This repository was archived by the owner on May 12, 2026. It is now read-only.
This repository was archived by the owner on May 12, 2026. It is now read-only.

Users can't specify non-default scopes for code running on GKE Workload Identity (and possibly AppEngine flex) #458

Copy link
Copy link
Closed
#514
Closed
Users can't specify non-default scopes for code running on GKE Workload Identity (and possibly AppEngine flex)#458
#514
Copy link
Assignees
arithmetic1728
Labels
featurefixpriority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.semver: minorA new feature was added. No breaking changes.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@ahmedtd
ahmedtd
opened on Aug 8, 2020
Issue body actions

The ComputeEngineCredentials class is used for pulling access and identity tokens when the library is running on GCE, GKE Workload Identity, and AppEngine flex. It doesn't support setting scopes on the resulting access token, because on GCE scopes are handled by assigning them to the VM.

However, this isn't the case on GKE Workload Identity (and possibly AppEngine flex, I am still confirming this). In this environment, there is no concept of a scope lock or default scopes for the access token. Instead the metadata server accepts a ?scopes query parameter on the /computeMetadata/v1/instance/service-accounts/default/token request and creates an access token with the requested scopes.

If no ?scopes are specified, then the returned access tokens has a hardcoded default set of scopes (cloud-platform and userInfo.email).

This means that users of ComputeEngineCredentials don't have a way to use non-cloud Google APIs when running on GKE Workload Identity, since non-cloud APIs are not included in the cloud-platform access scope.

The GCE Metadata Server accepts the ?scopes parameter without complaint, but ignores it.

I'd like to extend the ComputeEngineCredentials class with a createScoped implementation that will make a new ComputeEngineCredentials instance that passes the ?scopes query parameter, so that code like this will work when running on GKE Workload Identity:

GoogleCredentials.getApplicationDefault().createScoped("https://www.googleapis.com/auth/androidpublisher");

Activity

  1. yoshi-automation
    added
    triage meI really want to be triaged.
    on Aug 8, 2020
  2. elharo
    added
    feature
    fix
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    semver: minorA new feature was added. No breaking changes.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    triage meI really want to be triaged.
    on Aug 10, 2020
  3. elharo
    assigned
    silvolu
    on Oct 21, 2020
  4. arithmetic1728
    assigned
    arithmetic1728
    and unassigned
    silvolu
    on Dec 9, 2020
  5. arithmetic1728
    closed this as completedin #514on Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @arithmetic1728
    arithmetic1728

Labels

featurefixpriority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.semver: minorA new feature was added. No breaking changes.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.