question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The current user has insufficient permissions to perform the requested

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
mgrishkovcommented, Apr 11, 2019

About 48 hours has been elapsed and manually verification start works as expected. But verification via Google.Apis.AndroidPublisher.v3 still not works.

0reactions
egulhancommented, Sep 21, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found