Omniauth Google Account UID? - ruby-on-rails

I'm using the omniauth gem so people can log in to my site with their google accounts. I have it working with facebook and twitter but I for google accounts I can't extract the UID properly on the callback.
For Facebook & Twitter I can use:
#user.uid = auth["uid"]
But this gives me:
https://www.google.com/accounts/o8/id?id=gXtgsdgirhGugasuzdg-asdhuzigaoWV1kgo
When I try to use a google account. I also can't work out how to get a photo.
Thanks!
Alex

What it gives you is in fact the UID for your user. It is his unique OpenID URL that he is identified by.
Twitter and Facebook use OAuth, Google uses OpenID. If you want the user's e-mail address, it will be in auth["user_info"]["email"].

Related

Is it possible to make a Social Sign Up with Twitter Account?

I am using HybridAuth on my project and added Facebook, Twitter and LinkedIn social providers in order for the user to be able to sign up/ sign in.
What I have encountered is that Twitter API does not return the users' email. Thus the user obviously can't sign up with his Twitter account.
Furthermore if the user has logged out - he can't even sign in with his Twitter account if he hasn't connected it to your application account, because the Twitter API won't use the email for searching the user in its' database. In order to be able to use Twitter Sign In, the user has to be signed in to your app and connect his Twitter account.
Is there anything I am missing and there is an actual way to Sign Up with Twitter?

Parse - Linkedin Connect

I'm trying to build an iOS app with Parse using a Linkedin Connect.
User taps connect with Linkedin button and authorizes app
Redirected to the app
Need username, email and password to create PFUser
Has anyone found a way to create PFUsers using Linkedin data without asking for a password, and make the flow very similar to a Facebook Connect?
Parse has offered APIs supporting logging in with twitter and Facebook. Since it has no direct support in Parse SDK. I think you have to make everything yourself. Maybe try to get the user's email from the linkedIn account and log in with this email as username.
Parse.com now offer a generic OAuth library with a tutorial for authenticating GitHub accounts.
https://parse.com/tutorials/adding-third-party-authentication-to-your-web-app
This can help you : https://github.com/ahmetkgunay/LinkedinIOSHelper
This Library has features like authorizes app, getting access token, login with linkedIn, getting user's all informations, autoLogin if the accessToken is still valid.
This repo may help you : https://github.com/alexruperez/PFLinkedInUtils
It provides utility functions for working with LinkedIn in a Parse application. If a _User with the LinkedIn id is found in Parse, it will retrieve the user. Otherwise a new _User will be created and sign up.

FHSTwitterEngine get stored account

I use FHSTwitterEngine for twitting from my app. I know i can use XAuth and OAuth to login twitter account, but I'm wondering if is there any way to login by getting Twitter account assigned to iPhone. I mean that I can assign my twitter account in setting in my iPhone and some app get this stored data from settings and can login user basis on it. Is this feature avaiable under FHSTwitterEngine?
Since it doesn't require/import Social.framework or similar, FHSTwitterEngine does not support iOS Twitter accounts.
Social.framework allows posting to twitter/facebook, but does not offer any information like OAuth tokens to log in outside of it.

Display Twitter Feed of user

I wanted to display twitter feed like in image
Is it necessary to do "OAuth" for this?? I am trying to do "OAuth" in using this url.
It is giving:
Access denied Sorry, you're not allowed to access that page.
Twitter feed should be of user which i will give username not who are logged in simulator or device. I am following this tutorial
"Twitter offers applications the ability to issue authenticated requests on behalf of the application itself" https://dev.twitter.com/docs/auth/application-only-auth
You can use - AFTweetFetcher - "Simple class for retrieving tweets from twitter using their new 1.1 API without requiring the user to authenticate or have a twitter account stored on their device"
All you need: ConsumerKey and ConsumerSecret
Yes, you need to authenticate.
Try this library https://github.com/nst/STTwitter if you don't want to use Apple's Twitter frameworks as this would require the user of the phone to have a twitter account.

Auth to twitter with login/password

I'm currently using OAuth to authenticate people with their twitter (twitter gems) acount in my application. The problem is that for people who aren't connected or who have various accounts.
So that's my question, is that possible, to ask user their login/password to link their twitter account on my application ?
Thanks
It is no longer possible to connect to Twitter's API using Twitter credentials. Twitter's public stance on this is that you should -never- provide your Twitter credentials to anyone else, ever. This is part of their rationale for implementing OAuth.
Even if you had the user's Twitter password, you couldn't validate that it was actually their password, nor could you access their Twitter account with it through the Twitter API.
Your best bet would be to look into devise and omniauth. I've gotten it to work this way. Omniauth also allows to link to several accounts. Be it, Facebook, Twitter, etc.
I'm sure it's entirely possible to ask users for their Twitter login/password on your application. It's a very bad practice though, as OAuth avoids the need for client applications to ever touch a users credentials. I suggest setting up an authentication/authorization system that maintains a login/password and then allows connecting multiple OAuth accounts via an AuthenticationStrategy model or the like. Ryan Bates did a few Railscasts on the subject:
http://railscasts.com/episodes/235-omniauth-part-1
http://railscasts.com/episodes/236-omniauth-part-2

Resources