feat: Add test auto discovery
All checks were successful
Build Docker / Build Docker (push) Successful in 20s

This commit is contained in:
Nathan Woodburn 2024-02-20 22:32:24 +11:00
parent 4ec2c02c24
commit 1a462ed754
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -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')