Sha256: b176d3110f75cc5e4019d1ad0a72fc4854c98c3ef078d04524e5a56c3b53c7d5

Contents?: true

Size: 774 Bytes

Versions: 1

Compression:

Stored size: 774 Bytes

Contents

require 'casserver/authenticators/base'

# Dummy authenticator used for testing.
# Accepts any username as valid as long as the password is "testpassword"; otherwise authentication fails.
# Raises an AuthenticationError when username is "do_error" (this is useful to test the Exception
# handling functionality).
class CASServer::Authenticators::Test < CASServer::Authenticators::Base
  def validate(credentials)
    read_standard_credentials(credentials)

    raise CASServer::AuthenticatorError, "Username is 'do_error'!" if @username == 'do_error'

    @extra_attributes[:test_string] = "testing!"
    @extra_attributes[:test_numeric] = 123.45
    @extra_attributes[:test_serialized] = {:foo => 'bar', :alpha => [1,2,3]}

    return @password == "testpassword"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
godfat-rubycas-server-0.8.0.20090918 lib/casserver/authenticators/test.rb