'Spring Security CAS - After Receiving the ticket unable to land to login screen
After receiving ticket unable to login to home screen, how I can debug the spring security part in my application? How can I debug the entry point of the application once ticket received?
@Configuration
@ComponentScan
public class CasSecurityConfiguration
{
private final String casServerLoginUrl;
private final String casServerUrl;
private final String casClientUrl;
@Autowired
public CasSecurityConfiguration(@Value("#{environment.casServerLoginUrl}") String casServerLoginUrl,
@Value("#{environment.casServerUrl}") String casServerUrl,
@Value("#{environment.casClientUrl}") String casClientUrl)
{
this.casServerLoginUrl = casServerLoginUrl;
this.casServerUrl = casServerUrl;
this.casClientUrl = casClientUrl;
}
@Bean
@SuppressWarnings("unchecked")
public CasAuthenticationProvider casAuthenticationProvider(TicketValidator ticketValidator,
ServiceProperties serviceProperties, CodesLdapUserDetailsService userDetailsService)
{
CasAuthenticationProvider provider = new CasAuthenticationProvider();
provider.setServiceProperties(serviceProperties);
provider.setTicketValidator(ticketValidator);
provider.setAuthenticationUserDetailsService(userDetailsService);
provider.setKey("cae");
return provider;
}
@Bean
public TicketValidator ticketValidator()
{
System.out.println("In ticketValidator ");
return new Cas20ServiceTicketValidator(casServerUrl);
}
@Bean
public AuthenticationManager authenticationManager(CasAuthenticationProvider casAuthenticationProvider)
{
System.out.println("In authenticationManager ");
return new ProviderManager(List.of(casAuthenticationProvider));
}
@Bean
public CasAuthenticationFilter casAuthenticationFilter(AuthenticationManager authenticationManager,
ServiceProperties serviceProperties)
{
System.out.println("In casAuthenticationFilter ");
CasAuthenticationFilter filter = new CasAuthenticationFilter();
filter.setAuthenticationManager(authenticationManager);
filter.setServiceProperties(serviceProperties);
return filter;
}
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint(ServiceProperties serviceProperties)
{
System.out.println("In casAuthenticationEntryPoint ");
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setServiceProperties(serviceProperties);
casAuthenticationEntryPoint.setLoginUrl(casServerLoginUrl);
return casAuthenticationEntryPoint;
}
@Bean
public ServiceProperties serviceProperties()
{
System.out.println("In serviceProperties ");
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService(casClientUrl);
serviceProperties.setSendRenew(false);
return serviceProperties;
}
After receiving ticket unable to login to home screen, How I can debug the spring security part in my application? How can I debug the entry point of the application once ticket received?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|