Search in sources :

Example 1 with ProxyException

use of org.pentaho.platform.proxy.impl.ProxyException in project pentaho-engineering-samples by pentaho.

the class PentahoSamlLogoutFilter method processLogout.

@Override
public void processLogout(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
    if (requiresLogout(request, response)) {
        if (isUseGlobalLogoutStrategy() && !idpContainsGlobalLogoutEndpoint(request, response)) {
            logger.error("User misconfiguration: SAML's 'use.global.logout.strategy' is set to 'true', but the selected " + "IdP does not declare a Global Logout endpoint. We will switch to a 'Local logout' behaviour.");
            setUseGlobalLogoutStrategy(false);
        }
        try {
            Authentication auth = Utils.getAuthenticationFromRequest(request, requireProxyWrapping);
            if (auth != null) {
                SecurityContextHolder.getContext().setAuthentication(auth);
            }
        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ProxyException e) {
            logger.error(e.getMessage(), e);
        }
    }
    super.processLogout(request, response, chain);
}
Also used : Authentication(org.springframework.security.core.Authentication) ProxyException(org.pentaho.platform.proxy.impl.ProxyException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ProxyException (org.pentaho.platform.proxy.impl.ProxyException)1 Authentication (org.springframework.security.core.Authentication)1