From a666b5f9741ef9b21f547d3b2141752a0383c70c Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 20 九月 2022 17:07:38 +0800 Subject: [PATCH] 1、修改登录页面 2、修改阿里代码规范问题 --- src/java/org/apereo/cas/web/flow/SendTicketGrantingTicketAction.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/java/org/apereo/cas/web/flow/SendTicketGrantingTicketAction.java b/src/java/org/apereo/cas/web/flow/SendTicketGrantingTicketAction.java index be53ab7..6d2e98c 100644 --- a/src/java/org/apereo/cas/web/flow/SendTicketGrantingTicketAction.java +++ b/src/java/org/apereo/cas/web/flow/SendTicketGrantingTicketAction.java @@ -13,6 +13,10 @@ import org.springframework.webflow.execution.Event; import org.springframework.webflow.execution.RequestContext; +/** + * @author Tanbin + * @date 2018-12-12 + */ public class SendTicketGrantingTicketAction extends AbstractAction { private static final Logger LOGGER = LoggerFactory.getLogger(SendTicketGrantingTicketAction.class); @@ -25,12 +29,16 @@ private ServicesManager servicesManager; private AuthenticationSystemSupport authenticationSystemSupport; - + + private static String mRenew = "renew"; + + @Override protected Event doExecute(RequestContext context) { String ticketGrantingTicketId = WebUtils.getTicketGrantingTicketId(context); String ticketGrantingTicketValueFromCookie = (String)context.getFlowScope().get("ticketGrantingTicketId"); - if (ticketGrantingTicketId == null) - return success(); + if (ticketGrantingTicketId == null) { + return success(); + } if (WebUtils.isAuthenticatingAtPublicWorkstation(context)) { LOGGER.info("Authentication is at a public workstation. SSO cookie will not be generated. Subsequent requests will be challenged for authentication."); } else if (!this.createSsoSessionCookieOnRenewAuthentications && isAuthenticationRenewed(context)) { @@ -40,15 +48,16 @@ this.ticketGrantingTicketCookieGenerator.addCookie(WebUtils.getHttpServletRequest(context), WebUtils.getHttpServletResponse(context), ticketGrantingTicketId); } - if (ticketGrantingTicketValueFromCookie != null && !ticketGrantingTicketId.equals(ticketGrantingTicketValueFromCookie)) - this.centralAuthenticationService.destroyTicketGrantingTicket(ticketGrantingTicketValueFromCookie); + if (ticketGrantingTicketValueFromCookie != null && !ticketGrantingTicketId.equals(ticketGrantingTicketValueFromCookie)) { + this.centralAuthenticationService.destroyTicketGrantingTicket(ticketGrantingTicketValueFromCookie); + } return success(); } public void setCreateSsoSessionCookieOnRenewAuthentications(boolean createSsoSessionCookieOnRenewAuthentications) { this.createSsoSessionCookieOnRenewAuthentications = createSsoSessionCookieOnRenewAuthentications; } private boolean isAuthenticationRenewed(RequestContext ctx) { - if (ctx.getRequestParameters().contains("renew")) { + if (ctx.getRequestParameters().contains(mRenew)) { LOGGER.debug("[{}] is specified for the request. The authentication session will be considered renewed.", "renew"); return true; } -- Gitblit v1.9.3