From 7d4a40bdd6bf6ef37705be7131fdc179bb5c1e7d Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Mon, 30 Jul 2012 19:50:23 -0500 Subject: Refactored PKI JNDI realm. The PKI JNDI realm has been modified to utilize the authentication and authorization subsystems in PKI engine directly. It's no longer necessary to define the LDAP connection settings in Tomcat's configuration files. Ticket #126 --- .../src/com/netscape/certsrv/authentication/AuthToken.java | 4 ++++ .../src/com/netscape/certsrv/authentication/IAuthToken.java | 9 +++++++++ base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java | 9 +++++++++ 3 files changed, 22 insertions(+) (limited to 'base/common/src/com/netscape/certsrv') diff --git a/base/common/src/com/netscape/certsrv/authentication/AuthToken.java b/base/common/src/com/netscape/certsrv/authentication/AuthToken.java index 1b5bf2350..827278711 100644 --- a/base/common/src/com/netscape/certsrv/authentication/AuthToken.java +++ b/base/common/src/com/netscape/certsrv/authentication/AuthToken.java @@ -112,6 +112,10 @@ public class AuthToken implements IAuthToken { set(TOKEN_AUTHTIME, new Date()); } + public Object get(String attrName) { + return mAttrs.get(attrName); + } + public String getInString(String attrName) { return (String) mAttrs.get(attrName); } diff --git a/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java b/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java index e469f3786..3c03cc1f5 100644 --- a/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java +++ b/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java @@ -48,6 +48,15 @@ public interface IAuthToken { */ public boolean set(String name, String value); + /** + * Gets an attribute value. + * + * @param name the name of the attribute to return. + * @exception EBaseException on attribute handling errors. + * @return the attribute value + */ + public Object get(String name); + /** * Gets an attribute value. * diff --git a/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java b/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java index bbd051324..eb7f84ebf 100644 --- a/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java +++ b/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java @@ -124,6 +124,15 @@ public interface IUGSubsystem extends ISubsystem, IUsrGrp { */ public Enumeration findGroups(String filter) throws EUsrGrpException; + /** + * Finds groups that contain the user. + * + * @param userDn the user DN + * @return a list of groups that contain the given user + * @throws EUsrGrpException + */ + public Enumeration findGroupsByUser(String userDn) throws EUsrGrpException; + /** * Find a group for the given name * -- cgit