diff options
author | Frederick Muriuki Muriithi | 2024-05-02 05:12:43 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-05-02 05:40:57 +0300 |
commit | b3244a70776b75d9f35a3d1ff6f01fd6244f4e36 (patch) | |
tree | 3e39b37204b648136f4f412bcecb4e5ebcd9bcc2 /gn_auth/auth | |
parent | abb8ab84cd948edbe9e678aebbaa5a59681c5adc (diff) | |
download | gn-auth-b3244a70776b75d9f35a3d1ff6f01fd6244f4e36.tar.gz |
Make registration of grant-types more flexible.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r-- | gn_auth/auth/authorisation/users/admin/views.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/users/admin/views.py b/gn_auth/auth/authorisation/users/admin/views.py index a4c4033..e0ebdf3 100644 --- a/gn_auth/auth/authorisation/users/admin/views.py +++ b/gn_auth/auth/authorisation/users/admin/views.py @@ -46,6 +46,17 @@ admin = Blueprint("admin", __name__) class RegisterClientError(Exception): """Error to raise in case of client registration issues""" +_FORM_GRANT_TYPES_ = ({ + "name": "Authorization Code", + "value": "authorization_code" +}, { + "name": "Refresh Token", + "value": "refresh_token" +}, { + "name": "JWT Bearer Token", + "value": "urn:ietf:params:oauth:grant-type:jwt-bearer" +}) + @admin.before_request def update_expires(): """Update session expiration.""" @@ -183,6 +194,7 @@ def register_client(): "admin/register-client.html", scope=current_app.config["OAUTH2_SCOPE"], users=with_db_connection(__list_users__), + granttypes=_FORM_GRANT_TYPES_, current_user=session.session_user()) form = request.form |