/**
* Recievies the request.
*/
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
log.trace(">doPost");
Admin internalAdmin = Admin.getInternalAdmin();
GlobalConfiguration globalConfiguration = globalConfigurationSession.getCachedGlobalConfiguration(internalAdmin);
// Make sure we allow use of this Servlet
if ( !globalConfiguration.getAutoEnrollUse() ) {
log.info("Unauthorized access attempt from " + request.getRemoteAddr());
response.getOutputStream().println("Not allowed.");
return;
}
int caid = globalConfiguration.getAutoEnrollCA();
if (caid == GlobalConfiguration.AUTOENROLL_DEFAULT_CA) {
log.info("Configure a proper CA to use with enroll.");
response.getOutputStream().println("Configure a proper CA to use with enroll.");
return;
}
boolean debugRequest = "true".equalsIgnoreCase(request.getParameter("debug"));
String debugInfo = "";
Admin admin = new Admin(Admin.TYPE_RA_USER, request.getRemoteAddr());
RequestHelper.setDefaultCharacterEncoding(request);
if (debugRequest) {
debugInfo += "getAttributeNames:\n";
Enumeration enumeration = request.getAttributeNames();