Cookie handling for the new portal API

This commit is contained in:
Alexandre Aubin 2021-12-26 16:31:05 +01:00
parent 1efb50c7ab
commit 62808152ee
2 changed files with 6 additions and 1 deletions

View file

@ -1323,6 +1323,7 @@ def app_ssowatconf():
"public": True,
"uris": [domain + "/yunohost/admin" for domain in domains]
+ [domain + "/yunohost/api" for domain in domains]
+ [domain + "/yunohost/portalapi" for domain in domains]
+ [
"re:^[^/]*/%.well%-known/ynh%-diagnosis/.*$",
"re:^[^/]*/%.well%-known/acme%-challenge/.*$",
@ -1368,6 +1369,8 @@ def app_ssowatconf():
}
conf_dict = {
"cookie_secret_file": "/etc/yunohost/.ssowat_cookie_secret",
"cookie_name": "yunohost.portal",
"portal_domain": main_domain,
"portal_path": "/yunohost/sso/",
"additional_headers": {

View file

@ -11,7 +11,9 @@ from moulinette.authentication import BaseAuthenticator
from moulinette.utils.text import random_ascii
from yunohost.utils.error import YunohostError, YunohostAuthenticationError
session_secret = random_ascii()
# FIXME : we shall generate this somewhere if it doesnt exists yet
# FIXME : fix permissions
session_secret = open("/etc/yunohost/.ssowat_cookie_secret").read()
logger = logging.getLogger("yunohostportal.authenticators.ldap_ynhuser")