Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEC-306: jsessionid included in CAS service on new Session -> authentication fails #570

Closed
spring-projects-issues opened this issue Jun 27, 2006 · 4 comments
Labels
in: cas An issue in spring-security-cas status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug type: jira An issue that was migrated from JIRA
Milestone

Comments

@spring-projects-issues
Copy link

Daniel Wiell(Migrated from SEC-306) said:

I just upgraded from 0.83 to 1.0.1 and have encountered a problem.

Here is the important part of the configuration.

When accessing the application, without any previous HttpSession created, the service parameter in the CAS loginUrl request contains the jsessionid.
That is, CAS creates a ticket for the service:
https://tomcat/j_acegi_cas_security_check?jsessionid= C1A1049F8A
The service should be:
https://tomcat/j_acegi_cas_security_check

Hence, the login fails.

My first shot for workaround was to set createSessionAllowed to false. While this got rid of the jsessionid parameter, it prevents the ExceptionTranslatorFilter from storing the original request. Hence, the defaultTargetUrl will used for redirection.

In my solution, I override CasProcessingFilterEntryPoint.commence(), copy and pasted the function and changed row 66 from:
final String urlEncodedService = response.encodeURL(this.serviceProperties.getService());
to:
final String urlEncodedService = this.serviceProperties.getService();

This works fine for me, as the urlEncodedService anyway is URL encoded in line 73.

@spring-projects-issues
Copy link
Author

Scott Battaglia said:

Acegi has the correct behavior. You are most likely using a version of CAS prior to 3.0.5, which did not strip the jsesson from the URL.

@spring-projects-issues
Copy link
Author

Scott Battaglia said:

CAS 3.0.5 was released which should correct the problem:
http://www.ja-sig.org/products/cas/announcements/index.html#ann1

@spring-projects-issues
Copy link
Author

Ben Alex said:

Scott, please close this issue if not Acegi Security specific.

@spring-projects-issues
Copy link
Author

Scott Battaglia said:

This was resolved with a fix to the CAS Server, version 3.0.5. This version correctly removes session ids from service urls.

@spring-projects-issues spring-projects-issues added in: cas An issue in spring-security-cas Closed type: bug A general bug status: declined A suggestion or change that we don't feel we should currently apply type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@spring-projects-issues spring-projects-issues added this to the 1.0.2 milestone Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: cas An issue in spring-security-cas status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug type: jira An issue that was migrated from JIRA
Projects
None yet
Development

No branches or pull requests

2 participants
@spring-projects-issues and others