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

--scope requires different input on windows/linux #102

Closed iamdbychkov closed 4 years ago

iamdbychkov commented 4 years ago

Hello! When running oauth2l on windows I can specify scope like this: oauth2l fetch --credentials a.json --scope userinfo.email and successfuly receive a token

whereas running oauth2l on linux I have to specify full scope like this: oauth2l fetch --credentials a.json --scope https://www.googleapis.com/auth/userinfo.email otherwise I'll get following error:

$ oauth2l fetch --credentials a.json --scope userinfo.email
oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_scope","error_description":"Invalid OAuth scope or ID token audience provided."}

For your consideration: Maybe it's worth to update the documentation to mention such a feature?

andyrzhao commented 4 years ago

Hi @iamdbychkov, there shouldn't be any behavioral differences between windows/linux in the latest version of oauth2l. Based on your description, it sounds like you may be using an older version of oauth2l for linux and running into an old issue that affected "userinfo.email" - see details in https://github.com/google/oauth2l/issues/88. I don't remember if we ever released a linux binary that contained the fix, so you may have to either self-install, or use one of the workarounds until we release a new binary (which will be soon.)

iamdbychkov commented 4 years ago

Yes, you're right. I've been using precompiled binaries for both, windows and linux. Thank you!