The CreatorCon Call for Content is officially open! Get started here.

GoogleApi Translate is not working

JitendraT
Tera Expert

Hi Team,

Currently google API for translation is not working in production, when I check the logs , I got below error (ACCESS_TOKEN_SCOPE_INSUFFICIENT), detailed message at the end.

 

I tried by defining the Auth Entity scopes(provided below) while sending the access token request but generated token still throws the same error.

scopes are:

https://www.googleapis.com/auth/cloud-translation
https://www.googleapis.com/auth/cloud-platform

JitendraT_0-1698672814833.png

 

JitendraT_1-1698672827948.png

 

JitendraT_2-1698672840108.png

I initially raised it ServiceNow but they replied saying it Google Cloud Support Issue, I am raising it with Google Support as well. In meantime, If someone has faced this issue and found the solution please let me know.

 

Please note, this issue has seen recently around 16th Oct, before that API was working fine.

 

End Point : https://translation.googleapis.com/v3/projects/<project-code>/locations/global:translateText

Error while translating the text to language using Google Cloud Translator. Error:Request had insufficient authentication scopes.Response received:

{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"service": "translate.googleapis.com",
"method": "google.cloud.translation.v3.TranslationService.TranslateText"
}
}
]
}
}

#googleTranslationAPIIssue

1 ACCEPTED SOLUTION

JitendraT
Tera Expert

I have managed to find the solution of this issue. 

Instead of passing the scopes under 'Auth Entity scopes' we should pass the scope for Google Translation API under 'JWT Claim Validation (table -jwt_claim_validation)"  like below:

JWT provide should be Google Translation Service.

'claim value' must be passed as below, please note, both scopes are space separated.

https://www.googleapis.com/auth/cloud-translation https://www.googleapis.com/auth/cloud-platform 

 

JitendraT_0-1698763731019.png

 

View solution in original post

5 REPLIES 5

JitendraT
Tera Expert

I have managed to find the solution of this issue. 

Instead of passing the scopes under 'Auth Entity scopes' we should pass the scope for Google Translation API under 'JWT Claim Validation (table -jwt_claim_validation)"  like below:

JWT provide should be Google Translation Service.

'claim value' must be passed as below, please note, both scopes are space separated.

https://www.googleapis.com/auth/cloud-translation https://www.googleapis.com/auth/cloud-platform 

 

JitendraT_0-1698763731019.png

 

This steps are not working for us. Are you in Vancouver or Utah? Both instances we have an same issue.

@skesavan , We are in Vancouver,  it should work fine now as its working for me.

Thanks.. I am still getting the error unable to translate.