Module: Sinatra::LazyAuth

Defined in:
lib/sinatra/lazy_auth.rb

Defined Under Namespace

Classes: LazyCredentials

Instance Method Summary collapse

Instance Method Details

#authorize!Object



42
43
44
45
46
# File 'lib/sinatra/lazy_auth.rb', line 42

def authorize!
  r = "#{DRIVER}-deltacloud@#{HOSTNAME}"
  response['WWW-Authenticate'] = %(Basic realm="#{r}")
  throw(:halt, [401, "Not authorized\n"])
end

#credentialsObject

Request the current user’s credentials. Actual credentials are only requested when an attempt is made to get the user name or password



50
51
52
# File 'lib/sinatra/lazy_auth.rb', line 50

def credentials
  LazyCredentials.new(self)
end