diff --git a/apps/authentication/auth0.py b/apps/authentication/auth0.py index e9043d7c7..444f032c5 100644 --- a/apps/authentication/auth0.py +++ b/apps/authentication/auth0.py @@ -4,14 +4,14 @@ def auth0_client(): - issuer = settings.AUTH0_ISSUER + issuer: str = settings.AUTH0_ISSUER get_token = GetToken( - issuer, + issuer.removeprefix("https://"), settings.AUTH0_CLIENT_ID, client_secret=settings.AUTH0_CLIENT_SECRET, ) - token = get_token.client_credentials(f"{issuer}/api/v2/") + token = get_token.client_credentials(f"{settings.AUTH0_MGMT_TENANT}/api/v2/") mgmt_api_token = token["access_token"] - return Auth0(issuer, mgmt_api_token) + return Auth0(issuer.removeprefix("https://"), mgmt_api_token) diff --git a/onlineweb4/settings/base.py b/onlineweb4/settings/base.py index 234506e45..3282c907d 100644 --- a/onlineweb4/settings/base.py +++ b/onlineweb4/settings/base.py @@ -132,6 +132,7 @@ def get_stats_file() -> str: VIMEO_API_TOKEN = config("OW4_VIMEO_API_TOKEN", default=None) AUTH0_ISSUER = config("AUTH0_ISSUER", default="") +AUTH0_MGMT_TENANT = config("AUTH0_MGMT_TENANT", default="") AUTH0_CLIENT_ID = config("AUTH0_CLIENT_ID", default="") AUTH0_CLIENT_SECRET = config("AUTH0_CLIENT_SECRET", default="")