gapi

Using Google auth2 sign in, force user to enter password

爱⌒轻易说出口 提交于 2020-07-08 11:35:30
问题 I just implemented Google JavaScript sign-in button to our homepage, and everything works the way it suppose to, but thats sometimes bad.. So the thing is that our users use our application on the same computer, 3-4 different users per day. Having a google sign in gives us access to implement some Google product features in our own site. I understand that sign-in with google signs you into the Google account, and also gives permission to application. Also i understand that this is the way it

How to use gapi in react

我是研究僧i 提交于 2020-05-29 04:51:31
问题 I want to use gapi to access people api resources from google, I tried many ways to do the job, but I still cannot get any response. It has not error, no warning. Here is my code. loadYoutubeApi() { const script = document.createElement("script"); script.src = "https://apis.google.com/js/client.js"; script.onload = () => { window.gapi.load('client', () => { window.gapi.client.setApiKey(types.API_KEY) window.gapi.client.setClientId(types.CLIENT_ID) window.gapi.client.setDiscoveryDocs(types

Google Chrome 62.0.3202.94 gapi.auth2.getAuthInstance().signIn popup_closed_by_user

一笑奈何 提交于 2020-02-02 14:30:31
问题 Try sample from documentation https://developers.google.com/identity/protocols/OAuth2UserAgent#example We could select an account from popup dialog, but SignIn don't autorize in Google Chrome version 62.0.3202.94 In my example bilding by this documentation I got the error message with code "popup_closed_by_user" In Google Chrome version 62.0.3202.94 method ` gapi.auth2.getAuthInstance().signIn(options).then( function(resp) { var auth_code = resp.code; }, function(resp) { var auth_code = resp

How to Youtube transcript with api (captions.download

笑着哭i 提交于 2020-01-23 02:49:36
问题 I have built a javascript code to be able to read any Youtube video transcript (gapi.client.youtube.captions.download). The auth 2.0 works fine, I run my app in a local web server everything is fine, the problem is that when I run the request I have the error 403: cb=gapi.loaded_0:164 GET https://content.googleapis.com/youtube/v3/captions/My_API_Key 403 I have not found any solution here in StackOverflow.. any idea ? Here is my js file: const CLIENT_ID = 'My_Client_ID'; const DISCOVERY_DOCS =

Durandal JS and Google Plus Sign in Javascript API

廉价感情. 提交于 2020-01-06 12:56:39
问题 So I'm trying to build a mobile app using Durandal. However, I am having trouble to do so with Google plus JS API integration. I think here is the problem: The javascript client for gapi comes with asynchronous loading, so durandal initialization will crash having gapi undefined and because of this, the css components also do not render properly also. I have tried putting the following script tags in the login.html file of my view for login.js or even in the require.js section of my main.js

Durandal JS and Google Plus Sign in Javascript API

為{幸葍}努か 提交于 2020-01-06 12:55:49
问题 So I'm trying to build a mobile app using Durandal. However, I am having trouble to do so with Google plus JS API integration. I think here is the problem: The javascript client for gapi comes with asynchronous loading, so durandal initialization will crash having gapi undefined and because of this, the css components also do not render properly also. I have tried putting the following script tags in the login.html file of my view for login.js or even in the require.js section of my main.js

Trouble signing out with Google Sign in (gapi) with angularjs

时光毁灭记忆、已成空白 提交于 2020-01-04 03:13:32
问题 So I have tried the following templates trying to integrate this: HTML : <google-sign-in-button button-id="login-button" options="options"></google-sign-in-button> CSS : .directive('googleSignInButton', function() { return { scope: { buttonId: '@', options: '&' }, template: '<div></div>', link: function(scope, element, attrs) { var div = element.find('div')[0]; div.id = attrs.buttonId; gapi.signin2.render(div.id, scope.options()); } }; }) -- I've also just tried doing this in the header and

Google Sign-In gives error when swiching to secondary Youtube accounts

你离开我真会死。 提交于 2020-01-01 08:04:30
问题 I am currently trying to use gapi.auth2 from Google Sign-In for Websites API and this is the code I have: -- load the library with: <script src="https://apis.google.com/js/platform.js?onload=onLoadGapiCallback" async defer></script> -- initialize an auth2 variable: var auth2; window.onLoadGapiCallback = () => { gapi.load('auth2', () => { auth2 = gapi.auth2.init({ 'client_id': 'CLIENT_ID', 'scope': 'profile email https://www.googleapis.com/auth/youtube.readonly' }); }); }; -- and when a botton

Google Sign-In gives error when swiching to secondary Youtube accounts

一个人想着一个人 提交于 2020-01-01 08:04:04
问题 I am currently trying to use gapi.auth2 from Google Sign-In for Websites API and this is the code I have: -- load the library with: <script src="https://apis.google.com/js/platform.js?onload=onLoadGapiCallback" async defer></script> -- initialize an auth2 variable: var auth2; window.onLoadGapiCallback = () => { gapi.load('auth2', () => { auth2 = gapi.auth2.init({ 'client_id': 'CLIENT_ID', 'scope': 'profile email https://www.googleapis.com/auth/youtube.readonly' }); }); }; -- and when a botton

Google Login gapi.auth2.init(): not resolving or rejecting promise

别等时光非礼了梦想. 提交于 2019-12-25 07:58:55
问题 I have some google login code I use to display a google login button as well as listen for changes in sign in. It works perfect the majority of the time, but I've had some users tell me it doesn't work and have to use our manual login. I can't seem to replicate the problem. We work with students and often only one student in a classroom will not be able to see the button... yet, they're all on the same type of chromebooks. I've added an AJAX call to send me an email for debugging if after 10