Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

bb-cascades-oauth : Can not get token

[ Edited ]

Hi all,

 

Anyone can help me with this case, I used bb-cascades-oauth library to connect with facebook, after login successful and accept permission page, the library could not get the token id, after debug, I see http request header does not have URL at GET command similar below. So the library always return login unsuccessful because could not get the URL to parse and then get the token.

 

GET /? HTTP/1.1
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8
User-Agent: Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2354 Mobile Safari/537.10+
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Host: localhost:54815
Connection: keep-alive

 

but I don't know why when I use native browser on Z10, the browser could get that URL.

http://localhost:54815/#access_token=XXXXXXXXXXXXXX&expires_in=XXXXXX

And then shown the error :

Server returned nothing (no headers, no data).

 

Please help me with this case, for the first time I could use it normally, after period of time, I tested it again and it occured above case.

 

Regards.

 

 

Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: bb-cascades-oauth : Can not get token

In general, oauth2 (what facebook uses) is very simple to use and you probably dont need bb-cascades-oauth. The library is more useful for oauth1. For facebook you can just put the login flow into a webview and then listen for the access_token on navigation in the webview and parse from there.
Like all of my posts
Highlighted
New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

Re: bb-cascades-oauth : Can not get token

Thanks kylefowler, I will try with your suggestion.