Git Product home page Git Product logo

Comments (8)

andyrzhao avatar andyrzhao commented on May 3, 2024

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.

gu1113 avatar gu1113 commented on May 3, 2024

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.

andyrzhao avatar andyrzhao commented on May 3, 2024

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.

gu1113 avatar gu1113 commented on May 3, 2024

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:

https://accounts.google.com/o/oauth2/auth?client_id=588412352642-jpnutc2stgcd73adrjd1XXXXXXXqppop.apps.googleusercontent.com&code_challenge=CwYKVVRSCyEqBV5ibhTR2yk2tVuQlS7XXrXXXXXXXXX&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A45495&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fpostmaster.readonly&state=state
$

Now i have to figure out whats its the browser message related, and get my auth token. :-)

from oauth2l.

ulisesL avatar ulisesL commented on May 3, 2024

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.

gu1113 avatar gu1113 commented on May 3, 2024

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.

ulisesL avatar ulisesL commented on May 3, 2024

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.

ulisesL avatar ulisesL commented on May 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.