electric.security.jaas
Class JAASRealm

java.lang.Object
  extended byelectric.security.jaas.JAASRealm
All Implemented Interfaces:
IEXMLLoggingConstants, IGLUELoggingConstants, ILoggingConstants, IRealm

public class JAASRealm
extends java.lang.Object
implements IRealm, IGLUELoggingConstants

JAASRealm.

Author:
webMethods

Field Summary
 
Fields inherited from interface electric.glue.IGLUELoggingConstants
CLUSTER_DEBUG_EVENT, CLUSTER_EVENT, CONSOLE_DEBUG_EVENT, DEPLOY_EVENT, DETECTORS_EVENT, HTTP_EVENT, JMS_EVENT, REBINDING_EVENT, SECURITY_DEBUG_EVENT, SECURITY_DETAIL_EVENT, SERVLET_EVENT, SOAP_EVENT
 
Fields inherited from interface electric.xml.IEXMLLoggingConstants
MAPPING_EVENT, SCHEMA_EVENT
 
Fields inherited from interface electric.util.log.ILoggingConstants
CLASSLOADER_EVENT, COMMAND_EVENT, COMMENT_EVENT, CONFIG_EVENT, DEBUG_EVENT, ELECTRIC_LOGGING_PROPERTY, ERROR_EVENT, EXCEPTION_EVENT, FILE_EVENT, LICENSE_EVENT, RESOURCES_EVENT, SECURITY_EVENT, SHUTDOWN_EVENT, SOURCE_EVENT, SQL_EVENT, STARTUP_EVENT, WARNING_EVENT
 
Constructor Summary
JAASRealm(java.lang.String realmName)
           
JAASRealm(java.lang.String realmName, java.lang.String jaasConfig)
           
JAASRealm(java.lang.String realmName, java.lang.String jaasConfig, java.lang.String className)
           
 
Method Summary
 void addCallback(java.lang.String prompt, java.lang.String response)
          Use this method to tie together a Prompt from a JAAS TextInputCallback to the response that should be used.
 boolean authenticate(ICredentials credentials)
           
 boolean authenticateBasic(PasswordCredentials credentials)
           
static void disable()
           
static void enable()
           
 java.lang.String getName()
           
 java.lang.String getPassword(java.lang.String user)
          Not all realms expose credentials/passwords.
 java.security.Principal getPrincipal(java.lang.String user)
          Get the principal associated with a user.
 java.lang.String[] getRoles(java.lang.String user)
          Get the roles of a person who is already logged in.
static boolean isEnabled()
           
 boolean isUserInRole(java.lang.String user, java.lang.String[] roles)
          is the user in one of these roles
 void setPrincipalClass(java.lang.Class principal)
          This sets the class that will be used to find what groups you are a member of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAASRealm

public JAASRealm(java.lang.String realmName)
Parameters:
realmName -

JAASRealm

public JAASRealm(java.lang.String realmName,
                 java.lang.String jaasConfig)
Parameters:
realmName -
jaasConfig -

JAASRealm

public JAASRealm(java.lang.String realmName,
                 java.lang.String jaasConfig,
                 java.lang.String className)
          throws java.lang.ClassNotFoundException
Parameters:
realmName -
jaasConfig -
className -
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface IRealm

getPrincipal

public java.security.Principal getPrincipal(java.lang.String user)
Get the principal associated with a user. This user has to have previously logged in.

Specified by:
getPrincipal in interface IRealm
Parameters:
user -

getPassword

public java.lang.String getPassword(java.lang.String user)
Description copied from interface: IRealm
Not all realms expose credentials/passwords. This will go away during the move to AuthComparator objects.

Specified by:
getPassword in interface IRealm
Parameters:
user -

getRoles

public java.lang.String[] getRoles(java.lang.String user)
Get the roles of a person who is already logged in. This uses the principal class specified through the setPrincipalClass method. The default principal is null, which means that this returns an empty string array (String[ 0 ]).

Specified by:
getRoles in interface IRealm
Parameters:
user -

isUserInRole

public boolean isUserInRole(java.lang.String user,
                            java.lang.String[] roles)
Description copied from interface: IRealm
is the user in one of these roles

Specified by:
isUserInRole in interface IRealm
Parameters:
user -
roles -

addCallback

public void addCallback(java.lang.String prompt,
                        java.lang.String response)
Use this method to tie together a Prompt from a JAAS TextInputCallback to the response that should be used. This is useful for things such as NT domains.

Parameters:
prompt -
response -

setPrincipalClass

public void setPrincipalClass(java.lang.Class principal)
This sets the class that will be used to find what groups you are a member of. This is experimental at the moment. If you are using something like JBoss, this could be org.jboss.security.SimpleGroup.class.

Parameters:
principal -

authenticate

public boolean authenticate(ICredentials credentials)
                     throws java.lang.SecurityException
Specified by:
authenticate in interface IRealm
Parameters:
credentials -
Throws:
java.lang.SecurityException

authenticateBasic

public boolean authenticateBasic(PasswordCredentials credentials)
Parameters:
credentials -

enable

public static void enable()

isEnabled

public static boolean isEnabled()

disable

public static void disable()


copyright© 2001-2004 by webMethods All Rights Reserved.