google-api-js-client

Is there anyway to get private file of user with drive.file scope

半世苍凉 提交于 2021-02-11 13:55:11
问题 I want to get drive file of user (metadata, content, downloadUrl) not created by my application with access token have only drive.file scope. Can anyone have a solution for this one? Thank you. gapi.client.load('drive', 'v3', () => { gapi.auth.setToken({ access_token: user.services.google.accessToken, expires_in: user.services.google.expiresAt, }); gapi.client.drive.files.get({ fileId: file.id, fields: 'webContentLink', }).then( test => { console.log('test', test); }) }); 回答1: You need to

How do I find a users YouTube channel from Google gapi client authentication?

喜夏-厌秋 提交于 2021-02-11 12:47:03
问题 For the app I'm building I want the end user to login using gapi OAuth2 and from there I want the app to look for a playlist on their YouTube channel and load it. The getAuthInstance method returns an object with a Google username. However for my own particular username, a query to find channel id by username returns no results. From some browsing online, this is apparently an issue with certain YouTube accounts. Is there any workaround for this issue? 回答1: If you have a valid OAuth 2.0

How do I find a users YouTube channel from Google gapi client authentication?

删除回忆录丶 提交于 2021-02-11 12:45:39
问题 For the app I'm building I want the end user to login using gapi OAuth2 and from there I want the app to look for a playlist on their YouTube channel and load it. The getAuthInstance method returns an object with a Google username. However for my own particular username, a query to find channel id by username returns no results. From some browsing online, this is apparently an issue with certain YouTube accounts. Is there any workaround for this issue? 回答1: If you have a valid OAuth 2.0

gapi.auth2.getAuthInstance().isSignedIn.get() is always false when Chrome Browser has multiple accounts

别来无恙 提交于 2021-02-07 14:48:42
问题 I copied the example given in Google Calendar API Quickstart and replaced it with the appropriate info. Every time I refresh the page, I'm asked to authorize before api data is fetched. I'm using Chrome and I currently have multiple accounts / users. I noticed if I open an Incognito Window and sign in with one set of credentials then when I refresh the page I'm not asked to authorize. Note, once I authenticate I receive calendar information so I don't believe it's an issue with client_id ,

gapi.auth2.getAuthInstance().isSignedIn.get() is always false when Chrome Browser has multiple accounts

怎甘沉沦 提交于 2021-02-07 14:47:36
问题 I copied the example given in Google Calendar API Quickstart and replaced it with the appropriate info. Every time I refresh the page, I'm asked to authorize before api data is fetched. I'm using Chrome and I currently have multiple accounts / users. I noticed if I open an Incognito Window and sign in with one set of credentials then when I refresh the page I'm not asked to authorize. Note, once I authenticate I receive calendar information so I don't believe it's an issue with client_id ,

GAPI (Google API) Drive. File request with attribute “appProperties” does not work

我的梦境 提交于 2021-01-29 18:42:49
问题 Request parameters: "q": "appProperties has {key = 'hah' and value = 'vah'}", "fields": "files (id, name, appProperties)" By trying the files.list request in the environment of the Google API docks (which is Try it), the request passes and the data is returned correct. Trying to execute the same request from the application, the request passes, but I get an empty list of files { "kind": "drive # fileList", "incompleteSearch": false, "files": [] } Yes, the "incompleteSearch" header also comes:

Is it possible to open google picker with access token which is fetched from server side Oauth2?

ε祈祈猫儿з 提交于 2021-01-01 07:04:47
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

风格不统一 提交于 2021-01-01 07:03:53
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

岁酱吖の 提交于 2021-01-01 07:03:41
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

吃可爱长大的小学妹 提交于 2021-01-01 07:03:29
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });