com.sun.sgs.impl.auth
Class NullAuthenticator

java.lang.Object
  extended by com.sun.sgs.impl.auth.NullAuthenticator
All Implemented Interfaces:
IdentityAuthenticator

public class NullAuthenticator
extends Object
implements IdentityAuthenticator

A very simple implementation of IdentityAuthenticator that always authenticates a user based on NamePasswordCredentials. This is primarily useful for testing applications.


Constructor Summary
NullAuthenticator(Properties properties)
          Creates an instance of NullAuthenticator.
 
Method Summary
 Identity authenticateIdentity(IdentityCredentials credentials)
          Always authenticates the given user unless the credentials are not of type NamePasswordCredentials, in which case a CredentialException is thrown.
 String[] getSupportedCredentialTypes()
          Returns the identifiers for this IdentityAuthenticator's supported credential types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAuthenticator

public NullAuthenticator(Properties properties)
Creates an instance of NullAuthenticator.

Parameters:
properties - the application's configuration properties
Method Detail

getSupportedCredentialTypes

public String[] getSupportedCredentialTypes()
Returns the identifiers for this IdentityAuthenticator's supported credential types. This may contain any number of identifiers, which are matched against the identifier of IdentityCredentials to determine if this IdentityAuthenticator can consume those credentials.

Specified by:
getSupportedCredentialTypes in interface IdentityAuthenticator
Returns:
the identifiers for the supported credential types

authenticateIdentity

public Identity authenticateIdentity(IdentityCredentials credentials)
                              throws CredentialException
Always authenticates the given user unless the credentials are not of type NamePasswordCredentials, in which case a CredentialException is thrown.

Specified by:
authenticateIdentity in interface IdentityAuthenticator
Parameters:
credentials - the identity's credentials, which must be an instance of NamePasswordCredentials
Returns:
the identity of the given user
Throws:
CredentialException - if the wrong type of credentials were provided

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved