Source:
protected synchronized byte[] retrievePasswordFromCasServer() { if (cachedCredentials == null) { if (proxyTicket == null) { if (log.isDebugEnabled()) { log.debug("Attempting to get Proxy Ticket (PGT) using Proxy Granting Ticket (PGTIOU) for user " + assertion.getPrincipal().getName()); } proxyTicket = assertion.getPrincipal().getProxyTicketFor(this.clearPassUrl); } if (proxyTicket != null) { if (log.isDebugEnabled()) { log.debug("Attempting to get password using Proxy Ticket (PGT) " + proxyTicket + " for user " + assertion.getPrincipal().getName()); } String password = retrievePasswordUsingProxyTicket(proxyTicket); if (password != null) { log.debug("Password retrieved from ClearPass."); this.cachedCredentials = password.getBytes(); } else { log.debug("Unable to retrieve password from ClearPass using proxy ticket."); } } if (cachedCredentials == null) { if (++passwordRetrievalCount >= MAX_PASSWORD_RETRIEVAL_ATTEMPTS) { if (log.isDebugEnabled()) { log.error("Unable to obtain proxy ticket (PGT) from proxy granting ticket (PGTIOU) for" + " ClearPass service during for " + assertion.getPrincipal().getName() + " in " + MAX_PASSWORD_RETRIEVAL_ATTEMPTS + " attempts. Check your uPortal and CAS" + " configuration. See uPortal manual section on Caching and Replaying credentials"); } } else { if (log.isDebugEnabled()) { log.info("Unable to obtain proxy ticket (PGT) from proxy granting ticket (PGTIOU) for" + " ClearPass service during for " + assertion.getPrincipal().getName() + ". Will try" + " again " + Integer.toString(MAX_PASSWORD_RETRIEVAL_ATTEMPTS - passwordRetrievalCount) + " more times to wait for it to replicate to this server through distributed cache"); } executor.schedule(new ObtainPasswordWorker(this), PASSWORD_RETRIEVAL_DELAY, TimeUnit.MILLISECONDS); } } } return cachedCredentials; }

Target:
protected synchronized byte[] retrievePasswordFromCasServer() { if (cachedCredentials == null) { if (proxyTicket == null) { log.debug("Attempting to get CAS ClearPass Proxy Ticket for user using PGTIOU in assertion", assertion.getPrincipal().getName()); proxyTicket = assertion.getPrincipal().getProxyTicketFor(this.clearPassUrl); } if (proxyTicket != null) { log.debug("Attempting to get password for user using Proxy Ticket {}", assertion.getPrincipal().getName(), proxyTicket); String password = retrievePasswordUsingProxyTicket(proxyTicket); if (password != null) { log.debug("Password retrieved from ClearPass."); this.cachedCredentials = password.getBytes(); } } if (cachedCredentials == null) { String message = proxyTicket == null ? "proxy ticket" : "password"; if (++passwordRetrievalCount > passwordRetrievalMaxRetryAttempts) { log.error("Unable to obtain for from CAS ClearPass in attempts. Check your" + " uPortal and CAS configuration. See uPortal manual section on Caching and" + " Replaying credentials", message, assertion.getPrincipal().getName(), passwordRetrievalCount); } else { log.info("Unable to obtain for from CAS ClearPass. Will try again more times {}", message, assertion.getPrincipal().getName(), passwordRetrievalMaxRetryAttempts - passwordRetrievalCount + 1, proxyTicket == null ? " for PGT to replicate to this server through distributed cache" : ""); executor.schedule(new ObtainPasswordWorker(this), passwordRetrievalDelay, TimeUnit.MILLISECONDS); } } } return cachedCredentials; }