Class: Merb::Authentication::Strategies::Basic::BasicAuth

Inherits:
Base
  • Object
show all
Defined in:
lib/merb-auth-more/strategies/basic/basic_auth.rb

Constant Summary collapse

@@failure_message =
"Login Required"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#login_param, login_param, password_param, #password_param

Class Method Details

.realmObject



27
28
29
# File 'lib/merb-auth-more/strategies/basic/basic_auth.rb', line 27

def self.realm
  @realm ||= "Application"
end

Instance Method Details

#realmObject



32
33
34
# File 'lib/merb-auth-more/strategies/basic/basic_auth.rb', line 32

def realm
  @realm ||= self.class.realm
end

#run!Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/merb-auth-more/strategies/basic/basic_auth.rb', line 15

def run!
  if basic_authentication?
    basic_authentication do |, password|
      user = user_class.authenticate(, password)
      unless user
        request_basic_auth!
      end
      user
    end
  end
end