class ApplicationController < ActionController::BaseEdge rails has its own HttpAuthentication::Basic module:
htpasswd :user => 'username', :pass => 'secret'
end
class ApplicationController < ActionController::Base
USERNAME, PASSWORD = 'username', 'secret'
before_filter :basic_http_authentication
private
def basic_http_authentication
authenticate_or_request_with_http_basic do |username, password|
username == USERNAME and password == PASSWORD
end
end
end
I haven't tried the edge rails version though.
No comments:
Post a Comment