omniauth

Omniauth Session expires when browser is closed

只谈情不闲聊 提交于 2019-12-04 20:55:36
问题 In my rails 3 app I use Omniauth for the user authentication part (fb/twitter). Actually I follow this: https://github.com/RailsApps/rails3-mongoid-omniauth https://github.com/RailsApps/rails3-mongoid-omniauth/wiki/Tutorial But, when I close the browser session expires and I need to login again. How can I keep the session for returning users? Any help would be greatly appreciated! 回答1: Devise offers this functionality through its Rememberable module. OmniAuth integrates easily with it through

How to turn a Rails app with Devise into an OAuth provider?

馋奶兔 提交于 2019-12-04 18:05:26
问题 I have a Rails application with admin accounts using Devise for authentication. I am creating a second application and would like to authenticate using the first application instead of duplicating admin accounts in the second application. So my idea is to turn the first application into an OAuth provider so that the second app can simply act as an OAuth client using something like OmniAuth. Have you done this before? Is there a plugin which adds the ability to Devise to be able to act as an

Redirect to Page after Facebook Sign Up

天涯浪子 提交于 2019-12-04 17:41:25
I'm trying to Redirect a user after successful Facebook SIGN UP (not sign in). I want to redirect to /getstarted/welcome after a user Registers for the first time . My omniauth callback is : def facebook # You need to implement the method below in your model (e.g. app/models/user.rb) @user ||= User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? # This will throw if @user is not activated sign_in_and_redirect @user, event: :authentication if is_navigational_format? set_flash_message(:notice, :success, kind: "Facebook") end else session["devise.facebook

How do I make OmniAuth Identity accept JSON post data?

浪子不回头ぞ 提交于 2019-12-04 17:31:42
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/callback" Is this a known issue? Form encoding my data will be difficult as I'm using AngularJS. UPDATE

Rails 4 Devise/Omniauth Email exists in database error

不羁岁月 提交于 2019-12-04 17:08:13
I am "banging" my head against a wall trying to figure this out. I decided to allow users to log in through twitter, Google,my site or Facebook. The problem is that twitter does not provide emails, so I am trying to add users by username. The problem with that is devise keeps checking for email and when I don't require it, I get PG::Error: ERROR: duplicate key value violates unique constraint "index_users_on_email" DETAIL: Key (email)=() already exists. : INSERT INTO "users" ("created_at", "name", "provider", "uid", "updated_at", "username") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id". I

Devise + Omniauth call action passthru on login Facebook

荒凉一梦 提交于 2019-12-04 16:25:00
When I try to login with Facebook using Omniauth and Devise, passthru is called instead of facebook . How do I pass in the link_to : user_omniauth_authorize_path(:facebook) I've revised the code many times and tried to use this route: devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } do get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru' end and devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } But the error is same. I have the action facebook in my users/omniauth_callbacks_controller.rb I just flailed

How can I specifiy what access I need from my user's Facebook accounts when using OmniAuth?

左心房为你撑大大i 提交于 2019-12-04 14:04:50
问题 When you use OmniAuth to login to a web app through Facebook, these are the permissions the webapp has: Access my basic information Includes name, profile picture, gender, networks, user ID, list of friends, and any other information I've shared with everyone. Send me email WebApp may email me directly at email@email.com Access my data any time WebApp may access my data when I'm not using the application Whereas when you use the mini_fb gem to link a web app to Facebook, these are the

Omniauth-facebook login not working

社会主义新天地 提交于 2019-12-04 13:41:21
When I try to login in my Rails app using omniauth-facebook, I'm getting the following error. This is when testing on localhost:3000: Insecure Login Blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https:// I saw this other recent post on SO , but Facebook doesn't seem to be allowing me to change the "Enforce HTTPS for Web OAuth Login" settings in the developer console for this app that I created today. I can change that setting for old apps. Any ideas on how to fix this or get around it? I'll use HTTPS in production, but just want

Has anyone used omniauth with rails 2.3.8?

六月ゝ 毕业季﹏ 提交于 2019-12-04 12:15:49
问题 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

Access Google Plus Contacts google-api-ruby-client and omniauth-google-oauth2

我的梦境 提交于 2019-12-04 11:52:20
I want to get contact from Google Plus. I am using gem "omniauth" gem "omniauth-google-oauth2" for authentication and gem "google-api-client" for comunicate with google apis. So far authentication is working fine and I got access_token after authentication. Now problem is I couldn't find a way to get list of people in my circle (My Google Plus Contact). Is there any way to do this. Specifically I need to know is there any gem more like "fb_graph" for google? I found this trick https://plus.google.com/u/0/_/socialgraph/lookup/visible/o=%5Bnull%2Cnull%2C%22_UID_%22%5D&rt=j Just need to put "UID"