今天想试试 devise wiki 上关于 omniauth 的一些东西
然后仿照wiki, 我做了这些事情
1. gemfile
gem 'omniauth-github'
gem 'omniauth_crowd'
2.user.rb
devise :omniauthable, :omniauth_providers => [:crowd,:github]
3.devise.rb
require "omniauth_crowd"
require "omniauth-github"
config.omniauth :github, "Client ID", "Client Secret"
config.omniauth :crowd, :crowd_server_url => "SERVER ADD", :application_name => "bgg", :application_password => "bgg"
4.db
rails g migration AddColumnsToUsers provider:string uid:string
rake db:migrate
5.html
<%=link_to 'github',user_omniauth_authorize_path(:github)%><br/>
<%=link_to 'crowd',user_omniauth_authorize_path(:crowd)%>
然后使用链接登陆, 跳转到 github 和 crowd 的登陆页面是没问题了,但是我输入正确用户名密码后提交,就报错:
The action 'github' could not be found for Devise::OmniauthCallbacksController
找了下没找到相关资料 有劳大家帮忙,看我少配哪个东西,谢谢大家