From 5526f0316c2714d30e47a90f81e0ff686a29042f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 8 May 2023 16:31:38 +0300 Subject: auth: Implement "Authorization Code Flow" Implement the "Authorization Code Flow" for the authentication of users. * gn3/auth/authentication/oauth2/grants/authorisation_code_grant.py: query and save the authorisation code. * gn3/auth/authentication/oauth2/models/authorization_code.py: Implement the `AuthorisationCode` model * gn3/auth/authentication/oauth2/models/oauth2client.py: Fix typo * gn3/auth/authentication/oauth2/server.py: Register the `AuthorisationCodeGrant` grant with the server. * gn3/auth/authentication/oauth2/views.py: Implement `/authorise` endpoint * gn3/templates/base.html: New HTML Templates of authorisation UI * gn3/templates/common-macros.html: New HTML Templates of authorisation UI * gn3/templates/oauth2/authorise-user.html: New HTML Templates of authorisation UI * main.py: Allow both "code" and "token" response types. --- gn3/templates/oauth2/authorise-user.html | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 gn3/templates/oauth2/authorise-user.html (limited to 'gn3/templates/oauth2') diff --git a/gn3/templates/oauth2/authorise-user.html b/gn3/templates/oauth2/authorise-user.html new file mode 100644 index 0000000..d40379f --- /dev/null +++ b/gn3/templates/oauth2/authorise-user.html @@ -0,0 +1,40 @@ +{%extends "base.html"%} + +{%block title%}Authorise User{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Authenticate to the API Server

+ +
+ + +

+ You are authorising "{{client.client_metadata.client_name}}" to access + Genenetwork 3 with the following scope: +

+
+ Scope + {%for scp in scope%} + + +
+ {%endfor%} +
+ +
+ User Credentials + + +
+ + + +
+ + +
+{%endblock%} -- cgit v1.2.3