omniauth

How to Use OmniAuth Properly with Rails 2

坚强是说给别人听的谎言 提交于 2020-01-15 06:24:06
问题 I am trying to use an OmniAuth (0.2.6) strategy for my application. The architecture is Rails 2.3.10 and Rack is version is 1.1 (this version or higher is required for OmniAuth). A problem that occurs is Rails doesn't recognize my redirect to "/auth/provider". The actual error message is "No route matches "/auth/casport". Even though that error gets thrown, the code seems to execute past that point up to this error: "request.env['omniauth.auth']", which I'm pretty sure means it doesn't

Devise, Omniauth and multiple models with STI

[亡魂溺海] 提交于 2020-01-14 14:41:31
问题 I have an application setup with devise authentication using sti (base user model and two other models - company and individual - inheriting from it). From a devise perspective, everything is working. I can have different routes for signup forms and everything works as expected. Now I wanted to give both users (company and individual) the option to signup/sign in using facebook or linked in. If I set the :omniauthable on both models, and set the devise_for on my routes.rb for each model, I

Create users in Factory Girl with OmniAuth?

空扰寡人 提交于 2020-01-14 10:16:17
问题 I am currently creating an application that uses OmniAuth to create and authenticate users. I am encountering problems during testing due to Factory Girl being unable to generate users without OmniAuth. I have several different ways to get factory girl to create users with omniauth but none have been successful. I have added the following 2 lines to my spec_helper file OmniAuth.config.test_mode = true \\ allows me to fake signins OmniAuth.config.add_mock(:twitter, { :uid => '12345', :info =>

Create users in Factory Girl with OmniAuth?

自作多情 提交于 2020-01-14 10:14:30
问题 I am currently creating an application that uses OmniAuth to create and authenticate users. I am encountering problems during testing due to Factory Girl being unable to generate users without OmniAuth. I have several different ways to get factory girl to create users with omniauth but none have been successful. I have added the following 2 lines to my spec_helper file OmniAuth.config.test_mode = true \\ allows me to fake signins OmniAuth.config.add_mock(:twitter, { :uid => '12345', :info =>

Create users in Factory Girl with OmniAuth?

时间秒杀一切 提交于 2020-01-14 10:14:11
问题 I am currently creating an application that uses OmniAuth to create and authenticate users. I am encountering problems during testing due to Factory Girl being unable to generate users without OmniAuth. I have several different ways to get factory girl to create users with omniauth but none have been successful. I have added the following 2 lines to my spec_helper file OmniAuth.config.test_mode = true \\ allows me to fake signins OmniAuth.config.add_mock(:twitter, { :uid => '12345', :info =>

How do I make OmniAuth Identity accept JSON post data?

喜欢而已 提交于 2020-01-13 06:08:11
问题 I'm using OmniAuth-Identity for log ins, and logging in using Ajax calls. Attempts to log in passing JSON data don't work. For instance this works: curl -i -H "Accept: application/json" -d "auth_key=joe@example.com&password=cheesestix" "http://0.0.0.0:3000/auth/identity/callback" This doesn't, it returns "invalid credentials" curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{"auth_key":"joe@example.com","password":"cheesestix"}' "http://0.0.0.0:3000/auth/identity

How do I make OmniAuth Identity accept JSON post data?

六眼飞鱼酱① 提交于 2020-01-13 06:07:29
问题 I'm using OmniAuth-Identity for log ins, and logging in using Ajax calls. Attempts to log in passing JSON data don't work. For instance this works: curl -i -H "Accept: application/json" -d "auth_key=joe@example.com&password=cheesestix" "http://0.0.0.0:3000/auth/identity/callback" This doesn't, it returns "invalid credentials" curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{"auth_key":"joe@example.com","password":"cheesestix"}' "http://0.0.0.0:3000/auth/identity

How do I make OmniAuth Identity accept JSON post data?

不羁岁月 提交于 2020-01-13 06:07:14
问题 I'm using OmniAuth-Identity for log ins, and logging in using Ajax calls. Attempts to log in passing JSON data don't work. For instance this works: curl -i -H "Accept: application/json" -d "auth_key=joe@example.com&password=cheesestix" "http://0.0.0.0:3000/auth/identity/callback" This doesn't, it returns "invalid credentials" curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{"auth_key":"joe@example.com","password":"cheesestix"}' "http://0.0.0.0:3000/auth/identity

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

為{幸葍}努か 提交于 2020-01-12 04:53:06
问题 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

Rails 3 Routing Constraint and Regex

試著忘記壹切 提交于 2020-01-11 04:12:16
问题 I'm looking to match the pattern state/city in the path, unless the state variable equals "auth" match '/:state/:city' => 'cities#index', :as => :state_cities, :constraints => {:state => /(?!auth)/ } For example, mydomain.com/fl/miami is good. mydomain.com/auth/twitter is bad. I am using omniauth and it requires that you go to /auth/twitter for authentication, however it is nowhere to be found when I type rake routes . 回答1: Based on mu is too short's comments, here is the answer I've come up