Skip to content

Sitata/titanium_google_auth_util

Repository files navigation

titanium_google_auth_util

A simple utility to perform single sign on in a Titanium Alloy app using Google's Account Manager on android.

NOTE This module will soon be deprecated in favour of titanium_google_plus

In the meantime, you can use the module like the following:

var GoogleAuthUtil = require("com.sitata.googleauthutil");
    GoogleAuthUtil.setScope("oauth2:profile email");
  
// this launches a dialog window for google account selection
GoogleAuthUtil.pickUserAccount(function(result) {
  if (result.token && result.email) {
    // returns the email and token which can be used for further queries against the 
    // google api
    sendDataToServer({provider: 'google', email: result.email, code: result.token});
  } else {
    handleBadPost();
  }
});

About

A simple utility to perform single sign on in a Titanium Alloy app using Google's Account Manager on android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published