From 2aa7abf383df814f24c88beea733c324cda682d0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 29 May 2023 14:56:24 +0300 Subject: auth: Enable registration of OAuth2 clients Add UI and code to enable the administrative user to register new OAuth2 clients that can access the API server. --- gn3/templates/admin/dashboard.html | 16 ++++++ gn3/templates/admin/login.html | 32 ++++++++++++ gn3/templates/admin/register-client.html | 78 ++++++++++++++++++++++++++++++ gn3/templates/admin/registered-client.html | 21 ++++++++ gn3/templates/login.html | 32 ------------ 5 files changed, 147 insertions(+), 32 deletions(-) create mode 100644 gn3/templates/admin/dashboard.html create mode 100644 gn3/templates/admin/login.html create mode 100644 gn3/templates/admin/register-client.html create mode 100644 gn3/templates/admin/registered-client.html delete mode 100644 gn3/templates/login.html (limited to 'gn3/templates') diff --git a/gn3/templates/admin/dashboard.html b/gn3/templates/admin/dashboard.html new file mode 100644 index 0000000..49bf2f6 --- /dev/null +++ b/gn3/templates/admin/dashboard.html @@ -0,0 +1,16 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Admin Dashboard{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Genenetwork3: Admin Dashboard

+ + +{%endblock%} diff --git a/gn3/templates/admin/login.html b/gn3/templates/admin/login.html new file mode 100644 index 0000000..cf46009 --- /dev/null +++ b/gn3/templates/admin/login.html @@ -0,0 +1,32 @@ +{%extends "base.html"%} + +{%block title%}Log in to Genenetwork3{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Genenetwork3: Admin Log In

+ +
+ +
+ User Credentials + + + +
+ + +
+ +
+ + +
+
+ + +
+{%endblock%} diff --git a/gn3/templates/admin/register-client.html b/gn3/templates/admin/register-client.html new file mode 100644 index 0000000..3058aee --- /dev/null +++ b/gn3/templates/admin/register-client.html @@ -0,0 +1,78 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Register OAuth2 Client{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Genenetwork3: Register OAuth2 Client

+ +
+ +
+ Select client scope + + {%for scp in scope%} + +
+ {%endfor%} + +
+ +
+ Basic OAuth2 client information + + + + +

+ + + +

+ + +
+ +

+
+ Supported grant types + + +

+ + + +
+
+ +
+ User information + +

The user to register this client for

+ +
+ + +
+{%endblock%} diff --git a/gn3/templates/admin/registered-client.html b/gn3/templates/admin/registered-client.html new file mode 100644 index 0000000..2fc3990 --- /dev/null +++ b/gn3/templates/admin/registered-client.html @@ -0,0 +1,21 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Register OAuth2 Client{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Genenetwork3: Register OAuth2 Client

+ +

Client has been registered successfully.

+ +

Please save the following client details somewhere. There is no way to + retrieve the the CLIENT_SECRET once you leave this page.

+ +
+
CLIENT_ID
+
{{client.client_id}}
+
CLIENT_SECRET
+
{{client_secret}}
+
+{%endblock%} diff --git a/gn3/templates/login.html b/gn3/templates/login.html deleted file mode 100644 index cf46009..0000000 --- a/gn3/templates/login.html +++ /dev/null @@ -1,32 +0,0 @@ -{%extends "base.html"%} - -{%block title%}Log in to Genenetwork3{%endblock%} - -{%block content%} -{{flash_messages()}} - -

Genenetwork3: Admin Log In

- -
- -
- User Credentials - - - -
- - -
- -
- - -
-
- - -
-{%endblock%} -- cgit v1.2.3