Search code examples
pythonsingle-sign-oncasmatrix-synapse

Matrix-synapse doesn't retrieve CAS attributes


I have a problem on Matrix-Synapse with the SSO using CAS.

Synapse doesn't retrieve CAS attributes synapse.handlers.sso - 1262 - INFO - GET-50 - SSO attribute missing.

But CAS sends the attributes and I can retrieve them with a PHP script on the same server.

I can't figure out where it's coming from, CAS Python library problem or CAS protocol configuration problem or anything else ?

I've modified /opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/handlers/cas.py to log the CAS response, here's what I get back:

<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationSuccess>
        <cas:user>MYUSER</cas:user>
    </cas:authenticationSuccess>
</cas:serviceResponse>

Informations :

  • Platform : KVM / Debian 11
  • Synapse Version : 1.85.0
  • Installation Method : Debian packages from packages.matrix.org
  • Database : PostgreSQL
  • Workers : Single process

Solution

  • This is a problem in synapse source code which uses hard coded protocol version 2 url.

    I proposed a pull request on the Synapse repository so you can set the CAS protocol version in homeserver.yaml : https://github.com/matrix-org/synapse/pull/15816