about summary refs log tree commit diff
path: root/gn3/templates/oauth2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-05-27 13:50:51 +0300
committerFrederick Muriuki Muriithi2023-05-27 13:50:51 +0300
commit45a7a6bc59eb28cdd2ceeee0e84506cf292b6466 (patch)
treebe2ae04bdd0dc095f873c788e434c1338ee1dda4 /gn3/templates/oauth2
parentd03ca8f2cb25dceb785044f31d6ad4a6914c6f16 (diff)
downloadgenenetwork3-45a7a6bc59eb28cdd2ceeee0e84506cf292b6466.tar.gz
Document Use of OAuth2 Clients
* docs/authentication_and_authorisation/oauth2_clients.md: New documentation
* gn3/auth/authentication/oauth2/server.py: Raise appropriate error if no
  client is found.
* gn3/auth/authentication/oauth2/views.py: Handle exception in the case where
  a UI should be presented to the user, rather than presenting the raw JSON
  response to the user.
* gn3/errors.py: Handle any authlib OAuth2Error at the application's top-level
* gn3/templates/oauth2/oauth2_error.html: Handle any authlib OAuth2Error at
  the application's top-level
Diffstat (limited to 'gn3/templates/oauth2')
-rw-r--r--gn3/templates/oauth2/oauth2_error.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/gn3/templates/oauth2/oauth2_error.html b/gn3/templates/oauth2/oauth2_error.html
new file mode 100644
index 0000000..4edf9c4
--- /dev/null
+++ b/gn3/templates/oauth2/oauth2_error.html
@@ -0,0 +1,16 @@
+{%extends "base.html"%}
+
+{%block title%}OAuth2 Error{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<h1>Error: {{error.status_code}}</h1>
+
+There was an error trying to fulfill your request:
+
+<p>
+  <strong>{{error.error}}</strong>:
+  {{error.description}}
+</p>
+{%endblock%}