org.mule.extras.jaas
Class JaasSimpleAuthenticationProvider

java.lang.Object
  extended by org.mule.extras.jaas.JaasSimpleAuthenticationProvider
All Implemented Interfaces:
Initialisable, UMOSecurityProvider

public class JaasSimpleAuthenticationProvider
extends Object
implements UMOSecurityProvider

This is the Provider for Mule's Jaas Security


Nested Class Summary
static class JaasSimpleAuthenticationProvider.JaasConfig
          The JaasConfig class extends the Jaas Configuration in order to be able to configure the jaas security programmatically.
 
Constructor Summary
JaasSimpleAuthenticationProvider()
           
 
Method Summary
 UMOAuthentication authenticate(UMOAuthentication authentication)
          The authenticate method first creates the jaas Login Context using the callback handler and the name of the class or directory to prtect.
 UMOSecurityContext createSecurityContext(UMOAuthentication auth)
           
 String getCredentials()
          Gets the user's credentials, i.e.
 String getLoginConfig()
          Gets the Login Configuration
 String getLoginContextName()
          Gets the Login Context Name
 String getLoginModule()
          Gets the login module name
 String getName()
           
 void initialise()
          The initialise method checks whether a jaas configuration file exists.
 void setCredentials(String credentials)
          Sets the user's credentials.
 void setLoginConfig(String loginConfig)
          Sets the login Configuration
 void setLoginContextName(String loginContextName)
          Sets the Login Context name
 void setLoginModule(String loginModule)
          sets the login module name
 void setName(String name)
           
 boolean supports(Class aClass)
          checks whether the class is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaasSimpleAuthenticationProvider

public JaasSimpleAuthenticationProvider()
Method Detail

setLoginConfig

public final void setLoginConfig(String loginConfig)
Sets the login Configuration

Parameters:
loginConfig -

getLoginConfig

public final String getLoginConfig()
Gets the Login Configuration

Returns:
loginConfig

setLoginContextName

public final void setLoginContextName(String loginContextName)
Sets the Login Context name

Parameters:
loginContextName -

getLoginContextName

public final String getLoginContextName()
Gets the Login Context Name

Returns:
loginContextName

getCredentials

public final String getCredentials()
Gets the user's credentials, i.e. the username and password

Returns:
credentials

setCredentials

public final void setCredentials(String credentials)
Sets the user's credentials.

Parameters:
credentials -

getLoginModule

public final String getLoginModule()
Gets the login module name

Returns:
loginModule

setLoginModule

public final void setLoginModule(String loginModule)
sets the login module name

Parameters:
loginModule -

getName

public final String getName()
Specified by:
getName in interface UMOSecurityProvider
Returns:
name

setName

public final void setName(String name)
Specified by:
setName in interface UMOSecurityProvider
Parameters:
name -

authenticate

public final UMOAuthentication authenticate(UMOAuthentication authentication)
                                     throws SecurityException
The authenticate method first creates the jaas Login Context using the callback handler and the name of the class or directory to prtect. If the Login Context is successfully created, it will then attempt to login.

Specified by:
authenticate in interface UMOSecurityProvider
Parameters:
UMOAuthentication -
Returns:
UMOAuthentication
Throws:
SecurityException

supports

public final boolean supports(Class aClass)
checks whether the class is supported.

Specified by:
supports in interface UMOSecurityProvider
Parameters:
aClass -
Returns:

createSecurityContext

public final UMOSecurityContext createSecurityContext(UMOAuthentication auth)
                                               throws UnknownAuthenticationTypeException
Specified by:
createSecurityContext in interface UMOSecurityProvider
Returns:
Throws:
UnknownAuthenticationTypeException - This occurs when the Security Factory cannot be created

initialise

public final void initialise()
                      throws InitialisationException
The initialise method checks whether a jaas configuration file exists. If it exists, it will call the configureJaas() method to create the context URL of that file. If such a configuration file is not present, it will then try to configure jaas programmatically. It also attempts to create the JaasSecurityContextFactory.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException
RecoverableException - if an error occurs that can be recovered from


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.