CAS redirection after successful athentication

198 views
Skip to first unread message

rajeswari

unread,
Jul 10, 2018, 5:51:52 AM7/10/18
to CAS Community
I am working on CAS Version: 5.3.0-SNAPSHOT, while the client has dependency on  spring-security-cas 4.1.3.RELEASE version.
After submitting with valid credentials, ticket is being created and redirecting to "Site can't be reached page" with the url appending the ticket id.

The web page at http://localhost:8080/sso/login/cas?ticket=ST-2-MSaxO06TytD40x--kjP3zcu1iEcrajeswari-H110M-S2 might be temporarily down or it may have moved permanently to a new web address.

ERR_CONTENT_DECODING_FAILED.


Can someone guide me to resolve the issue.

Ray Bon

unread,
Jul 10, 2018, 12:19:33 PM7/10/18
to cas-...@apereo.org
Rajeswari,

Do you have an application running at http://localhost:8080/sso/login/cas ?

Ray
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

rajeswari

unread,
Jul 12, 2018, 5:59:03 AM7/12/18
to CAS Community
Hi Ray

I have client application at http://localhost:8080/sso/login. This is the url http://localhost:8080/sso/login/cas  with which service at CAS has been registered.

It is invoking that service at CAS and after successful authentication, it is being redirected to the same url, appending the ticket id.


Regards
Rajeswari

Ramakrishna G

unread,
Jul 12, 2018, 6:02:41 AM7/12/18
to cas-...@apereo.org

Are you using Apache cas client?

 

Can you share the VirtualHost config?

 

Thanks

 

Sent from Mail for Windows 10

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/be0e1074-bca9-490d-9735-e84f28905f96%40apereo.org.

 

rajeswari

unread,
Jul 12, 2018, 6:56:26 AM7/12/18
to CAS Community
Attached is the Config file.
Config.java

Ramakrishna G

unread,
Jul 13, 2018, 12:57:43 AM7/13/18
to CAS Community
Everything seems OK.

But http://localhost:8080/sso/login/cas looks like it is down. Try accessing the same url without CAS. I think you can print logs in your application and find out error.

Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/2db25d65-9f74-455a-a6d8-bc4cf2e6e067%40apereo.org.

rajeswari

unread,
Jul 14, 2018, 2:22:08 AM7/14/18
to CAS Community, r...@tts.in
 Here is the log from client application

 2018-07-14 11:42:43 DEBUG AndRequestMatcher:66 - Trying to match using Ant [pattern='/**', GET]
2018-07-14 11:42:43 DEBUG AntPathRequestMatcher:147 - Request '/login' matched by universal pattern '/**'
2018-07-14 11:42:43 DEBUG AndRequestMatcher:66 - Trying to match using NegatedRequestMatcher [requestMatcher=Ant [pattern='/**/favicon.ico']]
2018-07-14 11:42:43 DEBUG AntPathRequestMatcher:157 - Checking match of request : '/login'; against '/**/favicon.ico'
2018-07-14 11:42:43 DEBUG NegatedRequestMatcher:51 - matches = true
2018-07-14 11:42:43 DEBUG AndRequestMatcher:66 - Trying to match using NegatedRequestMatcher [requestMatcher=MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.HeaderContentNegotiationStrategy@2440314a, matchingMediaTypes=[application/json], useEquals=false, ignoredMediaTypes=[*/*]]]
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:185 - httpRequestMediaTypes=[text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8]
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:189 - Processing text/html
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:205 - application/json .isCompatibleWith text/html = false
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:189 - Processing application/xhtml+xml
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:205 - application/json .isCompatibleWith application/xhtml+xml = false
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:189 - Processing application/xml;q=0.9
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:205 - application/json .isCompatibleWith application/xml;q=0.9 = false
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:189 - Processing */*;q=0.8
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:192 - Ignoring
2018-07-14 11:42:43 DEBUG MediaTypeRequestMatcher:213 - Did not match any media types
2018-07-14 11:42:43 DEBUG NegatedRequestMatcher:51 - matches = true
2018-07-14 11:42:43 DEBUG AndRequestMatcher:66 - Trying to match using NegatedRequestMatcher [requestMatcher=RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]]
2018-07-14 11:42:43 DEBUG NegatedRequestMatcher:51 - matches = true
2018-07-14 11:42:43 DEBUG AndRequestMatcher:73 - All requestMatchers returned true
2018-07-14 11:42:43 DEBUG HttpSessionRequestCache:58 - DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/sso/login]
2018-07-14 11:42:43 DEBUG ExceptionTranslationFilter:203 - Calling Authentication entry point.
2018-07-14 11:42:43 DEBUG HstsHeaderWriter:130 - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@2ed98901
2018-07-14 11:42:43 DEBUG HttpSessionSecurityContextRepository:352 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2018-07-14 11:42:43 DEBUG SecurityContextPersistenceFilter:119 - SecurityContextHolder now cleared, as request processing completed
In LoggerFilter after doFilter
/sso/login/cas
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 1 of 14 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 2 of 14 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2018-07-14 11:44:40 DEBUG HttpSessionSecurityContextRepository:174 - No HttpSession currently exists
2018-07-14 11:44:40 DEBUG HttpSessionSecurityContextRepository:116 - No SecurityContext was available from the HttpSession: null. A new one will be created.
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 3 of 14 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 4 of 14 in additional filter chain; firing Filter: 'CsrfFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 5 of 14 in additional filter chain; firing Filter: 'LogoutFilter'
2018-07-14 11:44:40 DEBUG AntPathRequestMatcher:157 - Checking match of request : '/login/cas'; against '/logout/cas'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 6 of 14 in additional filter chain; firing Filter: 'LogoutFilter'
2018-07-14 11:44:40 DEBUG AntPathRequestMatcher:137 - Request 'GET /login/cas' doesn't match 'POST /logout
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 7 of 14 in additional filter chain; firing Filter: 'SingleSignOutFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 8 of 14 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 9 of 14 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 10 of 14 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 11 of 14 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2018-07-14 11:44:40 DEBUG AnonymousAuthenticationFilter:100 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6faa1b5a: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff6a82: RemoteIpAddress: 192.168.2.24; SessionId: 0B03A9D8B9746A65E6A2842400557CBC; Granted Authorities: ROLE_ANONYMOUS'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 12 of 14 in additional filter chain; firing Filter: 'SessionManagementFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 13 of 14 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2018-07-14 11:44:40 DEBUG FilterChainProxy:325 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 at position 14 of 14 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2018-07-14 11:44:40 DEBUG RegexRequestMatcher:109 - Checking match of request : '/login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2'; against '/secured.*'
2018-07-14 11:44:40 DEBUG RegexRequestMatcher:109 - Checking match of request : '/login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2'; against '/login'
2018-07-14 11:44:40 DEBUG RegexRequestMatcher:109 - Checking match of request : '/login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2'; against '/'
2018-07-14 11:44:40 DEBUG FilterSecurityInterceptor:210 - Public object - authentication not attempted
2018-07-14 11:44:40 DEBUG FilterChainProxy:310 - /login/cas?ticket=ST-1-uf0QEa3GAoYnaCWur5IgKxO6CQErajeswari-H110M-S2 reached end of additional filter chain; proceeding with original chain
2018-07-14 11:44:40 DEBUG HstsHeaderWriter:130 - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@2ed98901
2018-07-14 11:44:40 DEBUG HttpSessionSecurityContextRepository:352 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2018-07-14 11:44:40 DEBUG ExceptionTranslationFilter:117 - Chain processed normally
2018-07-14 11:44:40 DEBUG SecurityContextPersistenceFilter:119 - SecurityContextHolder now cleared, as request processing completed



============================================================================

this is the WebSecurityConfig



@EnableWebMvcSecurity
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    private AuthenticationProvider authenticationProvider;
    private AuthenticationEntryPoint authenticationEntryPoint;
    private SingleSignOutFilter singleSignOutFilter;
    private LogoutFilter logoutFilter;
   
//    public SecurityConfig() {
//        // TODO Auto-generated constructor stub
//    }

    @Autowired
    public SecurityConfig(CasAuthenticationProvider casAuthenticationProvider, AuthenticationEntryPoint eP,
                          LogoutFilter lF
                          , SingleSignOutFilter ssF
    ) {
        this.authenticationProvider = casAuthenticationProvider;
        this.authenticationEntryPoint = eP;

        this.logoutFilter = lF;
        this.singleSignOutFilter = ssF;

    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
      http
        .authorizeRequests()
        .regexMatchers("/secured.*", "/login")
        .authenticated()
        .and()
        .authorizeRequests()
        .regexMatchers("/")
        .permitAll()
        .and()
        .httpBasic()
        .authenticationEntryPoint(authenticationEntryPoint)
        .and()
        .logout().logoutSuccessUrl("/logout")
        .and()
        .addFilterBefore(singleSignOutFilter, CasAuthenticationFilter.class)
        .addFilterBefore(logoutFilter, LogoutFilter.class);

    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
      auth.authenticationProvider(authenticationProvider);
    }

    @Override
    protected AuthenticationManager authenticationManager() throws Exception {
      return new ProviderManager(Arrays.asList(authenticationProvider));
    }

    @Bean
    public CasAuthenticationFilter casAuthenticationFilter(ServiceProperties sP) throws Exception {
      CasAuthenticationFilter filter = new CasAuthenticationFilter();
      filter.setServiceProperties(sP);
      filter.setAuthenticationManager(authenticationManager());
      return filter;
Reply all
Reply to author
Forward
0 new messages