From 1a462ed754e3f3941573be553509847e13940b56 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 20 Feb 2024 22:32:24 +1100 Subject: [PATCH] feat: Add test auto discovery --- website/routes.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/website/routes.py b/website/routes.py index 5da5c0f..f6e21cd 100644 --- a/website/routes.py +++ b/website/routes.py @@ -152,6 +152,34 @@ def api_me(): email= f'{user.username}@login.hns.au', displayName=user.username+"/") +@bp.route('/discovery') +def autodiscovery(): + host = request.host + discovery = { + "issuer": f"https://{host}/", + "authorization_endpoint": f"https://{host}/oauth/authorize", + "token_endpoint": f"https://{host}/oauth/token", + "userinfo_endpoint": f"https://{host}/api/me", + "revocation_endpoint": f"https://{host}/oauth/revoke", + "response_types_supported": [ + "code" + ], + "subject_types_supported": [ + "public" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "scopes_supported": [ + "openid", + "email", + "profile" + ] +} + + + return jsonify(discovery) + @bp.route('/favicon.png')