Skip to content

[Feature Request] Authorize using oAuth tokens #1117

Description

@jasonpolites

Currently the authorization for gcloud-code is done via a service account but it would be great if the client could be authorized via an oAuth token as an alternative.

This would make it easy to quickly iterate on solutions, and also share solutions with other people without needing to pass around keys etc.

For example, the quickstart.js guide for the Gmail API materializes an oAuth token with a given scope. It would be simple to add GCP scopes to this so I could re-use the one auth token to talk to both GMail and GCP resources (one using googleapis and one using gcloud)

This would mean I could create a snippet of code that depends on certain scopes and share that code with anyone else without them needing to create a service account to execute the code.

Activity

  1. stephenplusplus commented on Feb 5, 2016

    @stephenplusplus
    Contributor

    Do you mean literally a token string or a json file (from the guide, client_secret.json)?

  2. jasonpolites commented on Feb 5, 2016

    @jasonpolites
    Author

    I would think the preferred option would be an in-memory value. Developers can then immediately authorize gcloud from an oAuth dance, and if they want to store the token they can do that but they'll have to store/load it themselves (they may want to store it somewhere other than local file system, so I think just having a String value makes the most sense)

  3. stephenplusplus commented on Feb 6, 2016

    @stephenplusplus
    Contributor

    Sounds good to me!

    @jgeewax should we move this to gcloud-common so other languages can support this style of auth?

  4. stephenplusplus commented on Feb 7, 2016

    @stephenplusplus
    Contributor

    This issue was moved to GoogleCloudPlatform/gcloud-common#76

  5. added a commit that references this issue on Feb 3, 2026
  6. added a commit that references this issue on Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions