Coder Social home page Coder Social logo

Comments (11)

zdavatz avatar zdavatz commented on July 3, 2024 6

Solved, I had the wrong JSON file!

from imagetotext.

e-sim-python avatar e-sim-python commented on July 3, 2024 4

Try this https://docs.gspread.org/en/latest/oauth2.html#for-bots-using-service-account

from imagetotext.

HeleneRousseau avatar HeleneRousseau commented on July 3, 2024 2

How can we do when we have the json file but not under this format?

I have this file but no "private_key_id" nor 'private_key" nor "client_email" and I have "client_secret" instead of "client_x509_cert_url".

from imagetotext.

ee1922 avatar ee1922 commented on July 3, 2024 2

@HeleneRousseau
Clicking the three dots on the action column, then selecting Manage Keys>Add key>Create New key will do the trick.

from imagetotext.

Carleslc avatar Carleslc commented on July 3, 2024 1

@masoudl Ensure you're following the Authentication steps to get your service account JSON credentials: https://github.com/Carleslc/ImageToText#authentication

It has this format:

{
  "type": "service_account",
  "project_id": "imagetotext-***",
  "private_key_id": "***",
  "private_key": "-----BEGIN PRIVATE KEY-----
\n***\n-----END PRIVATE KEY-----\n",
  "client_email": "imagetotext@imagetotext-***.iam.gserviceaccount.com",
  "client_id": "***",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/imagetotext%40imagetotext-***.iam.gserviceaccount.com"
}

from imagetotext.

masoudl avatar masoudl commented on July 3, 2024

Hi, can you give more detail on how you fixed it?
I am having the same problem.

from imagetotext.

zdavatz avatar zdavatz commented on July 3, 2024

Do you have the JSON file?

from imagetotext.

cesarvspr avatar cesarvspr commented on July 3, 2024

@masoudl Ensure you're following the Authentication steps to get your service account JSON credentials: https://github.com/Carleslc/ImageToText#authentication

It has this format:

{
  "type": "service_account",
  "project_id": "imagetotext-***",
  "private_key_id": "***",
  "private_key": "-----BEGIN PRIVATE KEY-----
\n***\n-----END PRIVATE KEY-----\n",
  "client_email": "imagetotext@imagetotext-***.iam.gserviceaccount.com",
  "client_id": "***",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/imagetotext%40imagetotext-***.iam.gserviceaccount.com"
}

:
Do you know where can I get this json?

from imagetotext.

Carleslc avatar Carleslc commented on July 3, 2024

How can we do when we have the json file but not under this format?

I have this file but no "private_key_id" nor 'private_key" nor "client_email" and I have "client_secret" instead of "client_x509_cert_url".

@HeleneRousseau Where and how have you got the file? Have you tried the convert.py script using your service account file? Does it give any error with the format?

from imagetotext.

HeleneRousseau avatar HeleneRousseau commented on July 3, 2024

I get this file from the google cloud platform. I don't have any service account credential. I just have an OAuth Client (which now has been deleted according to the error message but that's another problem) and an API key. Ideally I would like to work only with an API key.

from imagetotext.

demironmanx avatar demironmanx commented on July 3, 2024

For OAuth 2.0 Client IDs use credentials.json as the file name. I used service_accounts.json for the OAuth 2.0 file name and was getting "MalformedError: Service account info was not in the expected format, missing fields client_email, token_uri." until I discovered it. For service account bots use service_account.json

from imagetotext.

Related Issues (1)

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.