`
CaiDeHen
  • 浏览: 90300 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

#82 HTTP Basic Authentication

阅读更多
Rails 2.0 offers an extremely easy way to do HTTP basic authentication. See how in this episode.
# products_controller.rb
before_filter :authenticate

protected

def authenticate
  authenticate_or_request_with_http_basic do |username, password|
    username == "foo" && password == "bar"
  end
end
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics