Sha256: 4ef44fdb29955eec188e12a6222cee45d5903f820d5ef8bc6f22eac18eff651b

Contents?: true

Size: 779 Bytes

Versions: 16

Compression:

Stored size: 779 Bytes

Contents

require 'casserver/authenticators/base'

# Dummy authenticator used for testing. 
# Accepts "testuser" for username and "testpassword" for password; 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

16 entries across 16 versions & 4 rubygems

Version Path
arpitjain11-rubycas-server-0.8.0.20090612 lib/casserver/authenticators/test.rb
arpitjain11-rubycas-server-0.8.0.20090613 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.6.99.336 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.7.999.20090212 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.7.9999.20090212 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090213 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090225 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090227 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090427 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090430 lib/casserver/authenticators/test.rb
gunark-rubycas-server-0.8.0.20090506 lib/casserver/authenticators/test.rb
wmernagh-rubycas-server-0.6.99.336 lib/casserver/authenticators/test.rb
wmernagh-rubycas-server-0.7.1.1 lib/casserver/authenticators/test.rb
rubycas-server-0.7.0 lib/casserver/authenticators/test.rb
rubycas-server-0.7.1.1 lib/casserver/authenticators/test.rb
rubycas-server-0.7.1 lib/casserver/authenticators/test.rb