" />
开发者

Omniauth is not directing to FB but rather my root? /

in my view I have:

<%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>

Which renders with the link: http://localhost:3000/users/auth/facebook

Problem is when I click that link it loads directly to:

Started GET "/" for 127.0.0.1 at 2011-09-26 15:35:29 -0700
  Processing by PagesController#landing_teaser as HTML
Rendered pages/landing_teaser.html.erb within开发者_运维技巧 layouts/unauthorized (7.1ms)
Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 1.0ms)

Here is my routes file:

  match '/users/auth/facebook/callback' => 'authentications#create'
  # Devise
  devise_for :users, :controllers => {:registrations => "registrations"}

Any thoughts on why omniauth is failing?

Thanks


Looking at your routes I see that you only define

match '/users/auth/facebook/callback' => 'authentications#create'

but in devise omniauth tutorial the route contains this (and for the records it should be different if you're using only omniauth)

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

The only thing I see is that /users/auth/facebook path doesn't match your route file and it goes through some devise (o omniauth) default route.

When you clear your cookies you reset the "status" of your browser and it starts a new session. When you have some cookies (maybe of a previous authentication) it recognize your previous session and don't ask you to authenticate again unless you do an explicit logout.

I've developed an application which uses devise+omniauth+google apps authentication and it ask me for credentials only once in a while, even when I close the browser and reopen it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜