    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

##

DelegatingRealm()

##

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

##

DelegatingRealm

     public DelegatingRealm()

##

init

     public void init(String name,
                      Object ownerCredential) throws NotOwnerException

load

     public void load(String name,
                      Object credential) throws ClassNotFoundException, IOException, NotOwnerException

save

     public void save(String name) throws IOException

getName

     public String getName()

setDebug

     public void setDebug(boolean enable)

getUser

     public User getUser(String name)

getUser

     public User getUser(UserInfo userInfo)

authenticate

     public User authenticate(UserInfo userInfo)

getGroup

     public Group getGroup(String name)

getAclOwner

     public Principal getAclOwner(Object credential)

getAcl

     public Acl getAcl(String name)

getAcl

     public Acl getAcl(String name,
                       char separator)

getPermission

     public Permission getPermission(String name)

getUsers

     public Enumeration getUsers()

getGroups

     public Enumeration getGroups()

getAcls

     public Enumeration getAcls()

getPermissions

     public Enumeration getPermissions()

newUser

     public User newUser(String name,
                         Object credential,
                         Object constraints) throws SecurityException

newGroup

     public Group newGroup(String name) throws SecurityException

newAcl

     public Acl newAcl(Principal owner,
                       String name) throws SecurityException

newPermission

     public Permission newPermission(String name) throws SecurityException

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.

deleteGroup

     public void deleteGroup(Group group) throws SecurityException

deleteAcl

     public void deleteAcl(Principal owner,
                           Acl acl) throws SecurityException

setPermission

     public void setPermission(Acl acl,
                               Principal principal,
                               Permission permission,
                               boolean allow)

getDebugLog

     public LogOutputStream getDebugLog()

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.

getDelegator

     public Object getDelegator()

    All Examples  This Package  All Security Examples