Source:
public Optional<TokenCredentials> extract(final WebContext context) { final CasLogoutHandler logoutHandler = configuration.findLogoutHandler(); if (isTokenRequest(context)) { final String ticket = context.getRequestParameter(CasConfiguration.TICKET_PARAMETER).orElse(null); if (logoutHandler != null) { logoutHandler.recordSession(context, ticket); } final TokenCredentials casCredentials = new TokenCredentials(ticket); logger.debug("casCredentials: {}", casCredentials); return Optional.of(casCredentials); } else if (isBackLogoutRequest(context)) { final String logoutMessage = context.getRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER).orElse(null); logger.trace("Logout request:\n{}", logoutMessage); final String ticket = CommonHelper.substringBetween(logoutMessage, CasConfiguration.SESSION_INDEX_TAG + ">", "</"); if (CommonUtils.isNotBlank(ticket) && logoutHandler != null) { logoutHandler.destroySessionBack(context, ticket); } logger.debug("back logout request: no credential returned"); throw HttpAction.noContent(context); } else if (isFrontLogoutRequest(context)) { final String logoutMessage = uncompressLogoutMessage( context.getRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER).orElse(null) ); logger.trace("Logout request:\n{}", logoutMessage); final String ticket = CommonHelper.substringBetween(logoutMessage, CasConfiguration.SESSION_INDEX_TAG + ">", "</"); if (CommonUtils.isNotBlank(ticket) && logoutHandler != null) { logoutHandler.destroySessionFront(context, ticket); } logger.debug("front logout request: no credential returned"); computeRedirectionToServerIfNecessary(context); } return Optional.empty(); }

Target:
public Optional<TokenCredentials> extract(final WebContext context) { final CasLogoutHandler logoutHandler = configuration.findLogoutHandler(); if (isTokenRequest(context)) { final String ticket = context.getRequestParameter(CasConfiguration.TICKET_PARAMETER).get(); if (logoutHandler != null) { logoutHandler.recordSession(context, ticket); } final TokenCredentials casCredentials = new TokenCredentials(ticket); logger.debug("casCredentials: {}", casCredentials); return Optional.of(casCredentials); } else if (isBackLogoutRequest(context)) { final String logoutMessage = context.getRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER).get(); logger.trace("Logout request:\n{}", logoutMessage); final String ticket = CommonHelper.substringBetween(logoutMessage, CasConfiguration.SESSION_INDEX_TAG + ">", "</"); if (CommonUtils.isNotBlank(ticket) && logoutHandler != null) { logoutHandler.destroySessionBack(context, ticket); } logger.debug("back logout request: no credential returned"); throw HttpAction.noContent(context); } else if (isFrontLogoutRequest(context)) { final String logoutMessage = uncompressLogoutMessage( context.getRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER).get() ); logger.trace("Logout request:\n{}", logoutMessage); final String ticket = CommonHelper.substringBetween(logoutMessage, CasConfiguration.SESSION_INDEX_TAG + ">", "</"); if (CommonUtils.isNotBlank(ticket) && logoutHandler != null) { logoutHandler.destroySessionFront(context, ticket); } logger.debug("front logout request: no credential returned"); computeRedirectionToServerIfNecessary(context); } return Optional.empty(); }