Facebook Login with Blackberry Webworks - facebook

So I'm trying to build a Blackberry Webworks that integrates with Facebook.
I'm trying to use the Javascript API provided by Facebook, but I'm having some issues with logging in.
The typical "FB.login" function creates a popup, and this doesn't show up on a Blackberry so using that is no good.
Another issue is that I have no idea what to set as the redirect_url for the oauth login, because Webworks pages are referenced locally (local://index.html), and the API rejects this as a valid url. (I've also tried just index.html, but this also causes an error)
And finally, I have no idea what to use for the Mobile Website URL on the Application settings and not sure what other settings to use. Since users will be coming from a Webworks app, Facebook is rejecting login requests if I try to call the oauth url directly. (191 Error).

I figured out the only viable way to do this is to have a web server that will go through the OAuth2 authentication process documented by Facebook.
What you can do in Blackberry is open a new window or to use a Blackberry BrowserField that links to the web server, that way, your page will be able to get the oauth token that you can use to make Graph API calls.

Related

Facebook Javascript SDK with Mobile

I have a working Facebook web application built with angular that uses the Javascript SDK in order to login into my app, and that works fine on desktop/laptop computers.When I tried to login with my smartphone, it would not open the login window.
What would be the best approach to bypass it?
I was thinking about using the manual login flow with OAuth and then pass the user token from the server to the client in order for it to make the regular calls.
Would that be a good strategy?
If so, does it makes sense to set a user token in the Javascript SDK so I can use it?
(e.g, FB.ui(), FB.api() calls)

Third party OAuth inside Chrome App

I am developing a Chrome App which requires the user to authenticate against a third party website for OAuth (for e.g Twitter).
I want to be able to
Open the OAuth URL from the Chrome app.
Detect if the user has authorized and got redirect to my "redirect" URL (detect the tab is closed?)
Fetch the access token from the redirected URL in the Chrome app.
I am unable to think of a way to do this? Can someone help.
chrome.browser.openTab with callback URL localhost, where you run a local webserver, I could see being an option.
But I think the simplest and recommended solution would be to use chrome.identity.launchWebAuthFlow. Here is an example with facebook oauth flow on Github

hello.js facebook login redirect uri not supported, app ID invalid

I'm building a mobile app using Intel-xdk along with hello.js (a client side javascript sdk) for facebook login because it's the only thing that makes fb login work for me on Intel.
The hello.js instructions were hard for me to figure out even though they seem simple.
This is the init code as provided by the hello.js documentation. https://adodson.com/hello.js/
hello.init({
facebook: ************,
windows: WINDOWS_CLIENT_ID,
google: GOOGLE_CLIENT_ID
}, {redirect_uri: 'index.html'});
I need to note that I'm testing this on the intel-xdk emulator, on my iphone, and on the chrome browser. I am getting two different errors depending on where I test. I get either "app ID invalid", or "redirect uri not supported". Is there a different way I should be writing the redirect uri.
***UPDATE****
I got rid of the "windows" and "google" properties because I'm not using either of them for login. I also swapped "google" into the redirect uri. It didn't work when I used www.google.com, but DID work when I used https://www.google.com. So I think using "https" matters. This is what this init code block looks like now:
hello.init({
facebook: '178363645852696'
}, {redirect_uri: "https://www.google.com"});
Here are the different errors I'm getting now. On the intel-xdk emulator it goes right to google no problem. On the device it tells me I'm not logged in ( which isn't true). On chrome the message in the pop up window says this :
Given URL is not whitelisted in Client OAuth Settings: This redirect
failed because the redirect URI is not whitelisted in the app’s Client
OAuth Settings. Make sure Client and Web OAuth Login are on and add
all your app domains as Valid OAuth Redirect URIs.
I will continue to work on this and update my solutions, but additional solutions are wanted.
The sdk you are using is for websites not for cordova apps.
If you have code locally and building app using intel-xdk, then using a facebook cordova plugin is best solution, here is tutorial on how to get facebook API working in intel-xdk:
https://software.intel.com/en-us/xdk/article/facebook-connect-plugin-android-ios

How to open the Facebook app during OAuth in Ionic?

I just got my app working with $cordovaOAuth from ng-cordova and I've read and understood all from Nic Raboy's post (http://blog.ionic.io/oauth-ionic-ngcordova/). It works fine: both the inAppBrowser and the authentication itself.
But I want to take it one step further: how can I redirect the OAuth call to the installed app itself? For example, if I was using Facebook OAuth, how can I open the actual Facebook app (if installed - how to check it?) instead of a browser?

meteor - phonegap facebook oauth

so i have a meteor app, and i'm using facebook login (and google etc) for user authentication.
and i'm using MeteorRider which is basically "hijacking" the DOM from my meteor app, this way i get also a phonegap app.
So when using web and clicking on the facebook login, its working great.
but when using the phonegap app, its not working. its making an ouath call (opening a browser and do all the process but does not automatically close the browser and bring up my app) but then redirect to my app in the browser.
i'm still trying to figure how the two works with each other.
do i need to do this authentication using phonegap api or should i handle it using meteor api?
I use this for any oauth requirements in phonegap. https://github.com/oauth-io/oauth-phonegap
It handles closing of the browser etc.
I just released a package to fix this. It uses the InAppBrowser plugin to load the popup, listens for the auth token, closes the popup and logs in/creates account.
https://atmosphere.meteor.com/package/phonegap-oauth