Class: Ext::BasicAuth::Controllers::Unauthenticated

Inherits:
Security::Controllers::Unauthenticated show all
Defined in:
lib/ext/basic_auth.rb

Overview

Called when an url is not authorized. You can override this is your app.

Class Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Security::Controllers::Unauthenticated

urls

Class Attribute Details

.realmObject

Returns the value of attribute realm.



53
54
55
# File 'lib/ext/basic_auth.rb', line 53

def realm
  @realm
end

Instance Method Details

#getObject



57
58
59
60
61
62
# File 'lib/ext/basic_auth.rb', line 57

def get
  @status = 401
  @headers['Status'] = 'Unauthorized'
  @headers['WWW-Authenticate'] = "Basic realm=\"#{self.class.realm}\""
  super
end