Skip to content

Commit

Permalink
Merge IPasswdUserDBAuthentication into PasswdUserDBAuthentication
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jul 18, 2023
1 parent fc19765 commit 5da3c59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import com.netscape.certsrv.authentication.AuthCredentials;
import com.netscape.certsrv.authentication.EInvalidCredentials;
import com.netscape.certsrv.authentication.EMissingCredential;
import com.netscape.certsrv.authentication.IPasswdUserDBAuthentication;
import com.netscape.certsrv.base.SessionContext;
import com.netscape.certsrv.logging.ILogger;
import com.netscape.certsrv.logging.event.AuthEvent;
import com.netscape.certsrv.usrgrp.EUsrGrpException;
import com.netscape.cmscore.apps.CMSEngine;
import com.netscape.cmscore.authentication.AuthSubsystem;
import com.netscape.cmscore.authentication.CertUserDBAuthentication;
import com.netscape.cmscore.authentication.PasswdUserDBAuthentication;
import com.netscape.cmscore.logging.Auditor;
import com.netscape.cmscore.usrgrp.Group;
import com.netscape.cmscore.usrgrp.UGSubsystem;
Expand Down Expand Up @@ -67,8 +67,8 @@ public Principal authenticate(String username, String password) {
AuthManager authMgr = authSub.getAuthManager(AuthSubsystem.PASSWDUSERDB_AUTHMGR_ID);

AuthCredentials creds = new AuthCredentials();
creds.set(IPasswdUserDBAuthentication.CRED_UID, username);
creds.set(IPasswdUserDBAuthentication.CRED_PWD, password);
creds.set(PasswdUserDBAuthentication.CRED_UID, username);
creds.set(PasswdUserDBAuthentication.CRED_PWD, password);

AuthToken authToken = authMgr.authenticate(creds); // throws exception if authentication fails
authToken.set(SessionContext.AUTH_MANAGER_ID, AuthSubsystem.PASSWDUSERDB_AUTHMGR_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.netscape.certsrv.authentication.AuthCredentials;
import com.netscape.certsrv.authentication.EInvalidCredentials;
import com.netscape.certsrv.authentication.EMissingCredential;
import com.netscape.certsrv.authentication.IPasswdUserDBAuthentication;
import com.netscape.certsrv.base.EBaseException;
import com.netscape.certsrv.ldap.ELdapException;
import com.netscape.certsrv.profile.EProfileException;
Expand All @@ -52,15 +51,21 @@
* Used to authenticate administrators in the Certificate Server Console.
* Authentications by checking the uid and password against the
* database.
* <P>
*
* @author lhsiao, cfu
* @version $Revision$, $Date$
*/
public class PasswdUserDBAuthentication extends AuthManager implements IPasswdUserDBAuthentication {
public class PasswdUserDBAuthentication extends AuthManager {

public static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PasswdUserDBAuthentication.class);

/* required credentials. uid, pwd are strings */
public static final String CRED_UID = "uid";
public static final String CRED_PWD = "pwd";

/* attribute in returned token */
public static final String TOKEN_USERDN = "userdn";
public static final String TOKEN_USERID = "userid";

/* required credentials. uid, pwd are strings */
protected static String[] mRequiredCred = { CRED_UID, CRED_PWD };

Expand Down

0 comments on commit 5da3c59

Please sign in to comment.