Can't log in desktop application with SSO (CAS) configuration

Hi,

I am setting up a Nextcloud 23 installation with LDAP users and SSO authentication (with environment variable). It is working for my LDAP users in the browser: they authenticate with CAS (Apache is configured to require a valide CAS user).

Then, desktop client or Android client can’t log in.

For example, desktop client shows :

Error transfering http://cas.domain.tld/cas/login?service=https%3A%2F%2Fcloud.domain.tld%2Findex.php%2Flogin%2Fv2 - server replied: Bad request

Apache log :

x.x.x.x - - [07/Apr/2022:16:29:42 +0200] "GET /status.php HTTP/1.1" 200 8256 "-" "Mozilla/5.0 (Windows) mirall/3.4.4stable-Win64 (build 20220318) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
x.x.x.x - - [07/Apr/2022:16:29:42 +0200] "GET / HTTP/1.1" 302 964 "-" "Mozilla/5.0 (Windows) mirall/3.4.4stable-Win64 (build 20220318) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
x.x.x.x - - [07/Apr/2022:16:29:42 +0200] "GET /ocs/v2.php/cloud/capabilities?format=json HTTP/1.1" 200 1225 "-" "Mozilla/5.0 (Windows) mirall/3.4.4stable-Win64 (build 20220318) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
x.x.x.x - - [07/Apr/2022:16:29:43 +0200] "GET /index.php/login HTTP/1.1" 302 7465 "-" "Mozilla/5.0 (Windows) mirall/3.4.4stable-Win64 (build 20220318) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
x.x.x.x - - [07/Apr/2022:16:29:42 +0200] "PROPFIND /remote.php/dav/files// HTTP/1.1" 401 7735 "-" "Mozilla/5.0 (Windows) mirall/3.4.4stable-Win64 (build 20220318) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
x.x.x.x - - [07/Apr/2022:16:29:43 +0200] "POST /index.php/login/v2 HTTP/1.1" 302 1518 "-" "computer (Desktop Client - Windows)"

I can’t figure where it comes from and found nothing here.

Someone can help ?

No one can help me here ? Is there any other way i can get support ?