omniauth

Omniauth authorization call with Ajax

落爺英雄遲暮 提交于 2019-12-07 01:43:24
问题 I have omniauth working fine in my Rails 3 app when using it as a link: link_to("Connect Twitter", "/auth/twitter", :id => "connect-to-twitter") Now I want to call '/auth/twitter' through ajax. However, nothing is returned after the request phase. Here is the last log entry: Started GET "/auth/twitter" for 127.0.0.1 at 2012-10-30 17:53:02 -0700 (twitter) Request phase initiated. Here is my ajax code (in Coffeescript): $("#connect-to-twitter").live("click", -> alert('get twitter') $.get('/auth

local variable or method `config' for main:Object (NameError)

邮差的信 提交于 2019-12-07 01:40:42
问题 I'm following this post for integrating Omniauth Twitter + Devise http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ and I have encounter an issue that is blocking me to start my rails app. /Users/javier/Desktop/definitive/config/environment.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError) from /Users/javier/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require' from

How to authorize the google-api-ruby-client?

回眸只為那壹抹淺笑 提交于 2019-12-07 01:35:59
问题 I'm working to get the google-api-ruby-client gem working following the basic usage example here: Basic usage require 'google/apis/drive_v2' Drive = Google::Apis::DriveV2 # Alias the module drive = Drive::DriveService.new drive.authorization = ... # See Googleauth or Signet libraries # Search for files in Drive (first page only) files = drive.list_files(q: "title contains 'finances'") files.items.each do |file| puts file.title end Where I'm stuck is drive.authorization . I have an authorized

rails omniauth and UTF-8 errors

与世无争的帅哥 提交于 2019-12-07 00:52:06
问题 I had a recent error using omniauth trying to populate some fields from Google's login Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8 "omniauth"=> {"user_info"=> {"name"=>"Joe McÙisnean", "last_name"=>"McÙisnean", "first_name"=>"Joe", "email"=>"someemail@gmail.com"}, "uid"=> "https://www.google.com/accounts/o8/id?id=AItOawnQmfdfsdfsdfdsfsdhGWmuLTiX2Id40k", "provider"=>"google_apps"} In my user model def apply_omniauth(omniauth) #add some info about the

Rails rspec and omniauth (integration testing)

时光怂恿深爱的人放手 提交于 2019-12-06 23:39:39
问题 My Rails 3.2 app uses OmniAuth and Devise to sign in with Twitter. The authentication system works fine. I would like to write an integration test in rspec to make sure everything works. Using the information in the wiki, I've written the following, but I know I'm missing things. Under test.rb in config/environments, I have the following lines OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[:twitter] = {:provider => 'twitter', :uid => '123545'} My rspec test looks like this:

OmniAuth / Rails - You have a nil object when you didn't expect it

匆匆过客 提交于 2019-12-06 11:19:10
I'm getting the following error in my Rails application and I have no idea how to go about debugging or fixing it: NoMethodError in AuthenticationsController#create You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] Rails.root: /Users/phil/Sites/travlrapp.com Application Trace | Framework Trace | Full Trace app/controllers/authentications_controller.rb:15:in `create' The controller is this: class AuthenticationsController < ApplicationController def index @authentications = current_user

Active Model MassAssignmentSecurity Error

耗尽温柔 提交于 2019-12-06 09:09:26
问题 I'm Getting an Error: I'm developing a web with Facebook Integration.. I'm new in ruby on rails. can you help with my problem. ActiveModel::MassAssignmentSecurity::Error in SessionsController#create Can't mass-assign protected attributes: name This is my controller: class SessionsController < ApplicationController def create #render :json => request.env['omniauth.auth'].to_yaml auth = request.env['omniauth.auth'] unless @auth = Authorization.find_from_hash(auth) @auth = Authorization.create

Devise + Omniauth call action passthru on login Facebook

你离开我真会死。 提交于 2019-12-06 08:14:21
问题 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

Linked In authentication and aggregate data

狂风中的少年 提交于 2019-12-06 07:47:06
I'm building a web app with Ruby on Rails and I want my users to authenticate and aggregate data from Linked In (and others like Github, Twitter, etc...). I am using these gems: Devise for registration omniauth-linkedin for authentication pengwynn/linkedin for data aggregation Though, Linked In has a not-so-nice pin thing. Is there a way to avoid it and get the data I want from my users account without having them to go to linked in, fetch a pin and submit it to me? Thanks in advance. authentications_controller.rb class AuthenticationsController < ApplicationController def index

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

∥☆過路亽.° 提交于 2019-12-06 07:41:55
问题 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