Skip to content

Instantly share code, notes, and snippets.

@jthomas
Created April 16, 2012 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jthomas/2401041 to your computer and use it in GitHub Desktop.
Save jthomas/2401041 to your computer and use it in GitHub Desktop.
Authenticating user to access restricted feeds
<html>
<script src="./lib/require.js"></script>
<script>
require.config({
paths : {
//create alias to plugins (not needed if plugins are on the baseUrl)
async: 'src/async',
goog: 'src/goog',
propertyParser : 'src/propertyParser'
}
});
//use plugins as if they were at baseUrl
require(['goog!gdata,2,packages:[calendar]'], function(){
console.log("checking auth. status... ", google.accounts.user.checkLogin("https://www.google.com/calendar/feeds"));
});
</script>
<body>
<button onclick="google.accounts.user.login('https://www.google.com/calendar/feeds');">Authenticate</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment