google / oauth2l

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

missing 'type' field in credentials #170

Open robdyck opened 2 months ago

robdyck commented 2 months ago

What does "missing 'type' field in credentials" mean?

Input oauth2l fetch --type jwt --credentials app/google-services.json --scope https://www.googleapis.com/auth/firebase.messaging

andyrzhao commented 1 day ago

That error usually means your credentials file is not in the correct format (as expected by the command you are trying to execute.) For instance, a service account credentials file has a "type":"service_account" field in it (https://github.com/google/oauth2l/blob/master/integration/fixtures/fake-service-account.json). I would encourage you to look over the read me section on credentials (https://github.com/google/oauth2l?tab=readme-ov-file#--credentials) to ensure you are generating the credentials in the right format. Keep in mind that client-ID credentials and service account credentials are both supported by oauth2l, but serve different purposes.