Export to GitHub

gwt-oauth2 - issue #7

Need JS code for oauth2


Posted on Aug 31, 2011 by Helpful Dog

Which OAuth2 provider or API service? FACEBOOK, GOOGLE,

External references, such as API reference guide? SAME

Please provide any additional information below.

Hi, you can send me a sample code that performs authentication using sites like Facebook and Google?

Have an example written in JAVA. Samples on: http://gwt-oauth2.googlecode.com/svn/trunk/samples/multi/demo/Sample.html

I need this example in jQuery/JS language, I'm also using ASP.NET.

Regards, wizardnet972@gmail.com

Comment #1

Posted on Aug 31, 2011 by Helpful Giraffe

I've got a change in the works to make the necessary functionality available to pure JS and to have the GWT compiler package it up as a single JS file. The change also includes sample code for calling from JS.

Comment #2

Posted on Aug 31, 2011 by Helpful Dog

Cool. I can not wait:)

I downloaded the files of example, and it works great.

Is it possible to know whether there is a connection to one of the sites? When loading the page?

Something like:

$(function($) {

var isConnected = auth2plugin.getSessionState();

});

Comment #3

Posted on Aug 31, 2011 by Helpful Giraffe

There is not currently a way of querying the library for whether or not a token is stored for a particular service, though it shouldn't be difficult to add.

Filed as a separate bug: http://code.google.com/p/gwt-oauth2/issues/detail?id=8

Comment #4

Posted on Sep 20, 2011 by Helpful Giraffe

Fixed in r36

There is now a single JS download that you can use outside of a GWT application, that provides all the methods available to the GWT library. You can find that script here: http://gwt-oauth2.googlecode.com/svn/trunk/script/gwt-oauth2.js

I'll write up a doc about how to use it, or you can check out the sample code: http://code.google.com/p/gwt-oauth2/source/browse/trunk/samples/script/ScriptSample.html

Status: Fixed