omniauth

Getting “Error: redirect_uri_mismatch” with google_oauth2

瘦欲@ 提交于 2019-12-20 10:30:47
问题 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

Routing Error uninitialized constant Users

痴心易碎 提交于 2019-12-20 10:23:26
问题 I am a rails newbie... I am trying to set up Sign in with facebook for a demo app. I am using OmniAuth and following this tutorial https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview I get this error when redirecting to fB: Routing Error: uninitialized constant Users Try running rake routes for more information on available routes. Environment Windows 7 Rails version :3.2.9.rc2 omniauth-1.1.1 devise-2.1.2 My routes.rb looks like this: root :to => 'static_pages#home' resources

Retrieving Medium or Large Profile Image from Twitter with omniauth-twitter

邮差的信 提交于 2019-12-20 09:45:37
问题 I'm using omniauth-twitter gem to authenticate users through twitter. I am also using their Twitter profile image as their avatar for my site. However, the image I get from Twitter is low resolution. I know Twitter has better resolution pics available. How do I get it? Here is what I am currently doing. It is a method in the user model. It works, just doesn't get me a good quality pic: user.rb def update_picture(omniauth) self.picture = omniauth['info']['image'] end I thought maybe I could

Rails 3 - Devise : How to skip the 'current_password' when editing a registration?

孤者浪人 提交于 2019-12-20 08:30:15
问题 I've implemented omniauth with my devise model, so I can authenticate using other services. Password is not necessary anymore for my model, as users can authenticate using twitter, facebook... Everything is working fine, but, when an user try to edit its registration, devise skip the process because the user did not inform the 'current_password' (which doesnt exist in some cases now). I created a registration controller to overwrite the devises one: class RegistrationsController < Devise:

I am using rails cast omniauth and i get this error

人盡茶涼 提交于 2019-12-20 03:19:53
问题 I am using Mongodb as database in rails and i got error when using /auth/linkedin/callback NoMethodError in AuthenticationsController#create undefined method []' for nil:NilClass Rails.root: /home/prem/Music/heronhrm Application Trace | Framework Trace | Full Trace app/models/user.rb:57:in apply_omniauth' app/controllers/authentications_controller.rb:19:in `create' Also when i remove self.email = omniauth['user_info']['email'] if email.blank? from usermodel then the validation errors arises

Omniauth Facebook redirects to registration screen instead of creating user

我是研究僧i 提交于 2019-12-20 02:01:14
问题 Following the gem's tutorial exactly I still seem to be running into some issues. I first click the link to sign up via Facebook and get redirected to Facebook. I click okay and get brought back to my registration page. No new user is created. If I try to click the register link again it just refreshes the page with this in the address bar http://localhost:3000/register#_=_ . What am I doing wrong? User Model devise :database_authenticatable, :registerable, :recoverable, :rememberable,

redirect back to current page using omniauth and devise

匆匆过客 提交于 2019-12-19 11:57:41
问题 I want to redirect back to current page after oauth signin, and I followed this Devise wiki and did the following: def after_sign_in_path_for(resource) sign_in_url = new_user_session_url if request.referer == sign_in_url super else request.env['omniauth.origin'] || stored_location_for(resource) || request.referer || root_path end end request.env['omniauth.origin'] is http://www.bubutravel.com/users/sign_in stored_location_for(resource) is nil request.referer is http://openapi.qzone.qq.com

devise - can't display sign in or sign out in rails view

不羁岁月 提交于 2019-12-19 11:22:34
问题 I'm using devise to do basic authentication for now. When I go to localhost:3000/users/sign_in I will be able to sign in or if I go there when I'm logged in I'll get the appropriate message "You are already signed in." However, user_signed_in? is always evaluating to false, even after successful sign in <div id="user_nav"> <% if user_signed_in? %> Welcome <%= current_user.email %>! <%= link_to "Sign out", destroy_user_session_path, :method => :delete %> <% else %> <%= link_to "Connect With

Authentication failure : Devise + OmniAuth + Twitter

给你一囗甜甜゛ 提交于 2019-12-19 06:44:16
问题 I am getting (twitter) Authentication failure! invalid_credentials: OAuth::Unauthorized, 401 Unauthorized error after successfully loin to twitter and page is redirected to sign in page Here is the application configuration routes.rb devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } devise.rb config.omniauth :twitter, "KEY", "SECRET" omniauth_callbacks_controller.rb class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def

Authentication failure : Devise + OmniAuth + Twitter

六眼飞鱼酱① 提交于 2019-12-19 06:43:37
问题 I am getting (twitter) Authentication failure! invalid_credentials: OAuth::Unauthorized, 401 Unauthorized error after successfully loin to twitter and page is redirected to sign in page Here is the application configuration routes.rb devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } devise.rb config.omniauth :twitter, "KEY", "SECRET" omniauth_callbacks_controller.rb class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def