Base
# File lib/devise_unix2_chkpwd_authenticatable/strategy.rb, line 13 def authenticate! credentials = params[scope] # credentials are empty when using HTTP auth if credentials.nil? # only HTTP Basic authentication is supported request.authorization =~ /^Basic (.*)/ usrname, pwd = Base64.decode64($1).split(/:/, 2) credentials = {:username => usrname, :password => pwd} end if resource = mapping.to.authenticate_with_unix2_chkpwd(credentials) Rails.logger.info "*** Success!" success!(resource) else Rails.logger.error "*** Invalid!" fail(:invalid) end end
# File lib/devise_unix2_chkpwd_authenticatable/strategy.rb, line 35 def valid_controller? params[:controller] == 'devise/sessions' end
# File lib/devise_unix2_chkpwd_authenticatable/strategy.rb, line 43 def valid_http_auth? # HTTP authentication enabled and credentials present in the request mapping.to.http_authenticatable?(:unix2chkpwd) && request.authorization && request.authorization.match(/^Basic (.*)/) end
Generated with the Darkfish Rdoc Generator 2.