Module: AuthHMAC::Rails::ControllerFilter::InstanceMethods

Defined in:
lib/auth-hmac.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#hmac_authenticated?Boolean

Returns:

  • (Boolean)


276
277
278
# File 'lib/auth-hmac.rb', line 276

def hmac_authenticated?
  self.class.authhmac.nil? ? true : self.class.authhmac.authenticated?(request)
end

#hmac_login_requiredObject



269
270
271
272
273
274
# File 'lib/auth-hmac.rb', line 269

def 
  unless hmac_authenticated?
    response.headers['WWW-Authenticate'] = 'AuthHMAC'
    render :text => self.class.authhmac_failure_message, :status => :unauthorized
  end
end