All Examples  This Package  All Security Examples

Class examples.security.delegatingrealm.DelegatingRealm

java.lang.Object
   |
   +----examples.security.delegatingrealm.DelegatingRealm

public class DelegatingRealm
extends Object
implements ManageableRealm, DebuggableRealm
This realm delegates calls to methods of other objects. This can be useful if, for example, you want to obtain user and group information from the LDAP realm, but maintain ACLs in the RDBMS realm.

To use this class, set its name as the value of your weblogic.security.realmClass property, and create a delegating.properties file. The file uses standard Java properties file syntax, and should contain entries such as the following:

getUser = weblogic.security.ldaprealm.LDAPRealm.getUser
getGroup = weblogic.security.ldaprealm.LDAPRealm.getGroup
authenticate.1 = weblogic.security.ldaprealm.LDAPRealm.authenticate
authenticate.2 = examples.security.rdbmsrealm.RDBMSRealm.authenticate
getAcl = examples.security.rdbmsrealm.RDBMSRealm.getAcl
The above properties delegate user and group calls to the LDAP realm. The LDAP realm is the primary authentication delegate and the RDBMS realm is the secondary authentication delegate, which is consulted if the primary returns null. ACL-related methods are delegated to the RDBMS realm.

You should examine the source of this class before using it, to make sure it behaves as you expect. It should be easy to tailor to your exact needs.

Author:
Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.
See Also:
deleteUser

Constructor Index

 o DelegatingRealm()

Method Index

 o authenticate(UserInfo)
 o deleteAcl(Principal, Acl)
 o deleteGroup(Group)
 o deleteUser(User)
This method has an implementation note that you should read.
 o getAcl(String)
 o getAcl(String, char)
 o getAclOwner(Object)
 o getAcls()
 o getDebugLog()
 o getDelegator()
 o getGroup(String)
 o getGroups()
 o getName()
 o getPermission(String)
 o getPermissions()
 o getUser(String)
 o getUser(UserInfo)
 o getUsers()
 o init(String, Object)
 o load(String, Object)
 o newAcl(Principal, String)
 o newGroup(String)
 o newPermission(String)
 o newUser(String, Object, Object)
 o save(String)
 o setDebug(boolean)
 o setDelegator(Object)
Set the delegator of all of our delegated objects.
 o setPermission(Acl, Principal, Permission, boolean)

Constructors

 o DelegatingRealm
 public DelegatingRealm()

Methods

 o init
 public void init(String name,
                  Object ownerCredential) throws NotOwnerException
 o load
 public void load(String name,
                  Object credential) throws ClassNotFoundException, IOException, NotOwnerException
 o save
 public void save(String name) throws IOException
 o getName
 public String getName()
 o setDebug
 public void setDebug(boolean enable)
 o getUser
 public User getUser(String name)
 o getUser
 public User getUser(UserInfo userInfo)
 o authenticate
 public User authenticate(UserInfo userInfo)
 o getGroup
 public Group getGroup(String name)
 o getAclOwner
 public Principal getAclOwner(Object credential)
 o getAcl
 public Acl getAcl(String name)
 o getAcl
 public Acl getAcl(String name,
                   char separator)
 o getPermission
 public Permission getPermission(String name)
 o getUsers
 public Enumeration getUsers()
 o getGroups
 public Enumeration getGroups()
 o getAcls
 public Enumeration getAcls()
 o getPermissions
 public Enumeration getPermissions()
 o newUser
 public User newUser(String name,
                     Object credential,
                     Object constraints) throws SecurityException
 o newGroup
 public Group newGroup(String name) throws SecurityException
 o newAcl
 public Acl newAcl(Principal owner,
                   String name) throws SecurityException
 o newPermission
 public Permission newPermission(String name) throws SecurityException
 o deleteUser
 public void deleteUser(User user) throws SecurityException
This method has an implementation note that you should read.

For this and other methods that have return type void, if you specify multiple delegates in the properties file, only the first will be called. To change this behavior, edit the methods you are interested in so that they call callProxies instead.

 o deleteGroup
 public void deleteGroup(Group group) throws SecurityException
 o deleteAcl
 public void deleteAcl(Principal owner,
                       Acl acl) throws SecurityException
 o setPermission
 public void setPermission(Acl acl,
                           Principal principal,
                           Permission permission,
                           boolean allow)
 o getDebugLog
 public LogOutputStream getDebugLog()
 o setDelegator
 public void setDelegator(Object obj)
Set the delegator of all of our delegated objects. We explicitly avoid setting ourselves up as the delegator, because we want to be as transparent as possible.

 o getDelegator
 public Object getDelegator()

All Examples  This Package  All Security Examples