use of org.pac4j.core.redirect.RedirectAction in project cas by apereo.
the class SAML2ClientLogoutAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
try {
final HttpServletRequest request = WebUtils.getHttpServletRequest(requestContext);
final HttpServletResponse response = WebUtils.getHttpServletResponse(requestContext);
final J2EContext context = WebUtils.getPac4jJ2EContext(request, response);
final SAML2Client client = clients.findClient(SAML2Client.class);
if (client != null) {
LOGGER.debug("Located SAML2 client [{}]", client);
final RedirectAction action = client.getLogoutAction(context, null, null);
LOGGER.debug("Preparing logout message to send is [{}]", action.getLocation());
action.perform(context);
}
} catch (final Exception e) {
LOGGER.warn(e.getMessage(), e);
}
return null;
}
use of org.pac4j.core.redirect.RedirectAction in project cas by apereo.
the class OidcCasClientRedirectActionBuilder method build.
@Override
public RedirectAction build(final CasClient casClient, final WebContext context) {
final Optional<Authentication> auth = oidcAuthorizationRequestSupport.isCasAuthenticationAvailable(context);
auth.ifPresent(authentication -> oidcAuthorizationRequestSupport.configureClientForMaxAgeAuthorizationRequest(casClient, context, authentication));
OidcAuthorizationRequestSupport.configureClientForPromptLoginAuthorizationRequest(casClient, context);
OidcAuthorizationRequestSupport.configureClientForPromptNoneAuthorizationRequest(casClient, context);
final RedirectAction action = super.build(casClient, context);
LOGGER.debug("Final redirect action is [{}]", action);
return action;
}
Aggregations