-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CAS validation issue with synapse #2639
Comments
same issue |
The problem still exists in matrix-synapse-py3 0.99.2+stretch1 matrix-synapse-0.99.2-CAS-fix.diff.gz The service URL given to CAS is not supposed to change as long as synapse configuration stays the same, so we can have CasRedirectServlet store the url somewhere and later get it back in CasTicketServlet |
This ticket is s old. I came across the same problem. So how are others using cas. It seems impossible to me, or can there be a less strict validation on the cas side? we should implement the patch though! thanks @mijutu |
I had the same problem. I can confirm the patch works. |
// EDIT: After we implemented JSON in our CAS Server, it seems to be working BUT we had to disable the service url validation in our case to get this working. So this Bug is still there. Why is no one fixing it or applying the provided workaround/fix? |
The old patch didn't apply, so I made a new one. |
We had a pull request and there richvdh commented that the solution I used was wrong. I think he is correct. If two CAS logins happen at the same time, then users might end up at a wrong url. Probability of two simultaneous CAS logins is small because CAS is used only at the initial login. Browsers remember access tokens and CAS is rarely used. Homeserver owners might be able to use my patch for months or years without having issues, but if it's wrong, then it's wrong and shouldn't be merged. |
matrix-synapse-1.7.2-CAS-fix.diff.gz Here is a better fix for the problem. CasTicketServlet generates the service parameter from synapse config and redirectUrl parameter of the request. |
@mijutu please could you open a PR with your patch so that we can read and discuss it? |
Hello,
Description
It seems there is a problem with how CAS validation is handled in login.py#L420.
Steps to reproduce
service_url: https://matrix.domain
You'll see it doesn't work and if I'm not mistaken it is because in login.py#L397 we ask for a ticket with a service in the form of
https://matrix.domain/_matrix/client/api/v1/login/cas/ticket?redirectUrl=***
.But when we validate the ticket, we only send
cas_service_url
which lacks the/_matrix/client/api/v1/login/cas/ticket?redirectUrl=***
part so CAS fails the validation saying the ticket was used for another service than the one it was created for.I don't know if earlier versions were more lenient on validation, but I got it to work by replacing line 420 by this line:
But I'm sure there's a better way to do it...
I believe #2404 may be related to this problem.
Version information
If not matrix.org:
The text was updated successfully, but these errors were encountered: