I have implemented the CasOAuthWrapperClient , to perform Oauth against a local CAS server , the authentication is successfull but the context always returns AnonymousAuthenticationToken .
I am using spring security configuration.
23 Feb 2016 17:24:25,916 DEBUG ClientAuthenticationEntryPoint:50 - client: <CasOAuthWrapperClient> | name: CasOAuthWrapperClient |
Feb 23, 2016 5:24:58 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [mvc-dispatcher] in context with path [/portal] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.springframework.security.authentication.AnonymousAuthenticationToken cannot be cast to org.pac4j.springframework.security.authentication.ClientAuthenticationToken] with root cause
java.lang.ClassCastException: org.springframework.security.authentication.AnonymousAuthenticationToken cannot be cast to org.pac4j.springframework.security.authentication.ClientAuthenticationToken
at net.laureate.core.web.SessionInterceptor.preHandle(SessionInterceptor.java:80)
at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:954)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilte