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.

Insufficient Permission [403] on PlusDomainsService activity insert

See original GitHub issue

Getting an exeption on activity insert method {"Google.Apis.Requests.RequestError\r\nInsufficient Permission [403]\r\nErrors [\r\n\tMessage[Insufficient Permission] Location[ - ] Reason[insufficientPermissions] Domain[global]\r\n]\r\n"} The original code is:

UserCredential credential;
           using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
            {
                credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                     GoogleClientSecrets.Load(stream).Secrets,
                     new[] { PlusDomainsService.Scope.PlusMe, PlusDomainsService.Scope.PlusLogin, PlusDomainsService.Scope.PlusStreamWrite },
                     _settings.ChannelName,
                     CancellationToken.None
                      );
            }
            var googlePlusService = new PlusDomainsService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "Application Name"
            });
            PlusDomainsAclentryResource resource = new PlusDomainsAclentryResource();
            resource.Type = "public";
            List<PlusDomainsAclentryResource> aclEntries = new List<PlusDomainsAclentryResource>();
            aclEntries.Add(resource);
            Acl acl = new Acl();
            acl.Items = aclEntries;
            acl.DomainRestricted = true;
            var activityData = new Activity.ObjectData() { OriginalContent = "Hello world"};
            Activity activity = new Activity()
            {
                Access = acl,
                Object__ = activityData
            };
            var insertRequest = googlePlusService.Activities.Insert(activity, "me");
            var result = await insertRequest.ExecuteAsync();

client_secrets.json is a downloaded file from https://console.developers.google.com/apis/credentials OAuth 2.0

UPD: replaced _credential with credential, becouse of typo

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ansydorcommented, May 29, 2018

The issue was a misunderstand between Google+ domain and Google+

0reactions
LindaLawtoncommented, May 29, 2018

Its not the application that needs access to Google+ domain its the user you are logging in with. If that user does not have access to write to your Google+ domains account then you are going to get the error message.

Insufficient Permission

The user does not have permissions not the application. Trying increasing that users permissions on the domain or login with a user that does have access already.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is there a "code": 403, "message": "Insufficient ...
I think this is an authorization problem, so I suggest going through the authorization process again to generate a fresh access/refresh token ...
Read more >
403 "access_denied_insufficient_permissions" Errors
If one of these checks returns insufficient permissions, then the error will be returned. This list is not exhaustive. Box has many access ......
Read more >
Resolve errors | Google Drive
An error 403 occurs when a usage limit has been exceeded or the user doesn't have the correct privileges. To determine the specific...
Read more >
403 error when accessing Google Calendar API using ...
From the error, it looks like you are trying to get the user's data on the calendar Maybe you haven't set the proper...
Read more >
Resolve Microsoft Graph authorization errors
Authorization errors can occur as a result of several different issues, most of which generate a 403 error (with a few exceptions).
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