Facebook login doesn't work inside Twitter iOS App - twitter

I have a RoR / JQuery Mobile app that uses Facebook OAuth for authentication. It all works fine when accessing it via any normal browser on desktop and mobile with one exception.
If a user clicks a link to the app within the Twitter iOS app the home page loads within an internal webview. If the user then clicks 'Sign In with Facebook' the authentication seems to be successful but when Facebook redirects the user back to the app the page never loads. It just displays a blank page and the network indicator at the top of the screen just keeps spinning. If I close the web view and click the link again the page loads fine because the user has already authenticated.
Has any one else had problems with Facebook Auth inside the twitter app on iOS? Any suggestions on how I can resolve this problem? Is it possible this is just a bug with the Twitter app on iOS?
Thanks

I believe I found the solution. The facebook authentication process used a lot of redirects which I thought could be causing the problem (5 in total). After reviewing the process I realised I could remove one of the redirects and take the user directly to the page I wanted once they were authenticated.
www.example.com (link from the tweet)
www.example.com/auth/facebook (use clicks 'Login with Facebook')
1 - Redirect to: graph.facebook.com/oauth/authorize
2 - Redirect to: www.facebook.com/dialog/oauth
3 - Redirect to: www.example.com/auth/callback
4 - Redirect to: www.example.com/entry_path (This has now been removed)
5 - Redirect to: www.example.com/final_logged_in_path
The login process now works from within the Twitter iOS App.

Related

iPhone OAuth login request redirects to App not Browser, doesn't work

My current scenario is:
Running an iPhone on the latest iOS
LinkedIn App is installed and logged in
Web browser is NOT logged into LinkedIn (because I have the app)
Developing a web app with "log in with LinkedIn" functionality
On the iPhone, clicking the "log in with LinkedIn" button redirects me straight the the LinkedIn App, which subsequently does nothing - just shows me my feed. I have verified this same behaviour occurs on a third-party site as well as my own. Note that Android exhibits similar behaviour, though I haven't tested as extensively there.
I've found several workarounds:
If I open the web site in Private Browsing mode clicking the login button asks me if I want to open the App or stay in the browser.
If I long-press and "Open in background tab" the login button it'll open (in the background, of course) instead of redirecting to the app, allowing me to log in.
If I manually type "linkedin.com" into the browser and log in then it seems to work too.
None of these are even vaguely practical for end users, essentially forcing us to remove the option entirely.
I'm fairly sure this is a problem at LinkedIn's end and the solution is either:
Don't redirect to the App for OAuth Authorize requests, or
Make the App correctly handle OAuth Authorize requests.
If I'm incorrect and there's some way we can stop this redirect from the client side I'd be happy to hear, otherwise I hope LinkedIn engineers actually see this...
See the comments in Issues with Linkedin Social connection
LinkedIn already confirmed that it is a problem on their side.

Twitter page in UIWebView redirects to 'sorry, that page doesn't exist' error

In an iOS app I allow users to tap a Twitter button that takes the user to a specific Twitter page in the Twitter app, if installed, else a mobile version of their Twitter page in a webview. Currently, the mobile version is redirecting to an error page. This is also happening in Safari, while the exact same URL works great from a desktop computer.
Open https://mobile.twitter.com/iamdevloper in a UIWebView or in the Safari iOS app
Notice redirect to https://mobile.twitter.com/error/generic
Did anything change in the structure of the url? Is it just broken right now?
This appears to now be fixed. Must have been a temporary bug while Twitter was making updates to their mobile site.

Google Plus not able to redirect to application after sharing in iOS

the issue is in sharing of some thing using google plus in iOS application. the login works fine of google plus in my and google provided demo.
when i implemented it back 2 months it worked fine but suddenly i checked it today it gives error.
1) when i try to share some thing it redirects me to safari as expected. in both case when i am trying to login.
2)but when i press share button it shows sharing dialogue and after that it redirect to new page and error comes like "about:invalid#zClosurez"
3)but when it opens safari for login and i authorise app and it redirect me to my app back perfectly.
4)sharing is working fine the things that user wants to share is shared but it does not redirect back to my app.
https://code.google.com/p/google-plus-platform/issues/detail?id=794&can=8&colspec=ID%20Type%20Status%20Component%20Owner%20Summary%20Stars
click for detailed question
Thanks in advance
This was a bug Google's side with the page that was redirecting the user back - it was fixed in a release this week, so you shouldn't see the issue any longer.

How do I prevent the facebook login page from taking over my home page app?

I have a iPad home page app that I'm trying to integrate a facebook like button. Everything works fine if the user is already logged in, but if the user is not logged in the facebook login page takes over my app page and after login does not return to my app. Is there a way to make facebook login using an iframe?
My app is a web app not a native IOS app. It is setup with a manifest file and the user adds it to their home page. Because the app can have different URLs and all we want to do is provide like functionality, registering the app is not available to me.
What I want to know is there a way for facebook to open the login page in an iframe like the like dialog when the user clicks the like button? Right now I'm using the social plugin for the like button, but if the user isn't logged in to facebook the login page replaces my web app. Is there a way to make the login page use an iframe?
Wrapping it in a <div> worked for me

Deep link into a Facebook canvas app

I am embedding a Facebook app https://example.com into the Facebook app canvas so that it is available at https://apps.facebook.com/EXAMPLE . My application sends notification emails that contain links like https://example.com/messages/123 and that should open the page embedded into the Facebook canvas. How do I achieve this? My current thoughts:
User opens https://example.com/messages/123
Application checks for signed_request parameter
Application redirects user to https://apps.facebook.com/EXAMPLE/?requested_page=/messages/123
Application checks for requested_page parameter and redirects to this page
User sees https://example.com/messages/123 URL and is embedded into canvas
Is there a better pattern out there to get this working?
My final working solution (with Ruby on Rails)
User opens https://example.com/messages/123
Application checks on client-side if app is embedded in canvas:
if(window == top){
top.location = "https://apps.facebook.com/#{Settings.facebook.app_id}#{request.fullpath}";
}
User is redirected to https://apps.facebook.com/EXAMPLE/messages/123
Application middleware converts POST into GET if signed_request is present (code and idea borrowed from https://github.com/dekart/facebooker2/blob/master/lib/facebooker2/rack/post_canvas.rb)
Application parses signed_request with fb_graph gem
FbGraph::Auth.new(app_id, app_secret, :signed_request => params[:signed_request])
I'd just update the link to point to http://apps.facebook/example/messages/123 off the start.
When you check for authentication just set the redirect after authorization/login to the same page.
Redirecting a user around multiple pages for no reason is just not a good practice.

Resources