<%@page import="javax.naming.InitialContext"%> <%@page import="com.sap.engine.services.configuration.appconfiguration.*"%> <%@page import="java.util.Properties"%> <%@page import="java.util.Enumeration"%> <%@page import="com.sap.engine.frame.core.configuration.*"%> <%@page import="com.sap.tc.logging.Location"%> <%@page import="com.sap.tc.logging.Severity"%> <%! static Location LOCATION =Location.getLocation("com.sap.security.core.server.tcsra.response"); %> <% String userdn = (String) session.getAttribute("tcs.j2ee-ra.userdn"); String redirecturl = (String)session.getAttribute("OLDSERVICE"); if ( redirecturl==null ) redirecturl="/"; if (userdn==null ||"".equals(userdn.trim()) ) { LOCATION.debugT("direct access to enrollapp/response.jsp not allowed"); response.sendRedirect("/"); return; } String tcsresult=request.getParameter("tcsresult"); if ("reqok".equals( tcsresult ) ) { LOCATION.debugT("certificate successfuly issued for " + userdn); response.sendRedirect(redirecturl); return; } String descr=request.getParameter("descr"); LOCATION.debugT("certificate enrollment failed for " + userdn +" Error description from browser was: " +descr); String errorMessage = null; try { InitialContext ctx = new InitialContext(); //get ApplicationConfigHandlerFactory instance from JNDI ApplicationConfigHandlerFactory appCfgHdlFctry = (ApplicationConfigHandlerFactory)ctx.lookup("ApplicationConfiguration"); if (appCfgHdlFctry != null) { Properties props = appCfgHdlFctry.getApplicationProperties(); if ( props !=null ) errorMessage = props.getProperty ("tcsra.response_errmsg_1"); } } catch (Exception e) { //this is not so important we can continue with default error message LOCATION.traceThrowableT(Severity.DEBUG, "Problem with ApplicationConfigHandlerFactory", e); } if (errorMessage== null ) errorMessage ="Certificate enrollment failed !"; %>