angular-googleapi
angular-googleapi copied to clipboard
Error: invalid_request
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?
Yes, is not on server, my project is running on my device with angularjs
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 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)