%@ include file="/portal/include/include_java.jsp" %>
<%@ include file="/portal/include/site_wide_banner.jsp" %>
<%@ page import="com.appiancorp.security.cors.CorsUtil"%>
<%@ page import="com.appiancorp.security.csrf.CsrfConstants"%>
<%@ page import="com.appiancorp.security.csrf.CsrfTokenManager"%>
<%@ page import="java.util.UUID" %>
<%@ page import="com.appiancorp.ap2.ServletScopesKeys" %>
<%
if (!CorsUtil.isAllowedOriginOrReferrer(request)) {
response.setHeader("X-Frame-Options", "SAMEORIGIN");
}
%>
<%
// Only generate a new CSRF token if the user's session has not been initialized to avoid the rare occasion
// that a user navigates to /forgotpasswordrequest while logged in
if (session.getAttribute(ServletScopesKeys.KEY_USER) == null) {
CsrfTokenManager.storeCsrfTokenInResponse(request, response, CsrfConstants.CSRF_TOKEN_COOKIE, UUID.randomUUID().toString());
}
%>