# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 32 32: def realm 33: @realm ||= self.class.realm 34: end
# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 15 15: def run! 16: if basic_authentication? 17: basic_authentication do |login, password| 18: user = user_class.authenticate(login, password) 19: unless user 20: request_basic_auth! 21: end 22: user 23: end 24: end 25: end
# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 64 64: def basic_authentication(realm = nil, &authenticator) 65: self.realm = realm if realm 66: if basic_authentication? 67: authenticator.call(*@auth.credentials) 68: else 69: false 70: end 71: end
# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 45 45: def basic_authentication? 46: @auth.provided? and @auth.basic? 47: end
# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 53 53: def password 54: basic_authentication? ? @auth.credentials.last : nil 55: end
# File lib/merb-auth-more/strategies/basic/basic_auth.rb, line 57 57: def request_basic_auth! 58: self.status = Merb::Controller::Unauthorized.status 59: self.headers['WWW-Authenticate'] = 'Basic realm="%s"' % realm 60: self.body = self.class.failure_message 61: halt! 62: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.