Is it possible to force a login click?

397 views
Skip to first unread message

Rob

unread,
Nov 12, 2011, 11:37:58 AM11/12/11
to google-iden...@googlegroups.com
I can detect when landing on a protected page that the user is not logged in.  I want to forge the Sign In click so that the login popup launches.  Is this possible?

Rob

guibinkong

unread,
Nov 14, 2011, 2:02:51 AM11/14/11
to Google Identity Toolkit
Use jQuery('#navbar').accountChooser('showAccountChooser'); to call
the public method 'showAccountChooser' on the widget.
(See some description about the syntax to call public method on a
jQuery UI widget at:
http://stackoverflow.com/questions/1596137/how-do-i-reference-a-jquery-ui-widget-on-a-page-and-call-a-function-on-it
)

As result, your code should be something like below:
jQuery(function(){ 
window.google.identitytoolkit.easyrp.config.setConfig({
...............  });
  jQuery('#navbar').accountChooser(); ........   
jQuery('#navbar').accountChooser('showAccountChooser');});</script>

ifile.it

unread,
Nov 14, 2011, 10:01:46 AM11/14/11
to google-iden...@googlegroups.com
Yep its possible


any of the buttons on the page will launch the signin window

Rob

unread,
Nov 18, 2011, 9:26:50 AM11/18/11
to google-iden...@googlegroups.com
Thanks,

The call to jQuery('#navbar').accountChooser('showAccountChooser'); worked!

Thanks again,
Rob
Reply all
Reply to author
Forward
0 new messages