omniauth

Rails omniauth - twitter asking for app authorization each time user logs in

China☆狼群 提交于 2019-12-03 04:47:14
In Railscast: http://railscasts.com/episodes/241-simple-omniauth Ryan uses omniauth for logins. In the video when he clicks on the login button the first time Twitter asks the user if they would like to authorize Ryan's app. The second time the login button is clicked it automatically logs the user in. In my application, the user is forced to authorize my app each time. If the user is logged into twitter and has already authorized the app, then shouldn't it "just work"? EDIT: my app currently has Read, write, and direct message permissions. I'm also using omniauth-twitter (0.0.6). arunagw Ok

get user profile large picture from facebook with omniauth in devise 2.0

谁说我不能喝 提交于 2019-12-03 04:17:54
问题 I want get the user profile large or normal picture from facebook. Now I get the square version from user profile picture with this code: :image => access_token.info.image # http://graph.facebook.com/id/picture?type=square How can I get the large or normal versions? Or and the app, How can I replace in this url the last word, large instead square... Thank you very much! 回答1: Below are the 4 Different Size of profile pictures that is allowed by facebook. http://graph.facebook.com/id/picture

Create named routes for OmniAuth in Rails 3

北慕城南 提交于 2019-12-03 03:39:51
After having watched Ryan's excellent Railcast Simple OmniAuth , I've managed to implement authentication in my app. Everything is working fine, but in my view I have links that look like this: <%= link_to 'Sign in with Twitter', '/signin/twitter' %> <%= link_to 'Sign in with Facebook', '/signin/facebook' %> I was wondering if there is an elegant way to create a named route to replace that with: <%= link_to 'Sign in with Twitter', signin_twitter_path %> <%= link_to 'Sign in with Facebook', signin_facebook_path %> or: <%= link_to 'Sign in with Twitter', signin_path(:twitter) %> <%= link_to

SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A - Faraday::Error::ConnectionFailed

独自空忆成欢 提交于 2019-12-03 03:07:14
I've seen many answers here, but none of them has worked. I'm using omniauth-oauth2 gem to integrate with a third-party customer. I'm using the setup phase described here but I'm always getting this error: Authentication failure! failed_to_connect: Faraday::Error::ConnectionFailed, SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A Faraday::Error::ConnectionFailed (SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A): .rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect' .rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in

Which Ruby gems support the Facebook API?

我的梦境 提交于 2019-12-03 02:46:45
问题 I have a rails application using the Facebook API. I've seen several different Ruby gems for integrating with Facebook, but they look dated. Is it best to write low-level calls myself? Is there a decent and current gem available? Have any of these gems changed recently? I'm beginning a new project -- which gem should I use as of September, 2012? 回答1: The Koala Gem is the way to go. These Railscasts from July will tell you all you need to know about interacting with the Social Graph in Ruby

OmniAuth::NoSessionError - You must provide a session to use OmniAuth. (configured in devise)

最后都变了- 提交于 2019-12-03 02:26:55
Hi I am learning how to use omniauth as backend for ember app. when i run my application I get the below mentioned erroe OmniAuth::NoSessionError - You must provide a session to use OmniAuth on resue rails s my applicataion halts at line below. 172: def call!(env) # rubocop:disable CyclomaticComplexity 173: unless env['rack.session'] 174: error = OmniAuth::NoSessionError.new('You must provide a session to use OmniAuth.') => 175: fail(error) 176: end 177: config/intializer/devise Devise.setup do |config| config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' require

Authenticate user using omniauth and Facebook for a rails API?

◇◆丶佛笑我妖孽 提交于 2019-12-03 01:43:27
问题 I'm building a Rails API and have successfully built a way for a user to authenticate using Omniauth Identity. We simply post to auth/identity/callback from the client, passing in an auth_key and password. The server then returns a doorkeeper token that the users then uses from then on to access the app and identify themselves. This diagram illustrates this: We'd now like to implement a Facebook login from the client, but are having trouble making it work, both theoretically and practically.

OmniAuth Facebook expired token error

大兔子大兔子 提交于 2019-12-03 00:47:21
I am using OmniAuth to get access to Facebook in my app. I am using the fb_graph gem: https://github.com/nov/fb_graph to post to Facebook. I am running omniauth-0.3.0 on Heroku for this app. The token that I save when the user is created is changed when the user logs in sometime later. Code for creating user class SessionsController < ApplicationController def create auth = request.env["omniauth.auth"] user = User.find_by_provider_and_uid(auth["provider"], auth["uid"])|| User.create_with_omniauth(auth) session[:user_id] = user.id redirect_to root_url, :notice => "Signed in!" end The User model

Getting “Error: redirect_uri_mismatch” with google_oauth2

蹲街弑〆低调 提交于 2019-12-02 22:48:03
The URL's seem right (Last updated them yesterday): The files too: omniauth.rb: provider :google_oauth2, 'MY_CLIENT_ID.apps.googleusercontent.com', 'MY_CLIENT_SECRET', :scope => 'https://mail.google.com/mail/feed/atom/' Error: redirect_uri_mismatch The redirect URI in the request: http://localhost:3000/auth/google_oauth2/callback did not match a registered redirect URI header.html.erb <li><%= link_to "Sign in with Google", "auth/google_oauth2" %></li> routes.rb: match '/auth/:provider/callback', to: 'sessions#omniauth_create' But I'm getting this: > Error: redirect_uri_mismatch The redirect

Rails API: Authenticate users from native mobile apps using username/password or facebook token

牧云@^-^@ 提交于 2019-12-02 22:16:27
So I have been pulling my hair out for a few days now trying to figure out how to add username/password authentication to my rails mobile API. Here is a brief overview of my current authentication flow: User selects "login with Facebook" on the mobile client, client redirects to Facebook app and requests access_token On success, Facebook responds with the access token and the client redirects back to my app. The client sends the access token to my API My API uses the koala gem to check if the access token is valid. If the token is valid, Facebook sends the users data to the API where a new