From 24bc0df2ae77867f80850ea52ff20736271f4b89 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 2 May 2024 04:56:04 +0300 Subject: Use user-provided values rather than hard-coded values. --- gn_auth/auth/authorisation/users/admin/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gn_auth/auth/authorisation') diff --git a/gn_auth/auth/authorisation/users/admin/views.py b/gn_auth/auth/authorisation/users/admin/views.py index dc7b8c6..f343da1 100644 --- a/gn_auth/auth/authorisation/users/admin/views.py +++ b/gn_auth/auth/authorisation/users/admin/views.py @@ -201,11 +201,11 @@ def register_client(): client_id_issued_at = datetime.now(tz=timezone.utc), client_secret_expires_at = datetime.fromtimestamp(0), client_metadata = { - "client_name": "GN2 Dev Server", + "client_name": form["client_name"], "token_endpoint_auth_method": [ "client_secret_post", "client_secret_basic"], "client_type": "confidential", - "grant_types": ["password", "authorization_code", "refresh_token"], + "grant_types": grant_types, "default_redirect_uri": default_redirect_uri, "redirect_uris": [default_redirect_uri] + form.get("other_redirect_uri", "").split(), "response_type": __response_types__(tuple(grant_types)), @@ -220,6 +220,7 @@ def register_client(): client=client, client_secret = raw_client_secret) + def __parse_client__(sqlite3_row) -> dict: """Parse the client details into python datatypes.""" return { -- cgit v1.2.3