Sign in and sign up functionality using oauth - ruby-on-rails

Hello I want to perform functionality like sign in or sign up with facebook using oauth2.
I have generated the consumer controller for oauth and could successfully consume the services provided by facebook.
But now I want to have functionality of sign in and signup.
Im getting a error with this.
My control comes to the def load_consumer but from there it is not going in to def callback2.
If the user is already signed in then it works perfectly fine else it crashes.
And also I wanted to know when to use oauth provider and when to use oauth consumer.
Please if you find a proper documentation for this then please post it here.
Thanks in adavnace.

There's a live example of how to implement Facebook Login via the Temboo SDK here. The source code for that example is available on GitHub (in PHP) but you can easily generate the Ruby code you need to achieve the same behavior via the Temboo website, see link below:
https://www.temboo.com/library/Library/Facebook/OAuth/
(Full disclosure: I work at Temboo, so let me know if you have any questions).

Related

Issue with implementing "Login with Github" in iOS app

I am trying to understand how I can authenticate my iOS app using github. I understand from the documentation, that I need to implement this using OAuth.
I also understood that in my github profile, I need to register a new OAuth application, the form to do that looks like this:
I don't understand what info I have to provide for Homepage URL and Authorization callback URL as I am building an iOS app and not a webapp that is actually hosted on some server.
I would suggest trying FireBase. It has an infrastructure to enable GitHub login specifically. Also, there are sufficient examples to create the app.

Integrating twitter login in IOS

In my IOS app i Want to add twitter login in order to fetch the user's information like Name, Email ID and Profile picture.Can anyone please provide me some useful information or some tutorial link that can help in integrating twitter login in my app and to fetch user information.
If you're just trying to do some really simple login stuff and are new to iOS, I would definitely check out Parse's Twitter Login tools.
https://parse.com/docs/ios_guide#twitterusers/iOS
Really user friendly and simple to get the hang of.
If you want to add twitter login to your app in a simple way, I would recommend you to use Fabric framework. Follow this link: https://dev.twitter.com/fabric/ios
Note: You can't bring user's email easily. You need to get permissions from twitter by filling a form in twitter website or else by sending email to fabric team.
Twitter Kit provides all the required functionalities and mechanism for making authenticated requests to Twitter's REST API.
Follow the configuration process here.
Using TWTRSession, you can request for TWTRUser object and that will have what you need.
This is the right way and advisable one too.

Using Google + API and LinkedIn API within a desktop application (without prompting user for username-password)

I'm going to create a page which will download user's activity and save it in an .xml file because my iphone app needs to process it. The problem is that I cannot prompt the user for login-password... so I was wondering if there is a sort of permanent key that I can use to access into linkedin and gplus?
Thank you.
Google+
I can field the Google+ part of your question :)
You can access your users' public activity using the REST API's activity list method. To identify who they are you'll need to send them through an OAuth flow during which they will authorize you to know who they are on Google+.
The best way to get started doing server side OAuth flows in Google+ is to grab one of the starter projects and go through the included readme. That will give you a working project to copy code out of, or develop upon.
I'd include a code sample to show you how it works, but I don't know what would best apply to your back end :)
Linkedin
I'm far from an expert on their APIs, but it looks like the flow would be similar using OAuth.

Omniauth Tumblr setup: Where can i find the setup credentials?

I am using omniauth to register multiple user accounts from facebook, twitter and tumblr. I succesfully set up the connections to facebook and twitter, but i fail to connect to Tumblr.
The omniauth homepage on github tells me it does work with Tumblr, but does'nt supply me with any documentation on this provider.
I don't know what credentials i have to use for the initializers/omniauth file. I don't have any consumer keys/secret; Tumblr does not even supply these keys.
Ideas anyone?
It turns out Tumblr does have proper oauth 2 authentication. Strangely they managed to hide their application registration page. I couldn't find this page anywhere, not by googling 'Tumblr app registration' or anything. They don't even mention it in any of their api documentation (which I found pretty good on itself btw). It almost look like they do not even like 3rd party apps?
Eventually i found the registration page trough a php authentication tutorial. I will paste it here for future reference:
http://www.tumblr.com/oauth/register

RPXnow Facebook Connect - Use and Level of support?

I am using RPXnow.com authentication solution for a rails app and am now at the point of wanting to develop Facebook integration features using Facebook Connect and the client api. What I am unclear on from RPXnow docs is the level of integration their solution provides. When a user connects via rpx using their FB creds, are they now using Facebook Connect? Can I make calls to the client api from my app? Do I need to use the RPX api to access the FB client APIs?
Anyone with experience using both who can shed light here, much appreciated.
dnewman,
Great question. Facebook Connect is simply a javascript layer built on top of the Facebook Platform APIs. RPX uses the platform APIs to authenticate the user, and after they have signed in, you may safely use the native Facebook Connect javascript to implement FB specific features on your site like posting activity back to the News Feed. You just need to set your connect URL on the facebook developer site and drop in the Facebook Connect javascript and then start implementing. After authenticating via RPX, the user will already have approved and "connected" to your website, and you'll have access to the breadth of Connect directly.
Also, if you have an RPX Plus/Pro account you can make simple RPX API calls to set a user's status and post activity on Facebook (and Twitter/MySpace).
Brian Ellin
RPX Product Manager
Once you've hooked up RPXNow (JanRain) single sign-on, you can follow the Facebook documentation. The Server-side Personalization example is in PHP but the idea is the same in any language.
// Fetch the user's friends
$friends = json_decode(file_get_contents(
'https://graph.facebook.com/me/friends?access_token=' .
$cookie['oauth_access_token']), true);
$friend_ids = array_keys($friends);
The key point to note is that the $cookie['oauth_access_token'] referenced in this example needs to be the string returned by the RPXNow sign-on API response in the JSON field
['accessCredentials']['accessToken']
Hint: from your RPXNow dashboard, check out the Test Sign-In Widget page under Resources to see where that token is in the response.
Initially I thought this would be hampered by having your Base Domain set to rpxnow.com in your Facebook Application settings, but this is not the case. It works fine.

Resources