test:permissions: update sso url and credentials structure

This commit is contained in:
axolotle 2023-11-28 16:26:44 +01:00
parent 2459834c1c
commit 213d6416b6

View file

@ -355,7 +355,7 @@ def check_permission_for_apps():
def can_access_webpage(webpath, logged_as=None): def can_access_webpage(webpath, logged_as=None):
webpath = webpath.rstrip("/") webpath = webpath.rstrip("/")
sso_url = "https://" + maindomain + "/yunohost/sso/" sso_url = "https://" + maindomain + "/yunohost/portalapi/login"
# Anonymous access # Anonymous access
if not logged_as: if not logged_as:
@ -365,7 +365,7 @@ def can_access_webpage(webpath, logged_as=None):
with requests.Session() as session: with requests.Session() as session:
session.post( session.post(
sso_url, sso_url,
data={"user": logged_as, "password": dummy_password}, data={"credentials": f"{logged_as}:{dummy_password}"},
headers={ headers={
"Referer": sso_url, "Referer": sso_url,
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",