com.kakawait.spring.security.cas.authentication.DynamicProxyCallbackUrlCasAuthenticationProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-security-cas-extension Show documentation
Show all versions of spring-security-cas-extension Show documentation
Spring security cas extension and additional implementation used by the starter
package com.kakawait.spring.security.cas.authentication;
import com.kakawait.spring.security.cas.web.authentication.ProxyCallbackAndServiceAuthenticationDetails;
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
/**
* @author Thibaud Leprêtre
*/
public class DynamicProxyCallbackUrlCasAuthenticationProvider extends CasAuthenticationProvider {
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
if (authentication.getDetails() instanceof ProxyCallbackAndServiceAuthenticationDetails &&
getTicketValidator() instanceof Cas20ServiceTicketValidator) {
String proxyCallbackUrl = ((ProxyCallbackAndServiceAuthenticationDetails) authentication.getDetails())
.getProxyCallbackUrl();
((Cas20ServiceTicketValidator) getTicketValidator()).setProxyCallbackUrl(proxyCallbackUrl);
}
return super.authenticate(authentication);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy