RoR Facebook Canvas App user Registraton & Login - ruby-on-rails

I'm currently working on a RoR app that is only going to be used inside the Facebook Canvas. To model the users I use Devise. Now, I'm aiming at making the signup & login process easy as pie. If my prospective users open the app, he/she should be prompted to authorize the app to access name and email. If this happens a user should be created with the name, fb_uid and email. Every time this user now comes back to the canvas app he should be signed in.
How do I accomlish this?
Please help - looked at koala, omniauth, the javascript and php sdks -> my brain just feels fried...

This railscasts episode shows you how to easily put together the authentication system using omniauth-facebook. I actually just used it today as well. Let me know if you have any more specific questions.
http://railscasts.com/episodes/360-facebook-authentication

Related

Instagram Authentication Page Doesn't Auto Redirect When The User Is Logged In on Another Tab

I did my best to find a similar problem, but I did not come across one. I speculate this error may have been introduced with Instagram recently changing its API. I'm wondering if anyone else came across the same issue.
I use instagram for authentication. The problem is that, when a user is logged in to Instagram on another tab, if he clicks the instagram sign-in button to log in to my app, he lands on the instagram authorization page and is asked to enter username and password. The problem is that instagram is supposed to auto-redirect to my app directly since the user is already logged in on the browser. But this doesn't happen. Moreover, even if the user enters wrong password or empty user name, instagram still redirects to my app with the logged in user. So the browser definitely knows that the user is logged in to instagram. I am quite sure that the problem is related to instagram, because when I change the provider settings to twitter, redirection occurs with no problem.
And this problem occurs for returning users as well.
For reference, I use rails 4 and my authentication strategy is omnioauth-instagram (no devise). I mainly followed this tutorial http://www.sitepoint.com/rails-authentication-oauth-2-0-omniauth/ for authentication. I am still in development mode so I use localhost.
EDIT: Here is the instagram notice:Instagram Platform and documentation update. Apps created on or after Nov 17, 2015 will start in Sandbox Mode and function on newly updated API rate-limits and behaviors. Prior to going Live, and being able to be used by people other than the developers of the app, these apps will have to go through a new review process. Please read the API documentation or the Change Log for more details.
I started creating my app before nov 17th.

Can i add only a login function to my app? Swift/Parse

I have an app in which i want to only add a logIn button. No signUp.
I am thinking of it like this please tell me if this can work?
SaaS based. So if a business wants to use app, they must sign up on website.
once they do, they can download app where i will give them their logIn Credentials.
Therefore if someone downloads my app from the app store they cannot register unless they are a SaaS customer. Only LogIn with the credentials i provide after signing up and paying for the service.
This being said, if this is doable. i used the parse swift signup code to get my classes working on parse.com
If i go into the users class, i can add new usernames and passwords. (Great!)
If i delete the SignUp code now from my app, and add the LogInUserinBackground code will it still work for logging in users so long as i add their credentials on the Back-End?
Thank you for all responses! Much Appreciated.
Yes, that can and will work.
You can of course remove the ability to create users via the app and only support the creation via the application. Just set the user up via the website, assign the username and password and you are ready to go. Of course you have to create some kind of login form inside the app - what you cannot do is customize the application one user downloads to one specific SaaS customer so that he gets logged in fully automatically. At least once the user has to enter the user credentials in the app.
And as far as I am informed that is even allowed by the app store guidelines - you only have to make sure apple gets a demo account when submitting the app in the end.

rails app with a login via google+

Is it oauth I am thinking of when I see apps even like stack overflow let you login via google. I want a rails app that doesn't require all this fancy sign up but to have users that bind uniquely to data in the app. Just not sure the terminology I am looking for. Basically an app that once you log in using Google knows you've "logged in" and can store work done in the rails page to your account id. I saw something like this:
https://github.com/zquestz/omniauth-google-oauth2
I think this is what I want. Basically log into app with an account you have or set up somewhere else just so I know you are an unique user and can bind data to you.

IOS: Registering new app on Facebook

There must be an easy answer to this one....
I am trying to integrate my latest IOS App to Facebook. I have not used Facebook before, so just set up a "company" page with basic information on my firm.
I'm following all the Facebook links i.e. https://developers.facebook.com/docs/mobile/ios/build/
But I cannot get beyond Step 1 (LOL). Whenever I click the link "Step 1: Registering your iOS App with Facebook," it keeps taking me to my company's Facebook Admin screen!? I cannot find a way to register my App off this screen. Where is the "Add new app" link??
I'm going in circles. Help appreciated.
It's not possible to register an App under a Business account, and you have to create (or lend) a personal account. And keep in mind: Facebook frowns upon incorrect information, so should be a legit person or your account will be suspended when (not if) they find out.
Secondly you have to authorize your Facebook account. For example: by entering mobile phone no. and entering code from a text FB will send you (more info: http://www.facebook.com/confirmphone.php) or entering CC information (more info: https://secure.facebook.com/cards.php)
When you (finally) have an authenticated account:
https://developers.facebook.com/apps Is the location you should be looking at.
Over at http://developers.facebook.com/docs/opengraph/tutorial/ Step 1 describes the creation of a Facebook App. (rather simple, by clicking on "Create New App")
Hope this helps! Good luck!
I believe the problem is that you are attempting to create a Facebook App with your "page user". IE you clicked "Use Facebook as..." and clicked on one of your pages.
You can not create an application in this way. Applications must be created by "real" users. You're going to want to follow that tutorial you posted to and use your user.
If you are hesitant to use your own account, ask your boss to use his or request from your clients login credentials to open the application on their account.
The reason behind this is so that Facebook can track "bad" applications back to real people, people who had to verify their account by submitting a mobile phone or credit card number.

In rails, how can I import a user's facebook contacts when they sign up?

I have a signup form, and I wanted to make it so that they have the option of recommending this signup to all their friends in facebook.
Is there a rails API/gem for doing this?
Is there an appropriate name for this?
Thanks!
Looking at the Extended permissions documentation, you don't get access to the email addresses of a Facebook user's friends (search for email and note the second column reads not available). If that's what you're trying to achieve, it's almost certainly not possible, without the user contacting each friend and asking them to visit your app (which I would imagine would have quite a low take-up, if only through inertia).
I guess you have two options:
popup a javascript before submitting the form to prompt the user wether he wants to share it with friends. You will use the js api http://github.com/facebook/connect-js (see the dialog section). This solution would avoid doing server side connection to the facebook api
Have a look a the Facebooker gem to do a stream_publish

Resources