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 — Scopes not configured for service account error · Issue #341 · googleapis/google-cloud-java

Scopes not configured for service account error #341

New issue
Copy link
New issue
Copy link
Closed
Closed
Scopes not configured for service account error#341
Copy link
Assignees
aozarov
Labels
🚨 criticalP0 critical issue. Requires immediate fixapi: coreauthtriage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@mziccard
mziccard
opened on Nov 10, 2015
Issue body actions

This error occurs to me when I try to use default credentials created from the GOOGLE_APPLICATION_CREDENTIALS variable. This is the error I get whenever I try to issue a request:

java.io.IOException: Scopes not configured for service account. Scoped should be specifed by calling createScoped or passing scopes to constructor.
    at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:183)
    at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:76)
    at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:53)
    at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:40)
    at com.google.gcloud.ServiceOptions$1.initialize(ServiceOptions.java:510)
    at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
    at com.google.gcloud.spi.DefaultStorageRpc.list(DefaultStorageRpc.java:148)

It seems that to create default credentials based on the env variable we must supply the service scopes. This can be done by changing this line to:

GoogleCredentials.getApplicationDefault().createScoped(scopes);

This would require, however, to change our AuthCredentials.createApplicationDefaults method to accept a set of scopes as a parameter.

Noticeably, scopes are not required to be passed when Google Cloud SDK credentials are used. Is this a desired behavior of the auth library? Should we add this scopes parameter?

Activity

  1. mziccard
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    auth
    api: core
    on Nov 10, 2015
  2. ajkannan commented on Nov 10, 2015

    @ajkannan
    ajkannan
    on Nov 10, 2015
    More actions

    @mziccard I noticed this too yesterday afternoon while doing auth cleanup. I will add scoping for the ApplicationDefaultCredentials in #337.

  3. aozarov commented on Nov 10, 2015

    @aozarov
    aozarov
    on Nov 10, 2015
    Contributor
    More actions

    Fixed by #343

  4. aozarov
    closed this as completedon Nov 10, 2015
  5. yoshi-automation
    added
    🚨 criticalP0 critical issue. Requires immediate fix
    triage meI really want to be triaged.
    on Apr 6, 2020
  6. JustinBeckwith
    assigned
    aozarov
    on Feb 1, 2021
  7. github-actions
    added 2 commits that reference this issue on Jul 1, 2022

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    df6fcc8

    chore: release 2.1.1 (#343)

    d63f77f
  8. github-actions
    added 2 commits that reference this issue on Aug 16, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-workflow…

    b9f92d1

    deps: update dependency com.google.cloud:google-cloud-bigquery to v2.…

    4456bd4
  9. github-actions
    added a commit that references this issue on Sep 15, 2022

    chore(main): release 3.7.3 (#341)

    5402c4f
  10. github-actions
    added 3 commits that reference this issue on Oct 4, 2022

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    39cf046

    chore(main): release 1.2.9 (#342)

    2236c03

    chore(main): release 2.3.9 (#349)

    62f7888
  11. suztomo
    added 3 commits that reference this issue on Feb 1, 2023

    deps: update dependency io.grpc:grpc-stub to v1.46.0 (#341)

    2bf58f7

    chore(main): release 1.3.4 (#345)

    87a91fb

    chore(main): release 2.0.0 (#739)

    ea9f421
  12. meltsufin
    added a commit that references this issue on Dec 22, 2025

    chore: release 2.1.0 (#341)

    b073581
  13. chingor13
    added a commit that references this issue on Jan 6, 2026

    chore(deps): update dependency com.google.cloud:libraries-bom to v17 (#…

    28af0fd
  14. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore(master): release 1.105.8 (#341)

    49f94e2
  15. chingor13
    added a commit that references this issue on Feb 24, 2026

    deps: update dependency com.google.http-client:google-http-client-bom…

    e656244
  16. suztomo
    added a commit that references this issue on Mar 11, 2026

    chore: release 2.1.0 (googleapis#341)

    eeff10a
  17. chingor13
    added a commit that references this issue on Mar 12, 2026

    deps: update dependency com.google.http-client:google-http-client-bom…

    e553998
  18. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore: Re-generated to pick up changes from synthtool. (googleapis#341)

    3ee18bc
  19. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    build(deps): update dependency org.apache.maven.plugins:maven-project…

    88252c1

    build(deps): update dependency org.apache.maven.plugins:maven-project…

    448e3b5
  20. benjaminp
    added a commit that references this issue on Jul 13, 2026

    deps: update autovalue.version to v1.7.3 (googleapis#341)

    9eca553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @aozarov
    aozarov

Labels

🚨 criticalP0 critical issue. Requires immediate fixapi: coreauthtriage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.