org.apache.geronimo.security.realm
Class GenericSecurityRealm

java.lang.Object
  extended by org.apache.geronimo.security.realm.GenericSecurityRealm
All Implemented Interfaces:
SecurityRealm, ConfigurationEntryFactory, ConfigurationFactory

@GBean(j2eeType="SecurityRealm")
public class GenericSecurityRealm
extends Object
implements SecurityRealm, ConfigurationEntryFactory, ConfigurationFactory

A security realm that can be configured for one or more login modules. It can handle a combination of client-side and server-side login modules for the case of remote clients, and it can auto-role-mapping for its login modules (though you must configure it for that).

This realm populates a number of special login module options for the benefit of Geronimo login modules (though some of them are only available to server-side login modules, marked as not Serializable below):

 Option                                      Type                   Serializable
 JaasLoginModuleUse.KERNEL_LM_OPTION       String (Kernel name)        Yes
 JaasLoginModuleUse.SERVERINFO_LM_OPTION   ServerInfo                  No
 JaasLoginModuleUse.CLASSLOADER_LM_OPTION  ClassLoader                 No
 
These options can be safely ignored by login modules that don't need them (such as any custom LoginModules you may already have lying around).

Version:
$Rev: 932529 $ $Date: 2010-04-10 01:47:23 +0800 (Sat, 10 Apr 2010) $

Constructor Summary
GenericSecurityRealm(String realmName, JaasLoginModuleUse loginModuleUse, boolean wrapPrincipals, boolean global, ServerInfo serverInfo, org.osgi.framework.Bundle bundle, Kernel kernel)
           
 
Method Summary
 AppConfigurationEntry[] getAppConfigurationEntries()
          Generate the AppConfigurationEntry array for the login modules in this configuration.
 Configuration getConfiguration()
           
 String getConfigurationName()
          Used to obtain the configuration name to be associated with the generated AppConfigurationEntry array.
 String[] getLoginDomains()
          Gets a list of the login domains that make up this security realm.
 JaasLoginModuleChain getLoginModuleChain()
          Gets the first JaasLoginModuleChain node in the chain of LoginModules for this realm.
 String getRealmName()
           
 boolean isGlobal()
          return false to exclude from global GeronimoLoginConfiguration
 boolean isWrapPrincipals()
          If this attribute is true, then the principals will be wrapped in realm principals.
 void refresh()
          delegate from Configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericSecurityRealm

public GenericSecurityRealm(@ParamAttribute(name="realmName")
                            String realmName,
                            @ParamReference(name="LoginModuleConfiguration",namingType="LoginModuleUse")
                            JaasLoginModuleUse loginModuleUse,
                            @ParamAttribute(name="wrapPrincipals")
                            boolean wrapPrincipals,
                            @ParamAttribute(name="global")
                            boolean global,
                            @ParamReference(name="ServerInfo")
                            ServerInfo serverInfo,
                            @ParamSpecial(type=bundle)
                            org.osgi.framework.Bundle bundle,
                            @ParamSpecial(type=kernel)
                            Kernel kernel)
                     throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

getRealmName

public String getRealmName()
Specified by:
getRealmName in interface SecurityRealm

getAppConfigurationEntries

public AppConfigurationEntry[] getAppConfigurationEntries()
Description copied from interface: ConfigurationEntryFactory
Generate the AppConfigurationEntry array for the login modules in this configuration.

Specified by:
getAppConfigurationEntries in interface ConfigurationEntryFactory
Returns:
a AppConfigurationEntry[]

getLoginModuleChain

public JaasLoginModuleChain getLoginModuleChain()
Description copied from interface: SecurityRealm
Gets the first JaasLoginModuleChain node in the chain of LoginModules for this realm.


getLoginDomains

public String[] getLoginDomains()
Gets a list of the login domains that make up this security realm. A particular LoginModule represents 0 or 1 login domains, and a realm is composed of a number of login modules, so the realm may cover any number of login domains, though typically that number will be 1.


isWrapPrincipals

public boolean isWrapPrincipals()
If this attribute is true, then the principals will be wrapped in realm principals.


getConfigurationName

public String getConfigurationName()
Description copied from interface: ConfigurationEntryFactory
Used to obtain the configuration name to be associated with the generated AppConfigurationEntry array.

Specified by:
getConfigurationName in interface ConfigurationEntryFactory
Specified by:
getConfigurationName in interface ConfigurationFactory
Returns:
the configuration name

isGlobal

public boolean isGlobal()
Description copied from interface: ConfigurationEntryFactory
return false to exclude from global GeronimoLoginConfiguration

Specified by:
isGlobal in interface ConfigurationEntryFactory
Returns:
whether to include in GeronimoLoginConfiguration

refresh

public void refresh()
Description copied from interface: ConfigurationEntryFactory
delegate from Configuration

Specified by:
refresh in interface ConfigurationEntryFactory

getConfiguration

public Configuration getConfiguration()
Specified by:
getConfiguration in interface ConfigurationFactory


Copyright © 2003-2011 The Apache Geronimo development community. All Rights Reserved.