Class: SSO::Apache

Inherits:
Base
  • Object
show all
Defined in:
lib/sso/apache.rb

Constant Summary collapse

CAS_USERNAME =
'REMOTE_USER'

Instance Attribute Summary

Attributes inherited from Base

#controller, #user

Instance Method Summary collapse

Methods inherited from Base

#authenticate!, #initialize, #support_expiration?, #support_login?

Constructor Details

This class inherits a constructor from SSO::Base

Instance Method Details

#authenticated?Boolean

If REMOTE_USER is provided by the web server then authenticate the user without using password.


12
13
14
# File 'lib/sso/apache.rb', line 12

def authenticated?
  (self.user = request.env[CAS_USERNAME]).present?
end

#available?Boolean


4
5
6
7
8
# File 'lib/sso/apache.rb', line 4

def available?
  return false unless Setting['authorize_login_delegation']
  return false if controller.api_request? and not Setting['authorize_login_delegation_api']
  true
end