Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get interactive auth flow from "oauth2 fetch --type=oauth" #86

Closed
ahmetb opened this issue Dec 21, 2019 · 2 comments
Closed

Comments

@ahmetb
Copy link

ahmetb commented Dec 21, 2019

Hi, thanks for this cool tool!

I'm trying to see if I can build a command-line tool that authenticates to Google APIs using the auth model used by gcloud, which involves user to click to a browser URL and go to a localhost:8080 callback url, or something like user copying the token back to the CLI tool.

I've been trying to see if oauth2l can provide interactive input (#61 claims it can). But when I try this, it doesn't work:

$ oauth2l fetch --type=oauth --scope cloud-platform
google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

I'm curious if there's a code sample in this repo about that.

@andyrzhao
Copy link
Collaborator

Hi ahmetb, the issue is that you have not configured any local credentials. You can specify it through the "--credentials" parameter OR set an environment variable. Please refer to the README file, which includes instructions on how to download a credentials file from cloud console and example code. Note that in order to get an interactive auth flow (a.k.a 3-legged OAuth), you need to use an OAuth Client ID instead of service account key as your credentials.

@ahmetb
Copy link
Author

ahmetb commented Dec 21, 2019

Got it, thanks. My eyes were looking for -client-id , -client-secret options. This explains it.

@ahmetb ahmetb closed this as completed Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants