google / oauth2l

oauth2l ("oauth tool") is a simple CLI for interacting with Google API authentication.
Apache License 2.0
643 stars 81 forks source link

sgauth.Settings to accept credentials.Credentials #87

Closed ahmetb closed 4 years ago

ahmetb commented 4 years ago

I'm trying to understand if oauth2l is primarily supposed to be exec'd out to, to get credentials –or it's supposed to be imported as a Go package (given, I'm using Go).

In that case, I think it would be better to allow sgauth.Settings.CredentialsJSON object to be replaced with a *credentials.Credentials field, as I might be hardcoding the client_id, client_secret etc in my program, or reading from env, etc. I'm assuming the schema of the creds JSON file isn't used to determine the auth format?

I'm trying to implement a tool to do 3LO and it does not seem like there's a clear API surface provided by this repo. I'm assuming this tool is supposed to be exec'd into so maybe I'm doing this wrong.

ahmetb commented 4 years ago

I think I'm supposed to use x/oauth2 + x/oauth2/google myself directly.