A cordova plugin that uses Google Play Services to fetch an Oauth2 token for a locally logged-in user, requiring no additional user authentication. This Oauth2 token can then be used to authorize the Google Oauth2 REST APIs.
This plugin will fail on older Android devices (pre 2.2) or on devices where Google Play services is otherwise not available. In such situations, the user can manually fallback to an Oauth2 token request using HTTP.
Install this plugin with the command:
cordova plugin add https://github.com/bleathem/cordova-oauth-google-services.git
Remove this plugin with the command:
cordova plugin remove ca.bleathem.plugin.OauthGoogleServices```
window.cordova.plugins.oauth([scope], done, [err]);-
scopeoptional: the scope for the Ouath2 token request. Default:https://www.googleapis.com/auth/plus.me -
donerequired: a success callback invoked the Oauth2 token as it’s single parameter -
erroptional: a failure callback invoked when there is an error retrieving the token