-
Notifications
You must be signed in to change notification settings - Fork 545
Open
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
With the per-request credential example provided by @amanda-tarafa in #2064, I was able to get it working for services like Calendar and Oauth2. But I'm having trouble with GmailService.
I use GmailService via BatchRequest, like this
var cred = GoogleCredential.FromAccessToken(myToken);
var batchRequest = new BatchRequest(_gmailService);
foreach (var gmailMessage in gmailMessages)
{
batchRequest.Queue<SendRequest>
(_gmailService.Users.Messages.Send(gmailMessage, "me").AddCredential(cred), myCallback));
}
await batchRequest.ExecuteAsync();
I'm getting error:
Error 401, Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.