Class: Stormpath::Rails::ControllerAuthentication::FromBasicAuth

Inherits:
Object
  • Object
show all
Defined in:
app/services/stormpath/rails/controller_authentication/from_basic_auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_header) ⇒ FromBasicAuth

Returns a new instance of FromBasicAuth.



7
8
9
# File 'app/services/stormpath/rails/controller_authentication/from_basic_auth.rb', line 7

def initialize(authorization_header)
  @authorization_header = authorization_header
end

Instance Attribute Details

#authorization_headerObject (readonly)

Returns the value of attribute authorization_header.



5
6
7
# File 'app/services/stormpath/rails/controller_authentication/from_basic_auth.rb', line 5

def authorization_header
  @authorization_header
end

Instance Method Details

#authenticate!Object



11
12
13
14
15
# File 'app/services/stormpath/rails/controller_authentication/from_basic_auth.rb', line 11

def authenticate!
  raise UnauthenticatedRequest if fetched_api_key.nil?
  raise UnauthenticatedRequest if fetched_api_key.secret != api_key_secret
  fetched_api_key.
end