From 45a7a6bc59eb28cdd2ceeee0e84506cf292b6466 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Sat, 27 May 2023 13:50:51 +0300 Subject: 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 --- gn3/templates/oauth2/oauth2_error.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gn3/templates/oauth2/oauth2_error.html (limited to 'gn3/templates/oauth2/oauth2_error.html') 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()}} + +

Error: {{error.status_code}}

+ +There was an error trying to fulfill your request: + +

+ {{error.error}}: + {{error.description}} +

+{%endblock%} -- cgit v1.2.3