Module: Aker::Modes::Support::Rfc2617

Included in:
Cas::ProxyMode, HttpBasic
Defined in:
lib/aker/modes/support/rfc_2617.rb

Overview

A mixin providing common methods for modes which implement authentication according to RFC 2616 and RFC 2617.

Instance Method Summary collapse

Instance Method Details

#challengeString

Builds the content of the WWW-Authenticate challenge header for a particular mode. Requires that the target mode implement #scheme.



16
17
18
# File 'lib/aker/modes/support/rfc_2617.rb', line 16

def challenge
  "#{scheme} realm=\"#{realm}\""
end

#realmString

Determines the value to use for the required "realm" challenge parameter. If set, the portal is used. Otherwise "Aker" is used.



26
27
28
# File 'lib/aker/modes/support/rfc_2617.rb', line 26

def realm
  (configuration.portal? ? configuration.portal : 'Aker').to_s
end