Will Facebook's manual login flow allow a mobile webview to automatically launch Facebook's native app? - facebook-graph-api

I've successfully implemented Facebook login with their Javascript SDK but was hoping that when used on mobile, the native Facebook application would launch. Will going through the manual flow here allow this behavior? This question seems to say otherwise but was vague.
I want to avoid using Android and iOS mobile SDKs because my situation is basically an OAuth within an OAuth and it would get messy. Any other approaches people think could work like redirect URIs or other OAuth magic would be really appreciated.

Related

Authentication using Glass

We have an existing Android and iOS application that consumes REST API from our servers. The API provides a token to the authenticated users after they log in using their credentials (username, password combo.) from the mobile applications.
Now, we're planning to create a Google Glass application for the same. In this case, we'd like to use the existing REST API along with Glass also. The Glass app will be built natively using the GDK.
My concern is, how would the users be able to input credentials? Because, users may have signed up for the service using non-google accounts?
Many thanks in advance.
At the moment, there is no supported way for apps made with GDK Early Access to authenticate the user or provide a way to connect the Glass account to your auth system. The Glass team has indicated such methods are coming, however - the Strava Cycling app, for example, does this, and it is expected that a similar feature will become widely available as the GDK matures.
Strava Cycling appears to get its credentials at the time you setup the app through MyGlass. When you turn it on it redirects you to a website to log into Strava's service before completing the install.
I just gave a talk on this exact topic at Wearables DevCon. The solution I proposed is purely done through GDK. All the user has to do is sign into their Google Account on a phone/tablet/computer and enter a code that is shown on Glass.
Check out the slides here:
https://docs.google.com/presentation/d/1NepYwlKdEvLV0QH9ix2I8l-JY1kHjBR9AXKBNpgTI6g/edit
And the code here:
https://github.com/victorkp/GlassWebNotes
The latest Glass release (XE16) publishes the remote authentication API for apps distributed through MyGlass:
https://developers.google.com/glass/develop/gdk/authentication

How to deal with oAuth callbacks to non webservers?

I'm currently building an oAuth2 server so that external clients/devices can access data from my service without having to send over user credentials with every request. I've finally grasped how oAuth works after spending an entire day reading numerous tutorials and online documentation, however, there's still one thing that I'm rather unsure of...
When sending a request for an authorization code to an oAuth server, how should I deal with a callback to mobile devices and devices that aren't a webserver?
E.g. this request to my oAuth server will send an authorization code as a callback to a specified webserver (http://client-url.com in this case)
http://mydomainname/oauth2/?client_id=test&grant_type=authorization_code&client_details=test&redirect_uri=http://client-url.com&response_type=code
The server at http://client-url.com will receive a response containing an authorization code and the developer will be able to store a user's oAuth credentials accordingly.
Obviously a mobile device isn't a webserver, so is there a standardised way of dealing with this? I've read online that you can define something called a custom URI scheme within iOS and Android apps. But what about the other mobile platforms out there? And desktop apps? I want my API to be accessible from as many platforms and devices as possible.
The reason why I'm asking this question is because I want to add validation to my oAuth server so that users can only register apps with valid callback URL's. I wasn't sure if should allow any other type of input as a callback apart from a valid URL.
Can anyone shine any light on this? I want to avoid spending hours validating and testing this across all devices as I'm sure anyone that has developed for multiple mobile platforms in the past must have some knowledge about this.
Thanks in advance.

Facebook app requesting Youtube watch history

We are working on an idea of a FB app which let's us retrieve youtube watch histories of app users.
I know there's the possibility to retrieve watch histories through youtube's api, but in combination with a FB app I couldn't find examples.
Any input on this is much appreciated, thanks!
These two are orthogonal. Since you didn't specify a language, I'll assume you're using Python.
Write an FB app using Canvas to display output to users ... I assume you are using Canvas.
Use the YouTube API and Python client to make API calls. You'll need to use a database or some other storage engine to link a user's Facebook API auth token with their Google auth token. Both are using OAuth 2.0 (though they are different flavors), so once you learn one, the other should be easy.
Before I answer anymore questions, it's probably a good idea for you to work through the getting started guides for both Facebook's API and YouTube API first. After you have some understanding of both, pick a stack and you should more or less be ready to go.

Sample of using Facebook Connect with MonoTouch

I'm using MonoTouch (latest version) and I want to be able to allow the user of my app to make a wall post based on a log entry made in this app. All I need is a simple implementation so that the user can tap "Share on Facebook" (UIActionSheet) and then it logs them into Facebook (shows the login) and returns the token which I can then use to make the WebRequest to post to their wall.
I've seen the MonoTouch bindings on github but have no idea how to use it. Can someone please provide a simple sample of how to just login to Facebook to retrieve a token so I can post. I know how to do the post, it's the auth process that I'm not getting right.
Thank you.
Neal
Neal,
I have added a sample that replicates about half of the Facebook sample here:
https://github.com/mono/monotouch-bindings/tree/master/facebook/sample
I would recommend to use client-side javascript login more than native device login.
Sooner or later you might want an Android, Windows Phone or even Facebook version.
Having an In-App browser wrapper to deal with javascript and direct Graph API calls are easier for cross-platform implementation. Just from my personal experience.

Create Facebook wall post from embedded application

I'm working on a project where I want to post a wall message to the users Facebook page but the problem is that the program will run on a very limited system and the only way I have to talk with Facebook is via sockets in C/C++.
Anyone have any code examples of how to do this?
Asking for the username/password is no problem so I will have this but I would also like to be able to do all this without them having to add a application to there Facebook page.
All documentation on Facebook.com is for when you can show a web browser but there must be some way you can do this, right?
/Viktor
sockets <-> Facebook?
the right way to do that is using facebook's REST api or CONNECT. You could try to use oauth2 to authenticate and then make http calls. You can try to use curl. I don't think you can use sockets unless you are inside facebook's layer.