'GCP AppEngine gives permission denied when deploying a spring boot application using content api for shopping
I have created a Google Merchant account which creates a project in Google Cloud Console. I deployed an application in google AppEngine using the service account created by the Merchant account to use the content api for shopping by specifying it in the app.yaml
file. Although the same service account credentials are used in my local development setup is fine. I get the following error.
{
2022-05-01 17:42:07 default[20220501t230020] "code" : 403,
2022-05-01 17:42:07 default[20220501t230020] "errors" : [ {
2022-05-01 17:42:07 default[20220501t230020] "domain" : "global",
2022-05-01 17:42:07 default[20220501t230020] "message" : "Insufficient Permission",
2022-05-01 17:42:07 default[20220501t230020] "reason" : "insufficientPermissions"
2022-05-01 17:42:07 default[20220501t230020] } ],
2022-05-01 17:42:07 default[20220501t230020] "message" : "Request had insufficient authentication scopes.",
2022-05-01 17:42:07 default[20220501t230020] "status" : "PERMISSION_DENIED",
2022-05-01 17:42:07 default[20220501t230020] "details" : [ {
2022-05-01 17:42:07 default[20220501t230020] "@type" : "type.googleapis.com/google.rpc.ErrorInfo",
2022-05-01 17:42:07 default[20220501t230020] "reason" : "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
2022-05-01 17:42:07 default[20220501t230020] "domain" : "googleapis.com",
2022-05-01 17:42:07 default[20220501t230020] "metadata" : {
2022-05-01 17:42:07 default[20220501t230020] "service" : "shoppingcontent.googleapis.com",
2022-05-01 17:42:07 default[20220501t230020] "method" : "ads.shopping.contentapi.proto.frontend.v2p1.ContentAccounts.Authinfo"
2022-05-01 17:42:07 default[20220501t230020] }
2022-05-01 17:42:07 default[20220501t230020] } ]
2022-05-01 17:42:07 default[20220501t230020] }
But the service account already has permissions defined to access the content api(since same service account credentials are used locally). I have given permission to access the cloud sql instance for the sam service account and it is working in both locally and in the cloud. I don't know what the issue is any help is appreciated??
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|