2010-09-10 146 views
0

你能告訴我 - 是否有可能禁用一個或多個控制器/操作warden/devise?設計和基本身份驗證

我需要讓與基本身份驗證到控制器的一個請求,但每次我發送類似的請求,我的種子消息,那巴斯AUTH不需要我的應用程序。

我正在寫oauth2提供程序及其問題,以允許客戶端應用程序發送他的帶有基本身份驗證的證書,如此處所述 - http://tools.ietf.org/html/draft-ietf-oauth-v2-08#section-2

+2

請不要在堆棧溢出中使用「plz」。 – 2010-09-12 23:32:51

回答

1

直接回答你的問題 - 如果你不想爲一個特定的控制器的認證,然後簡單地忽略或刪除「的before_filter:的authenticate_user! statement in that controller. Similarly, if you want to do authentication for only certain methods in the controller, look at the:只有and:除了options to before_filter`。

如果你想允許只有 http認證的特定方法或控制器,那麼我相信你必須重寫一些devise方法來限制爲http認證,因爲devise希望在默認情況下靈活,將允許http auth或會話身份驗證。

2

如果您在ApplicationController中做before_filter :authenticate_user!,只需在要禁用Devise的控制器中執行skip_before_filter :authenticate_user!即可。