SSO in Python, after update to YunoHost 12

Seems that in YunoHost 11 HTTP_REMOTE_USER was send, but not in YunoHost 12…

Where can i find information about that?

Maybe a better way is to check JWT cookie yunohost.portal via PyJWT · PyPI ?!?

Seems in the same way as: yunohost/src/authenticators/ldap_ynhuser.py at dev · YunoHost/yunohost · GitHub

Hm. I didn’t see how an YunoHost app can use the JWT with verify_signature=True … Because the needed key is stored into /etc/yunohost/.ssowat_cookie_secret and this file is only readable by ynh-portal user and root. So a normal YunoHost app with his own user, can’t read it.

So the current way is see, is to expand the nginx config with:

    proxy_set_header Ynh-User $http_ynh_user;
    proxy_set_header Ynh-User-Fullname $http_ynh_user_fullname;
    proxy_set_header Ynh-User-Email $http_ynh_user_email;

and use it in the app.

fix is on the was in GitHub - YunoHost-Apps/django_yunohost_integration: Python package with helpers for integrate a Django project as YunoHost package. v0.9 with:

Hello,

You have the full doc about how to configure the sso in Yunohost 12 here: SSO/LDAP integration | Yunohost Documentation

1 Like