angular-googleapi icon indicating copy to clipboard operation
angular-googleapi copied to clipboard

Error: invalid_request

Open smoresch opened this issue 10 years ago • 3 comments

Hi, when i try to do login with my client id i receive a message error: Invalid parameter value for origin: Missing authority: file://. This happen only on phisical device, but not in browser..

Someone can help me?

smoresch avatar Jul 01 '14 13:07 smoresch

Yes, is not on server, my project is running on my device with angularjs

smoresch avatar Jul 01 '14 14:07 smoresch

This maybe a bit late but I just encountered this problem.

A few moments of research and testing led me to use OAuth of ngCordova.

  • https://github.com/nraboy/ng-cordova-oauth

    $cordovaOauth.google("[CLIENT_ID]", ["SCOPE1", "SCOPE2"]).then(function(result) {

          // call googleLogin.handleAuthResult to initialize angular-googleapi callbacks
          googleLogin.handleAuthResult(result);
          // for the callbacks to work, set authentication result as gapi access_token
          gapi.auth.setToken(result);
    

    }, function(error) {

         // not on device, use angular-googleapi login
         if (error === "Cannot authenticate via a web browser")
            googleLogin.login();
    

    });

  • btw, you need inappbrowser of ngcordova for this to work.

ghOutblazeRadix avatar Sep 01 '15 08:09 ghOutblazeRadix

@ghOutblazeRadix I didn't understand your solution, can you please give a more detailed explanation? Calling this method isn't doing anything (there's no response)

ofershap avatar May 09 '16 09:05 ofershap