Skip to content

Commit

Permalink
Fix pin cert enrollment in v2 APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarco76 committed Aug 27, 2024
1 parent da25f8a commit 76d7686
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import com.netscape.certsrv.request.RequestId;
import com.netscape.certsrv.request.RequestNotFoundException;
import com.netscape.certsrv.util.JSONSerializer;
import com.netscape.cms.authentication.DirBasedAuthentication;
import com.netscape.cms.profile.common.Profile;
import com.netscape.cms.servlet.cert.CertRequestInfoFactory;
import com.netscape.cms.servlet.cert.EnrollmentProcessor;
Expand Down Expand Up @@ -227,17 +228,18 @@ private CertRequestInfos submitRequest(
CertRequestInfos ret = new CertRequestInfos();

AuthCredentials credentials = new AuthCredentials();
String uid = data.getAttribute("uid");
String uid = data.getAttribute(DirBasedAuthentication.CRED_UID);
if (uid != null) {
credentials.set("uid", uid);
credentials.set(DirBasedAuthentication.CRED_UID, uid);
}
String password = data.getAttribute("pwd");
String password = data.getAttribute(DirBasedAuthentication.CRED_PWD);
if (password != null) {
credentials.set("pwd", password);
credentials.set(DirBasedAuthentication.CRED_PWD, password);
}
String pin = data.getAttribute(DirBasedAuthentication.CRED_PIN);
if (pin != null) {
credentials.set(DirBasedAuthentication.CRED_PIN, pin);
}

CAEngine engine = CAEngine.getInstance();

HashMap<String, Object> results = null;
if (data.isRenewal()) {
RenewalProcessor processor = new RenewalProcessor("caProfileSubmit", request.getLocale());
Expand Down

0 comments on commit 76d7686

Please sign in to comment.