Problem with WebBrowser and OAuth 2.0

64 views
Skip to first unread message

diegosa...@gmail.com

unread,
Dec 17, 2013, 4:20:32 PM12/17/13
to codenameone...@googlegroups.com
Hello guys,

I'm facing difficulties with OAuth 2.0 and WebBrowser.

I've tried use OAuth2 class without success
[code]

Oauth2 oauth2 = new Oauth2(SALESFORCE_URL_AUTHORIZE, CONSUMER_KEY, "https://login.salesforce.com/services/oauth2/success", "refresh_token");

oauth2.showAuthentication(connectionListener);

[/code]

Then I tried with WebBrowser class

[code]

final WebBrowser wb = new WebBrowser();

String URL = SALESFORCE_URL_AUTHORIZE;

String params = "?response_type=token&client_id="+CONSUMER_KEY+"&display=touch&scope=refresh_token&redirect_uri="+RETURN_URI;

URL = URL + params;

Log.p(URL);

wb.setURL(URL);

[/code]


In both cases, I've this messages at console:

Attribute 'Http-equiv' is not supported for tag 'meta'.

Attribute 'Content' is not supported for tag 'meta'.

The tag 'script' is not supported in XHTML-MP 1.0

XML document contains multiple root elements, only the first root (html) will be used. Excessive roots: Text ( )

no BODY tag was found in page

It's strang, because the response is an empty HTML.

What I'm doing wrong?

Thanks!

diegosa...@gmail.com

unread,
Dec 17, 2013, 4:24:19 PM12/17/13
to codenameone...@googlegroups.com, diegosa...@gmail.com


On Tuesday, December 17, 2013 7:20:32 PM UTC-2, diegosa...@gmail.com wrote:
Hello guys,

I'm facing difficulties with OAuth 2.0 and WebBrowser.

I've tried use OAuth2 class without success
 

Oauth2 oauth2 = new Oauth2(SALESFORCE_URL_AUTHORIZE, CONSUMER_KEY, "https://login.salesforce.com/services/oauth2/success", "refresh_token");

oauth2.showAuthentication(connectionListener);



Then I tried with WebBrowser class

final WebBrowser wb = new WebBrowser();

String URL = SALESFORCE_URL_AUTHORIZE;

String params = "?response_type=token&client_id="+CONSUMER_KEY+"&display=touch&scope=refresh_token&redirect_uri="+RETURN_URI;

URL = URL + params;

Log.p(URL);

wb.setURL(URL)


Attribute 'Http-equiv' is not supported for tag 'meta'.

Attribute 'Content' is not supported for tag 'meta'.

The tag 'script' is not supported in XHTML-MP 1.0

XML document contains multiple root elements, only the first root (html) will be used. Excessive roots: Text ( )

no BODY tag was found in page


 

In both cases, I've this messages at console:

It's strange, because the response is an empty HTML.

Shai Almog

unread,
Dec 18, 2013, 12:27:25 AM12/18/13
to codenameone...@googlegroups.com, diegosa...@gmail.com
Hi,
did you look at https://code.google.com/p/codenameone-sfdc-lib/

It seems like you are running under an older JDK or one that doesn't have JavaFX enabled. You need to enable the JavaFX runtime in order to get the native WebKit browser window embedded into the Codename one simulator.

diegosa...@gmail.com

unread,
Dec 18, 2013, 6:32:40 AM12/18/13
to codenameone...@googlegroups.com, diegosa...@gmail.com
Hi Shai,

I'll install jdk7 and try again.

Thank you!

diegosa...@gmail.com

unread,
Dec 18, 2013, 6:47:43 AM12/18/13
to codenameone...@googlegroups.com, diegosa...@gmail.com
It worked! Thank you :)


On Wednesday, December 18, 2013 3:27:25 AM UTC-2, Shai Almog wrote:
Reply all
Reply to author
Forward
0 new messages