A “negative” workaround (seen here) seems to be to completely disable the SSO with an app manifest setting auth_header = false.
I see that setting does otherwise always default to "auth_header": "basic-with-password" in /etc/ssowat/conf.json. (Contrary to the comment “By default, the password is not injected anymore” it’s currently always overridden.)
[ EDIT: More precisely: the authorisation header is always overriden with auth_header and always injecting at least ‘-’ for a password. (No way to get SSO user headers without overriding the authorisation header (auth_header = false)? ]
Further, apps that use the the email as login identifier instead of the username (like mobilizon), wouldn’t these rather need a proper override like:
“auth_header”: “basic-email-with-password”? (if they really accept a (basic) auth_header for SSO)
(If they actually accept a basic auth_header for SSO.)
Maybe the header should only be cleared, if find(auth_header_from_client, "^Basic%s+(.+)$")didn’t match anythingactually mached something (check for not equal -1?), instead of clearing any auth if there is no basic auth credential ???
I think currenly both, stand-alone and LDAP (plus SSO) apps require auth_header = false to not get their own auth headers cleared. And that setting will disable any [EDIT: standard auth-header-based] SSO (it stops working).
Seems indenpendent of users being managed by the app or in LDAP.
Not sure where auth_headers can actually work without breaking apps, maybe with old apps only using basic auth?
Most apps would probaly required to be configurable to honor default YNH_ proxy headers for SSO (SSO/LDAP integration | Yunohost) or need a custom nginx.conf to insert their accepted headers.
EDIT: Maybe change the default to ‘auth_headers = false’?
I don’t quite understand what you try to explain, but the doc (SSO/LDAP integration | Yunohost) could sure use some checklist of settings to consider/set in case you know some.
It seems there are too many apps with login or SSO failing (leading e.g. to How to use single-sign on).
Consider renaming protect_against_basic_auth_spoofing to clear_basic_auth_client_headers (just add it/document deprecation for now).
Consider removing the central override: apps_that_need_external_auth_maybe. (Let apps set protect_against_basic_auth_spoofing themselves as already documented, ideally according to e.g. their web/caldav client config panel setting.)
Consider letting auth_header = basic-mail-{with,without}-password insert email instead of username.
Stop always overriding basic auth with truthy auth_header setting, only override if auth_header matches basic* ). It currently moots protect_against_basic_auth_spoofing = false. Currently settings break either sso or webdav/caldav (app passwords).
Consider adjusting the http info header “You’ve just been SSOed” to be more informative, e.g. SSO-INFO: basic-auth-cleared/set, user-headers-set". (To make the default/configured behavior noticable on the client side?)
Found an explanation, that might suggest a different approach to configuring the headers…
Set SSOWAT basic auth header stripping to false by RamanMalykhin · Pull Request #172 · YunoHost-Apps/calibreweb_ynh · GitHub :
This [clearing] behavior exists because some Ynh apps may want to be aware of different users and their profiles, but delegate the auth functionality entirely to SSOWat, do not integrate with LDAP in any way, and trust the header sent from SSOWat without verifying the password. Then, it would be possible to impersonate a user by setting the username manipulating the basic auth header, if this behavior did not exist.
However, this scenario is not relevant to Calibre-Web. It does check the password
If the desired/required behavior depends on how the headers are trusted by apps, then maybe apps shoud rather be specifically configuring (requesting) something like trusted-sso-basic-auth or client-provided-basic-auth, and trusted-sso-user-headers.
I.e. don’t hardcode sso-user-header and basic-auth clearing together, and clear only what would otherwise be wrong to trust?