The current user has insufficient permissions to perform the requested
See original GitHub issueI faced with a problem with subscription verification on the server side. I’ve already read tons of articals and manuals but issue is still there. I’ve created Service Account, linked project with Google Play Console, added Api, added user for service account and granted it admin. previlege, but when I run my sample app. it returns me “The current user has insufficient permissions to perform the requested”. I found similar issue for nodeJS. It seems that I have to wait about 24 hours…
Did anyone faced with the problem?
Code:
static void Main(string[] args)
{
var privateKey = "{\n \"type\": \"service_account\",\n \"project_id\": \"....";
var credential = GoogleCredential.FromJson(privateKey)
.CreateScoped("https://www.googleapis.com/auth/androidpublisher");
var accessToken = ((ITokenAccess) credential).GetAccessTokenForRequestAsync().GetAwaiter().GetResult();
const string PACKAGE_NAME = "....";
const string PRODUCT_ID = "week_auto_subscription_test";
var token = "gpnmf....";
var uri = new Uri($"https://www.googleapis.com/androidpublisher/v3/applications/{PACKAGE_NAME}/purchases/subscriptions/{PRODUCT_ID}/tokens/{token}");
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, uri);
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
var response = client.SendAsync(request).GetAwaiter().GetResult();
Console.WriteLine(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
Console.ReadKey();
}
Result:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "permissionDenied",
"message": "The current user has insufficient permissions to perform the requested operation."
}
],
"code": 401,
"message": "The current user has insufficient permissions to perform the requested operation."
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
"The current user has insufficient permissions to perform ...
So check Users and Permission in the Google Play store console and check if the appropriate permission is checked.
Read more >service account with owner rights has insufficient permissions
It always returns the same error: The current user has insufficient permissions to perform the requested operation. Assuming that: The current ...
Read more >Authentication issues with Google API – Androidpublisher
Error : The current user has insufficient permissions to perform the requested operation. { "code" : 401, "errors" : [ { "domain" :...
Read more >Google Play Developer API – “The current user has ...
Google Play Developer API – “The current user has insufficient permissions to perform the requested operation.” google-apigoogle-api-client.
Read more >Troubleshooting common Google Play errors
The current user has insufficient permissions to perform the requested operation. status: PERMISSION_DENIED · This error may have caused due to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
About 48 hours has been elapsed and manually verification start works as expected. But verification via Google.Apis.AndroidPublisher.v3 still not works.
I encountered the same issue. In my case, I was not using a key file (json one) for the granted service account on Google Play while verifying purchases on the back-end. I replaced the wrong key file with the one of granted service account on Google Play and it’s working fine now.