You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Rails3, OmniAuth, RSpec, Capybaraの組み合わせでエンドツーエンドのテストを書いた。カレントユーザの情報にアクセスする方法が分からず試行錯誤したが、以下の方法で解決。他に良い方法ないかな? describe "テスト対象" do before do OmniAuth.config.test_mode = true @current_user = User.create( :uid => 12234, :provider => "twitter", :screen_name => "NickName", :name => "FirstName LastName" ) OmniAuth.config.mock_auth[:twitter] = { "uid" => @current_user.uid, "provider" => @current_user.pro
There is a newer version of this episode, see the revised episode. Resources OmniAuth Episode 235: Omniauth Part 1 Full episode source code Update 12/5/11: Some things have changed since OmniAuth version 1.0 was released. Each provider is now a separate gem that should be included in the Gemfile, and the "user_info" hash is now simply "info". The changes have been made below.
OmniAuth, Rails | 12:43 | OmniAuthが1.0.0になり、使い方が少し変更されていたのでメモ。OmniAuth 1.0.0を使ってTwitterのアカウントで認証する方法です。 omniauth.rbの作成config/initializers/omniauth.rb 'Consumer Key'と'Consumer Secret'には、Twitterから発行されたキーを入力します。 Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, 'Consumer Key', 'Consumer Secret' end Strategyのインストール認証のパーツがStrategyという単位で分割されています。Strageryのリストは以下のURLから確認できます。
このウェブサイトは販売用です! twiwt.org は、あなたがお探しの情報の全ての最新かつ最適なソースです。一般トピックからここから検索できる内容は、twiwt.orgが全てとなります。あなたがお探しの内容が見つかることを願っています!
ruby on rails では簡単にtwitterやfacebookと認証ができるライブラリがあります。 それがomniauthです。 Twitterdeveloperに登録する Twitter Developer 上記から入って登録していきます。 今回必要なのは赤枠でくくっている。 ・Consumer key ・Consumer secret ・Callback URL※戻り先のURL Facebookdeveloperに登録する Facebook Developer 上記から入って登録していきます。 ここで必要なのは赤枠の部分です。 ・App ID ・App Secret Gemのインストール gemでomniauthをインストールします。 gem 'omniauth' 後は、ライブラリをインストールします。 bundle install nokogiriのinstallエラー li
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く