Per-request AddCredential not working with BatchRequest
See original GitHub issueWith 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
OData batch request does not work well
I could get response data when I had sent request without batch so maybe Bearer token and URL are not wrong. Request POST...
Read more >Combine multiple requests in one HTTP call using JSON ...
First JSON batch request; Request format; Response format ... For a list of current limitations related to batching, see known issues.
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
@mikequ-taggysoft Yes, this is still on my radar, but as @jskeet said some higher priority work popped up. We’ll work on this for sure.
@mikequ-taggysoft: Amanda is currently on vacation, and when she’s back there are higher priorities. We haven’t forgotten about this and will get to it, but I’m afraid we do need to prioritize work that will affect more customers.