issue in running Google Vision API using BP Tool

Sanjiv

New Member
Hi Folks,

While running detect faces API of Google in blue prism,getting below error.

Internal : Unexpected error Failed to get OAuth2.0 Access Token : "ProtocolError" "{
"error": "invalid_grant",
"error_description": "Invalid issuer: Not a service account."
}"

please, Will anyone help me out in given error?
 

Sanjiv

New Member
@kattapug - now its working for me.

So, First create service account in Google Vision API as documented in Digital assets.(Please be prepare to add credit card details as it asks while making service account in Google and it will deduct Rs2, I guess for me :))
Second, Creating credential at Credential manager was little different here and my issue was due to this only.
So, OAuth 2.0 (JWT Bearer Token)" must be selected as a "Type" while creating credential.(normally we have general selected in credential manager) and and will be named "GoogleJWT".
Password - Take Generated key in notepad and
When copy and pasting in the private key, you must include the following information in the key then save in the credential manager

• -----BEGIN PRIVATE KEY-----\n

• \n-----END PRIVATE KEY-----\n
 

kattapug

New Member
Hi Sanjiv,

Thanks for your response.

I have followed your instruction and get another error now.

With quotation marks it get this error.

"-----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n"

Internal : Unexpected error PKCS8 data must be contained within '-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----'.
Parameter name: privateKey

Without quotation marks it get this error.

-----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n

Internal : Unexpected error Failed to get OAuth2.0 Access Token : "ProtocolError" "{
"error": "invalid_grant",
"error_description": "Invalid issuer: Not a service account."
}"

Any advise?
 

Sanjiv

New Member
HI kattapug,

sorry, i forgot to mention issuer which is the email listed IAM Section of Google Cloud Platform -> Service Accounts.

Second, don't use double quotes for credential " ".

In Key i used = , please check once by keeping it and again removing it.
for e.g. -----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n
-----BEGIN PRIVATE KEY-----\n privateKey =\n-----END PRIVATE KEY-----\n
Check both the way but first keep -----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n (recommended).

Be sure that you have created the service accounts as mentioned in document.

Please refer to attached file

Verify and let me know :)
 

Attachments

  • Credential.PNG
    91.5 KB · Views: 81
  • vision key.txt
    81 bytes · Views: 77
  • Detect_Face.PNG
    40.7 KB · Views: 69

luke.ruben

New Member
Hi I'm trying to use it with twitter developer, I have the keys but when I run the API it throws me this error.. I dont know what I could have wrong I have tried all the ways to enter the Key
 

Attachments

  • Annotation 2019-11-14 123823.png
    5.8 KB · Views: 44

luke.ruben

New Member
HI kattapug,

sorry, i forgot to mention issuer which is the email listed IAM Section of Google Cloud Platform -> Service Accounts.

Second, don't use double quotes for credential " ".

In Key i used = , please check once by keeping it and again removing it.
for e.g. -----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n
-----BEGIN PRIVATE KEY-----\n privateKey =\n-----END PRIVATE KEY-----\n
Check both the way but first keep -----BEGIN PRIVATE KEY-----\n privateKey \n-----END PRIVATE KEY-----\n (recommended).

Be sure that you have created the service accounts as mentioned in document.

Please refer to attached file

Verify and let me know :)

Hey Could you help me please
I have wrotten correclty everything on the OAuth2.0
Im trying to use the API with twitter I already have the keys and all but this error is showing up (image 1), I think its involved with the Keys because i found this information Image 2
 

Attachments

  • Annotation 2019-11-14 123823.png
    5.8 KB · Views: 58
  • Annotation 2019-11-14 124814.png
    16 KB · Views: 49

Sanjiv

New Member
@luke.ruben , attachment error seems that you did not created key before making credential in System.
Steps to Create key in Blue prism
Go to system - security - Encryptions Scheme - New.
 

Sanjiv

New Member
@praveen4018 -
Creating credential at Credential manager was little different here and my issue was due to this only.
So, OAuth 2.0 (JWT Bearer Token)" must be selected as a "Type" while creating credential.(normally we have general selected in credential manager) and and will be named "GoogleJWT".
Password - Take Generated key in notepad and
When copy and pasting in the private key, you must include the following information in the key then save in the credential manager

• -----BEGIN PRIVATE KEY-----\n

• \n-----END PRIVATE KEY-----\n
 

Iniotr

New Member
@kattapug - now its working for me.

So, First create service account in Google Vision API as documented in Digital assets.(Please be prepare to add credit card details as it asks while making service account in Google and it will deduct Rs2, I guess for me :))
Second, Creating credential at Credential manager was little different here and my issue was due to this only.
So, OAuth 2.0 (JWT Bearer Token)" must be selected as a "Type" while creating credential.(normally we have general selected in credential manager) and and will be named "GoogleJWT".
Password - Take Generated key in notepad and
When copy and pasting in the private key, you must include the following information in the key then save in the credential manager

• -----BEGIN PRIVATE KEY-----\n

• \n-----END PRIVATE KEY-----\n
hi ,what have you written in the issuer field?
 
Top