From a96518ef9c64c04127d075a07781fa0cfb36d5fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Tue, 14 Feb 2023 13:51:59 +0100 Subject: [PATCH] Display TOS and policy URI on the consent list page --- CHANGES.rst | 5 +++++ canaille/templates/oidc/user/consent_list.html | 16 ++++++++++++++++ demo/client/__init__.py | 2 ++ demo/ldif/bootstrap-oidc.ldif | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 329e9439..0f66325a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_, and this project adheres to `Semantic Versioning `_. +Added +***** + +- Display TOS and policy URI on the consent list page. :pr:`99` + Fixed ***** diff --git a/canaille/templates/oidc/user/consent_list.html b/canaille/templates/oidc/user/consent_list.html index 916c5717..a628c46b 100644 --- a/canaille/templates/oidc/user/consent_list.html +++ b/canaille/templates/oidc/user/consent_list.html @@ -58,6 +58,22 @@ + {% if client.tos_uri or client.policy_uri %} +
+ {% if client.policy_uri %} + + + {% trans %}Policy{% endtrans %} + + {% endif %} + {% if client.tos_uri %} + + + {% trans %}Terms of service{% endtrans %} + + {% endif %} +
+ {% endif %} {% trans %}Remove access{% endtrans %} diff --git a/demo/client/__init__.py b/demo/client/__init__.py index eeb82258..ec200926 100644 --- a/demo/client/__init__.py +++ b/demo/client/__init__.py @@ -31,6 +31,8 @@ def create_app(): ) @app.route("/") + @app.route("/tos") + @app.route("/policy") def index(): return render_template( "index.html", user=session.get("user"), name=app.config["NAME"] diff --git a/demo/ldif/bootstrap-oidc.ldif b/demo/ldif/bootstrap-oidc.ldif index 82a22026..e3f50649 100644 --- a/demo/ldif/bootstrap-oidc.ldif +++ b/demo/ldif/bootstrap-oidc.ldif @@ -7,6 +7,8 @@ oauthClientContact: admin@mydomain.tld oauthClientURI: http://localhost:5001 oauthRedirectURIs: http://localhost:5001/authorize oauthPostLogoutRedirectURI: http://localhost:5001/ +oauthTermsOfServiceURI: http://localhost:5001/tos +oauthPolicyURI: http://localhost:5001/policy oauthGrantType: authorization_code oauthGrantType: refresh_token oauthScope: openid @@ -29,6 +31,8 @@ oauthClientContact: admin@mydomain.tld oauthClientURI: http://localhost:5002 oauthRedirectURIs: http://localhost:5002/authorize oauthPostLogoutRedirectURI: http://localhost:5002/ +oauthTermsOfServiceURI: http://localhost:5002/tos +oauthPolicyURI: http://localhost:5002/policy oauthGrantType: authorization_code oauthGrantType: refresh_token oauthScope: openid