google-oauth

Google OAuth using domain wide delegation and service account

那年仲夏 提交于 2020-07-23 07:11:28
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

Google OAuth using domain wide delegation and service account

大兔子大兔子 提交于 2020-07-23 07:10:49
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

Google OAuth using domain wide delegation and service account

谁都会走 提交于 2020-07-23 07:09:38
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

how to get email after using google OAuth2 in C#?

可紊 提交于 2020-07-22 10:55:22
问题 I get credentials using code static string[] Scopes = { "https://www.googleapis.com/auth/userinfo.email" }; private static UserCredential GenerateCredential() { UserCredential credential; using (var stream = new FileStream("credentials.json", FileMode.Open, FileAccess.Read)) { // The file token.json stores the user's access and refresh tokens, and is created // automatically when the authorization flow completes for the first time. string credPath = "token.json"; credential =

redirect_uri_mismatch the redirect URI in the request does not match the ones authorized for the OAuth client

醉酒当歌 提交于 2020-07-15 08:22:28
问题 I have following client secret { "web": { "client_id": "testid", "project_id": "testproj", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://www.googleapis.com/oauth2/v3/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "test-sec", "redirect_uris": [ "https://localhost:8080/oauth2callback" ] } } and I am getting "Error: redirect_uri_mismatch The redirect URI in the request, http://127.0.0.1:8414/authorize/, does

How to solve “idpiframe_initialization_failed” for localhost?

感情迁移 提交于 2020-07-08 11:00:10
问题 Here's my initialization code: function HandleGoogleApiLibrary() { // Load "client" & "auth2" libraries gapi.load('client:auth2', { callback: function () { // Initialize client & auth libraries gapi.client.init({ apiKey: 'My API Key', clientId: 'My Client ID', scope: 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.me' }).then( function (success) { console.log("Yaaay"); }, function (error) { console.log("Nope

How to solve “idpiframe_initialization_failed” for localhost?

痞子三分冷 提交于 2020-07-08 10:59:06
问题 Here's my initialization code: function HandleGoogleApiLibrary() { // Load "client" & "auth2" libraries gapi.load('client:auth2', { callback: function () { // Initialize client & auth libraries gapi.client.init({ apiKey: 'My API Key', clientId: 'My Client ID', scope: 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.me' }).then( function (success) { console.log("Yaaay"); }, function (error) { console.log("Nope

Keeping user logged in after refresh/using refresh token with Google OAuth2 in React app

橙三吉。 提交于 2020-07-07 07:27:28
问题 I’m building a React app where a key part of the functionality is a user can sign into their Google account and then access a feed of their most recent Google Drive/Docs mentions and notifications. A user arrives at my site where I load the Google OAuth2 client with my client_id , apiKey , scope and discoveryDocs , and they can click a button to sign in. For convenience, I’d like the user to not have to re-login and re-auth with their Google account every time they use the app or the app

Is there a max number of Authorized Redirect URIs for Google API?

时光怂恿深爱的人放手 提交于 2020-07-06 13:47:27
问题 In the Google API manager when creating a Client ID for a web application, you have the ability to add multiple authorized redirect URIs. Does anyone know of a maximum number of URIs that can be added? Thanks 回答1: I don't know the real number, but it is more than 32. Source: Currently I use 32 URI's and without any issues, so it is definetly more than that. To commenters asking why: We have currently 32 distinct domains, so we need 32 URI's (meaning that 32 authorized domains is not issue

Google Calendar API. Adding an event to someone calendar throws error “Error 401: invalid_client” just when authenticating

若如初见. 提交于 2020-07-03 04:48:13
问题 I have a C# class library from which I am trying to add an event to someone calendar just by using his/her email address and password as credentials. So I debug it and once started a new page in the internet browser is open and below error is displayed: Below the code: // It crashes when calling GoogleWebAuthorizationBroker.AuthorizeAsync UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = "myGoogleAccount@gmail.com", ClientSecret =