%@ taglib uri="urn:mace:shibboleth:2.0:idp:ui" prefix="idpui" %> <%@ page import="javax.servlet.http.Cookie" %> <%@ page import="org.opensaml.profile.context.ProfileRequestContext" %> <%@ page import="net.shibboleth.idp.authn.ExternalAuthentication" %> <%@ page import="net.shibboleth.idp.authn.context.AuthenticationContext" %> <%@ page import="net.shibboleth.idp.profile.context.RelyingPartyContext" %> <%@ page import="net.shibboleth.idp.ui.context.RelyingPartyUIContext" %> <% final Cookie[] cookies = request.getCookies(); if (cookies != null) { for (final Cookie cookie : cookies) { if (cookie.getName().equals("x509passthrough")) { response.sendRedirect(request.getContextPath() + "/Authn/X509?" + ExternalAuthentication.CONVERSATION_KEY + "=" + request.getParameter(ExternalAuthentication.CONVERSATION_KEY)); return; } } } final String key = ExternalAuthentication.startExternalAuthentication(request); final ProfileRequestContext prc = ExternalAuthentication.getProfileRequestContext(key, request); final AuthenticationContext authnContext = prc.getSubcontext(AuthenticationContext.class); final RelyingPartyContext rpContext = prc.getSubcontext(RelyingPartyContext.class); final RelyingPartyUIContext rpUIContext = authnContext.getSubcontext(RelyingPartyUIContext.class); final boolean identifiedRP = rpUIContext != null && !rpContext.getRelyingPartyId().contains(rpUIContext.getServiceName()); %>