Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.18 KB

README.adoc

File metadata and controls

31 lines (24 loc) · 1.18 KB

cordova-oauth-google-services

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.

Installation

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```

Using the plugin

window.cordova.plugins.oauth([scope], done, [err]);
  • scope optional: the scope for the Ouath2 token request. Default: https://www.googleapis.com/auth/plus.me

  • done required: a success callback invoked the Oauth2 token as it’s single parameter

  • err optional: a failure callback invoked when there is an error retrieving the token