Insufficient Permission [403] on PlusDomainsService activity insert
See original GitHub issueGetting 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:
- Created 5 years ago
- Comments:5
Top 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 >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
The issue was a misunderstand between Google+ domain and Google+
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.
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.