0

I'm working on an app that consumes the Google Drive API. Google's documentation states two conditions necessary for authentication to be successful:

The user is signed-in to their Google account.

The user has granted permission to your app to access their data within the requested scopes.

How can I allow the user to sign in when testing locally?

My app is currently built with the Jekyll framework, which serves locally to 127.0.0.1:4000.

1

1 Answer 1

0

I found the answer in some additional documentation.

In the following function, changing immediate from true to false forces the app to ask for authentication. Otherwise, authentication silently fails if the user isn't logged in.

function handleAuthClick(event) { gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult); return false; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.