Dj-Corps / gwt-oauth2

Automatically exported from code.google.com/p/gwt-oauth2
Apache License 2.0
0 stars 0 forks source link

"Init" call to enable automatic login #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Perhaps this is already possible but not described in the docs. If the user 
selects "Remember Me" in the login popup there should be a way to login the 
user without clicking a button in subsequent visits-- redirecting if successful 
or doing nothing if not.

Example: 
<pageLoad>
var req = {"authUrl": GOOGLE_AUTH_URL, "clientId": GOOGLE_CLIENT_ID, "scopes" : 
[ PLUS_ME_SCOPE ]};

oauth2.Init(req, function(token) {alert("Got an OAuth token:\n" + token + "\n" 
+ "Token expires in " + oauth2.expiresIn(req) + " ms\n");}); 

For instance, MS's LiveConnect oAuth2 implementation works exactly this way. 
Init and Login where Init returns the token if the user is already logged in 
and Login tries to do the same thing but displays the login popup if the user 
is not logged in.

Original issue reported on code.google.com by cmoya...@gmail.com on 8 Mar 2012 at 3:59