omniauth

Problem with Routes using Devise and Omniauth

余生颓废 提交于 2019-12-03 08:38:54
I am trying to get OAuth and Devise working together but I get Controller::RoutingError (No route matches "/users/auth/facebook/callback"): when trying to auth via Facebook. Weirdly, the problem doesn't happen with Google Apps. (same callback route). Any ideas? callback_controller: class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook # You need to implement the method below in your model @user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind =>

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

折月煮酒 提交于 2019-12-03 08:21:37
问题 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

Deprecated offline_access on facebook with RoR

强颜欢笑 提交于 2019-12-03 08:01:01
We have a problem in our RoR app. We are using a facebook authentication with omniauth, and searching the user friends with Koala. But lately, when we try to show a friend photo, we got this error: Koala::Facebook::APIError in Homes#show Showing /home/daniel/Homes/app/views/shared/_event.html.erb where line #19 raised: OAuthException: Error validating access token: Session has expired at unix time 1328727600. The current unix time is 1328802133. Extracted source (around line #19): 16: <img src="../assets/friends-icon.png" alt="User profile apicture" height="33" width="43"> 17: <% if current

omniauth-facebook cannnot get email address

为君一笑 提交于 2019-12-03 07:29:11
I created new Rails App and install Devise and omniauth-facebook gem. And setting my Facebook App, as testing environment. So, I logged in via facebook and signed up my new Rails app, but request.env did not contain email address.info. this is returned request.env['omniauth.auth'] { "provider" => "facebook", "uid" => "xxxxxxxxxxxx", "info" => { "name" => "xxxxxxx", "image" => "http://graph.facebook.com/xxx/picture" }, "credentials" => { "token" => "tokenstring", "expires_at" => xxxxxxxxx, "expires" => true }, "extra" => { "raw_info" => { "name" => "xxx xxxx", "id" => "xxxxxxxxx" } } } it racks

Has anyone used omniauth with rails 2.3.8?

女生的网名这么多〃 提交于 2019-12-03 06:45:31
I am new to Rails and I am trying to use omniauth with rails 2.3.8. I couldn't find any tutorial for this version of rails so I referred to http://blog.railsrumble.com/blog/2010/10/08/intridea-omniauth . I added the initializer as follows: omniauth.rb OmniAuth::Strategies::Twitter = { :consumer_key => 'xxxxxx', :consumer_secret => 'xxxxxx' } After this step if I try to hit the URL '/auth/twitter' then I get "No route matches "/auth/twitter" with {:method=>:get}". Has anyone used omniauth with rails 2.3.8? OmniOauth is a Rack::Middleware. So you need use it like that. So you need add like that

How can I specify the Facebook permissions (aka scope) OmniAuth asks for DYNAMICALLY?

荒凉一梦 提交于 2019-12-03 06:31:35
This question is similar to How can I specifiy what access I need from my user's Facebook accounts when using OmniAuth? but has a caveat. I'm using OmniAuth to authorize Facebook users on my website. For regular login/registration, asking the user for standard Facebook permissions are acceptable. But there is a feature on my site that requires extended permissions (access to their Facebook photos). I want to only ask for the extended permissions for users when/if they use our site's Facebook photo feature. All answers I've found on the web on how to set facebook permissions for omniauth deal

LinkedIn photo_urls or picture-urls::(original) not being returned

时间秒杀一切 提交于 2019-12-03 06:19:00
问题 So I am using omniauth and devise for LinkedIn authentication in my Rails 5 app. omniauth-linkedin-oauth2 (0.2.5) devise (4.4.1) Everything is working great for the most part and users are able to signup and authenticate using LinkedIn. However the default image that is returned in "auth.info.image" is 50x50 which is too small. I've done a lot of reading on this and the suggested way forward is adding "picture-urls::(original)" to the devise fields list. This is consistent with what I see in

How to downgrade bundler or upgrade rails?

吃可爱长大的小学妹 提交于 2019-12-03 05:23:35
问题 I added omniauth gem to my gemfile and tried to run bundle install, but got a message about incompatibility of rails and bundler versions. I tried to update rails, but got messages about incompatibility with other gems. How can I downgrade bundler to 1.0? $ bundle install Fetching gem metadata from http://rubygems.org/...... Fetching gem metadata from http://rubygems.org/.. Bundler could not find compatible versions for gem "bundler": In Gemfile: rails (= 3.0.0) ruby depends on bundler (~> 1

Making OmniAuth, Devise and Koala work together

感情迁移 提交于 2019-12-03 05:20:19
问题 I have an app in which I am implementing authentication using devise and omniauth. Ive got the logging in / out etc figured out, what i wanted to know was, what is the most efficient way to have a connection to the users graph api end point initialised and ready for use within my application. eg: If on the profile page i wanted to do, profile_image = current_user.fbgraph.get_picture("me") How would I accomplish this with the least number of API calls (i will be using similar calls throughout

Switching between web and touch interfaces on Facebook login using Omniauth and Rails 3

僤鯓⒐⒋嵵緔 提交于 2019-12-03 05:19:57
问题 The situation: Using Rails 3 and OmniAuth, I have an app that authenticates using the Facebook strategy. This app has been built to work equally-well for web and mobile interfaces (ala Jquery-Mobile). The challenge is to get OmniAuth to provide the mobile version of Facebook's login screen to mobile devices and the web version to desktop devices. I've hacked together a solution which I'll put as an answer. 回答1: Actually, since OmniAuth::Strategies are already Rack middleware, its even simpler