From 6b7ceaaa33e77b1daf0fc01f5294904ce05f0081 Mon Sep 17 00:00:00 2001 From: Eugen Ciur Date: Wed, 1 May 2024 11:39:48 +0200 Subject: [PATCH] minor fixes --- oidc_app/config.py | 1 - oidc_app/http_client.py | 2 +- oidc_app/utils.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/oidc_app/config.py b/oidc_app/config.py index 3384684..081bc79 100644 --- a/oidc_app/config.py +++ b/oidc_app/config.py @@ -22,7 +22,6 @@ class Settings(BaseSettings): papermerge__auth__oidc_authorize_url: str # OIDC provider "token" endpoint # for Keycloak it is /realms//protocol/openid-connect/token - papermerge__auth__access_token_url: str algorithms: list[Algs] = ['RS256'] # `public_key` actually can be extracted from OIDC provider # TODO: extract public keu from OIDC provider diff --git a/oidc_app/http_client.py b/oidc_app/http_client.py index 892bbc5..bc623a2 100644 --- a/oidc_app/http_client.py +++ b/oidc_app/http_client.py @@ -21,7 +21,7 @@ async def get_token(code: str) -> tuple[ logger.debug(f"params: {params}") response = await client.post( - settings.papermerge__auth__access_token_url, + settings.papermerge__auth__oidc_access_token_url, data=params, headers={ 'Content-Type': 'application/x-www-form-urlencoded' diff --git a/oidc_app/utils.py b/oidc_app/utils.py index 238c55b..7f9bd2f 100644 --- a/oidc_app/utils.py +++ b/oidc_app/utils.py @@ -48,7 +48,7 @@ def authorize_url() -> str: - https://curity.io/resources/learn/oauth-code-flow/#request-parameters """ params = urllib.parse.urlencode({ - 'client_id': settings.client_id, + 'client_id': settings.papermerge__auth__oidc_client_id, 'response_type': 'code', }) url = f"{settings.papermerge__auth__oidc_authorize_url}?{params}"