omniauth

simple_form & bootstrap validations not working

家住魔仙堡 提交于 2019-12-08 00:45:01
问题 I want to setup a 'Create Account' page. The gems I'm using are: rails (3.2.3) simple_form (2.0.1) omniauth-identity twitter-bootstrap-rails (2.0.6) mongoid (2.2.3) The form looks as follows: = simple_form_for @identity, :url => '/auth/identity/register', :html => { :class => 'form-horizontal' } do |f| = f.input :name, :input_html => {:name => 'name'} = f.input :email, :input_html => {:name => 'email'} = f.input :password, :as => 'password', :input_html => {:name => 'password'} = f.input

“uninitialized constant Users (NameError)” w/ Heroku deploy

寵の児 提交于 2019-12-07 22:32:37
问题 I've built a basic Rails app with Mongoid, Devise and Omniauth for Facebook login. I've got no problem running it locally, but when I try to push to Heroku, I'm getting this error: "/app/app/controllers/Users/omniauth_callbacks_controller.rb:1:in `': uninitialized constant Users (NameError)" I've Googled the hell out of this with little luck. I've committed the User model, I've ran "heroku run rake db:migrate", etc. No luck. Here's my stack. Ruby 1.9.2 Rails 3.2.1 Gemfile: require 'rbconfig'

Using only omniauth (twitter) sign-in with Devise, Rails 3, Omniauth

孤人 提交于 2019-12-07 19:03:02
问题 I have a setup based on Railscasts 209, 210, 235 and 236 - Twitter sign-in is working great; however I would like to entirely remove the ability for users to create accounts local to my app. In other words, if you want to sign in, you need to use your Twitter acct. I'd just as soon not bother managing local accounts (for now - may add it back in at some point). I can't really find any solid pointers to how to do this, and playing around with the Devise routes and such haven't yielded very

Omniauth, Devise, Open ID, CanCan - Whats what and When do I use which solution for a Rails API app

拥有回忆 提交于 2019-12-07 14:29:56
问题 So Im developing a Rails app- primarily serves API which I want to lock down behjind a nice authorization system. Ive created Rails apps which render HTML and for that I used Devise and CanCan. This time I want to serve JSON to my clients. I basically have the following requirements: Need an authorization system thats robust A user should be able to log in with existing apps such as facebook, twitter, linked in and google There should be full stack authorization available Now this is my 1st

How to rescue from a OAuth::Unauthorized exception in a Ruby on Rails application?

跟風遠走 提交于 2019-12-07 13:04:57
问题 How can I rescue from an OAuth::Unauthorized exception as raised from OmniAuth in a Ruby on Rails application? Obviously this: rescue_from OAuth::Unauthorized, :with => :unauthorized won't work as that only catches exception thrown inside Rails and this exception is thrown somewhere else in the rack chain. In this application the administrators (and not us, the developers) configure the credentials for twitter and facebook, so having the wrong ones is something that can happen and indeed does

New LinkedIn permissions: accessing past positions and educations using rails LinkedIn gem

送分小仙女□ 提交于 2019-12-07 11:57:11
问题 Linkedin recently updated their API, making it less restrictive in terms of what you can access in some cases but generally more explicit in terms of how you must access it. In particular, you must request specifically what data you want in the omniauth builder: Rails.application.config.middleware.use OmniAuth::Builder do provider :linkedin, "consumer_key", "consumer_secret", :scope => 'r_fullprofile r_emailaddress r_network', :fields => ["id", "email-address", "first-name", "last-name",

Magento oauth and REST api trouble

有些话、适合烂在心里 提交于 2019-12-07 09:13:34
问题 I’m trying to integrate my ruby on rails app to magento, and I got so far as to make the initial request, get authorized, and I believe I’m getting the final token, but I can’t be sure. Here is what I have in my response: (There’s a lot of stuff here, so skip ahead where I pluck out the import bits) ..... "credentials"=> {"token"=>"r8apb2rcgci9ry5hugcuiqlnwdi0evc1", "secret"=>"8pnyogb4048toujt5rjoq26tqh50vkv5"}, "extra"=> {"access_token"=> #<OAuth::AccessToken:0x007fdd59893468 @consumer= #

ArgumentError in Devise::RegistrationsController#new wrong number of arguments (2 for 0..1)

大憨熊 提交于 2019-12-07 08:12:06
问题 Im following Ryan bates RailsCast on devise and omniauth (episode 235-devise-and-omniauth-revised). I keep getting the error in the title when i try to log in with twitter. def self.new_with_session(params, session) if session["devise.user_attributes"] new(session["devise.user_attributes"], without_protection: true) do |user| user.attributes = params user.valid? end Full trace: C:/Ruby200-x64/lib/ruby/gems/2.0.0/bundler/gems/mongoid-fe7f43430580/lib/mongoid/document.rb:106:in `initialize'

Find loaded providers for OmniAuth

梦想的初衷 提交于 2019-12-07 02:27:18
问题 I'd like to know which providers have been loaded for use by the OmniAuth gem. I've tried this: OmniAuth::Strategies.constants # a method provided by the standard lib Module class # => [:Developer, :OAuth, :Twitter] and this: OmniAuth.strategies.inspect # a method provided by the OmniAuth class, but which has no documentation or comments around it. # => [OmniAuth::Strategies::OAuth] The answer I'd expect (or want) is [:Developer, :Twitter] as in my test code I've only loaded twitter

Omniauth and open_id with Google broken when running behind nginx in SSL mode

主宰稳场 提交于 2019-12-07 01:53:22
问题 Rails 3.0.12, newest omniauth, I can connect to Google and get the user's email address just fine. But then I run that same rails app behind nginx in SSL mode, and it fails with the Google page: "The page you requested is invalid." Is it my nginx config? My omniauth setup? I know the X-Forwarded-Proto: https is the special sauce here, is there anything else I need to do to get openid happy behind an SSL web server? Here's the full example code: you can clone this repo, bundle install , and