Comments (8)
Hi there, it sounds like you have a malformed credentials.json and possibly mixing and matching client id credentials with service account credentials. Also, you should never have to hand-edit fields in the credentials. Can you tell me what the original credentials.json looked like (i.e. all the fields it had). Don't share the values. Thanks!
from oauth2l.
Hello andy , thanks for your reply!
here you are my downloaded untouched json credential file;
$ cat client_secret_588412352642-jv7lchcip7oq13b58udqvXXXXXXXXXXXXX.apps.googleusercontent.com.json | json_pp
{
"web" : {
"client_secret" : "GOCSPX-7umgRkXwWha358sP5XXXXXXXXXX",
"client_id" : "588412352642-jv7lchcip7oq13b58udqXXXXXXXXXXXX.apps.googleusercontent.com",
"token_uri" : "https://oauth2.googleapis.com/token",
"auth_uri" : "https://accounts.google.com/o/oauth2/auth",
"auth_provider_x509_cert_url" : "https://www.googleapis.com/oauth2/v1/certs",
"project_id" : "annular-text-341115"
}
}
$
$ ./oauth2l fetch --credentials client_secret_588412352642-jv7lchcip7oq13b58udqvXXXXXXXXXXXXX.apps.googleusercontent.com.json --scope postmaster.readonly
missing 'type' field in credentials
$
from oauth2l.
Hi there, so it looks like you are trying to work with a client id credentials file - what is strange is that oauth2l doesn't recognize it, possibly because your credentials file does not have "redirect_uris" field which is needed for the 3LO flow. Can you try creating a new credentials file and selecting "Desktop" instead of "web" for generating the credentials file? We will try to repro your issue on our end in the meantime.
from oauth2l.
Thanks again for you reply andy.
I created a new credentials pair using desktop as app type, and seems it advanced properly, i received;
$./oauth2l fetch --credentials credentials.json --scope=postmaster.readonly
Your browser could not be opened to visit:
Now i have to figure out whats its the browser message related, and get my auth token. :-)
from oauth2l.
Hi gu1113, going back to the "redirect_uris" missing in the credentials file, did you provide values for "Authorized Javascript origins" and "Authorized redirect URIs" when creating the web client in GCP? Thanks!
from oauth2l.
Hi @ulisesL , thanks for you reply!, i did not complete those files because im trying to get the auth token to use the google postmaster api not sure which fields i should use.
from oauth2l.
No problem! When creating "web" client credentials, please provide the "Authorized Javascript origins" and "Authorized redirect URIs" fields in the GCP UI. "Authorized redirect URIs" is needed for the 3LO flow as @andyrzhao pointed out. Missing this field will result in the error described in your 1st post.
from oauth2l.
Hi @gu1113, Re: Your browser could not be opened to visit:
, would you mind sharing what OS and default browser you are using?
from oauth2l.
Related Issues (20)
- no longer receiving identity token HOT 2
- Support id_token for JWT path HOT 3
- 123
- oauth token now contains trailing dots HOT 1
- Cannot get token for Google Photos HOT 4
- syntax error in linux pre-compiled binary HOT 3
- Invalid JWT: Failed audience check. HOT 1
- Enter authorization code: HOT 1
- Segfault on MACOS Monterey HOT 1
- Consider binary compression
- curl stdout goes to oauth2l stderr HOT 3
- Errors go to stdout and don't produce nonzero exit status
- Authenticate a User for IAP
- Same access_token after refresh HOT 1
- password flow HOT 3
- `oauth2l web` fails on `failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1`
- Cannot generate refresh token. "missing 'type' field in credentials" HOT 2
- Oauth2l application is not opening in windows HOT 1
- impersonate service account and type jwt does not seem to work well together HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth2l.