omniauth

Rails 3 Routing Constraint and Regex

和自甴很熟 提交于 2019-12-01 02:17:39
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 . Based on mu is too short's comments, here is the answer I've come up with: match '/:state/:city' => 'cities#index', :as => :state_cities, :constraints => OmniauthPassThru.new

How to implement Gmail IMAP with Omniauth

三世轮回 提交于 2019-12-01 00:11:20
I've read through several desperate sources of information on connecting to Google's Gmail through XOAUTH: http://code.google.com/apis/gmail/oauth/protocol.html#imap And I'm trying the use the 'gmail' gem which implements IMAP: https://github.com/nu7hatch/gmail Finally, ominauth for handling the authentication: https://github.com/Yesware/omniauth-google How do I actually tie these codes together to make something usable? Please let me know of any real world implementations, here's some examples of connecting to Gmail: http://otherinbox.com http://goslice.com I had trouble, like you, using

Rails facebook app returns 422 “ the change u wanted was rejected” error

不想你离开。 提交于 2019-11-30 15:48:47
My facebook is just approved today. However,when I clicked on "Go to app", it returns Rail 422 " The change you wanted was rejected. error" I set my Canvas URL to my site url and I am using Omniauth, so I am just wondering what did I miss. Try removing protect_from_forgery In the application_controller, or # you can disable csrf protection on controller-by-controller basis: skip_before_filter :verify_authenticity_token Facebook uses signed_request that you can decode and use to verify that the request actually comes from facebook, so protect_from_forgery is unnecessary for applications that

OmniAuth Single Sign On with Devise, invalid_credentials

不想你离开。 提交于 2019-11-30 15:24:11
I have 3 web apps - A, B and C. App A contains the user database. If accessing App B and App C, I would like the user to be redirected to App A to be authenticated, and then be returned back to whichever app they tried to access. At the same time, they should be logged in to all apps. Unless anyone has a better solution, I have gone with an OmniAuth/Devise combo solution as described in this blog post . I have forked and updated to Rais 3.1.2 a sample App A and a sample app B/C. App A - Provider - https://github.com/RobZolkos/sso-devise-omniauth-provider App B/C - Client - https://github.com

Faraday timeout error with omniauth (custom strategy)/doorkeeper

五迷三道 提交于 2019-11-30 14:17:58
I'm currently following along with this railscast and for my specific situation am running into a Faraday timeout error on the callback from omniauth. Currently I'm using a rails application as an API and backbone as a javascript front-end (on the same application) I decided I wanted to lock down the API with OAuth and provided a custom strategy for Omniauth to access the API as a client as well as Doorkeeper to handle the authorization logic module OmniAuth module Strategies class Twiddle < OmniAuth::Strategies::OAuth2 option :name, :twiddle option :client_options, { site: "http://localhost

Omniauth - Display facebook connect as popup

↘锁芯ラ 提交于 2019-11-30 13:53:27
问题 I am using Omniauth and forcing /auth/facebook to display in a popup (with JS). [Instead of a new window - which is much less user friendly] The problem is: Omniauth loads the FB url with display=page Instead of what I want: display=popup Anyone knows how I can change the params Omniauth uses for facebook ? Thanks 回答1: At where you set your Facebook ID and secret key, add one more extra option as: :display => "popup" 回答2: Actually, in the current version of omniauth-facebook, this is what

omniauth OAuthException & OAuth::Unauthorized

爱⌒轻易说出口 提交于 2019-11-30 13:41:24
I have installed omniauth 1.0. Also I have oauth-0.4.5, oauth2-0.5.1, omniauth-facebook-1.0.0, omniauth-twitter-0.0.6. omniauth.rb Rails.application.config.middleware.use OmniAuth::Builder do provider :developer unless Rails.env.production? provider :facebook, ENV['167257285348131'], ENV['c8c722f697scb2afcf1600286c6212a9'], :scope => 'email,offline_access,read_stream', :display => 'popup' provider :twitter, ENV['fma2L22ObJCW52QrL7uew'], ENV['4aZfhCAOdiS7ap8pHJ7I1OZslFwVWWLiAMVpYUI'] end session_controller.rb class SessionsController < ApplicationController require 'omniauth-facebook' require

Rails: Could not authenticate you from Facebook because “Invalid credentials”

女生的网名这么多〃 提交于 2019-11-30 12:29:46
I integrated omniauth-facebook using https://github.com/plataformatec/devise/wiki/OmniAuth%3a-Overview . But I am getting error of : Could not authenticate you from Facebook because "Invalid credentials". And in logs, getting this: Authentication failure! invalid_credentials: OAuth2::Error, : {"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}} I have devise installed. When i click on facebook sign in link, it comes back to devise sign "www.mealnut.com/user/sign_in# = " and gives above error. I checked the solution for "Invalid credentials" on https

Creating Signature and Nonce for OAuth (Ruby)

倾然丶 夕夏残阳落幕 提交于 2019-11-30 11:10:06
问题 I'm looking to access SmugMug's API from my application to grab users' albums and images (the users have been authenticated via ruby's OmniAuth). According to SmugMug's OAuth API, OAuth requires six parameters. I can get the token with OmniAuth, and the timestamp should be easy (Time.now.to_i right?). There are two things that I don't know how to generate -- the oauth_nonce and the oauth_signature. According to the oauth docs, I generate the nonce via the timestamp, but how exactly would I do

Rails: retrieving image from Facebook after Omniauth login with Devise

℡╲_俬逩灬. 提交于 2019-11-30 10:24:54
问题 I setup Facebook login with Devise and omniauth with these instructions https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview The Devise wiki gives some instructions for getting facebook info from the hash stored in this variable request.env['omniauth.auth'] See bottom for the hash. For example, Devise wiki has these two methods for the User.rb model def self.find_for_facebook_oauth(access_token, signed_in_resource=nil) data = access_token.extra.raw_info if user = User.where(:email