poor man's fingering
parent
cae82f7044
commit
ecdb350015
|
@ -1,3 +1,6 @@
|
|||
import re
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from flask import jsonify, request
|
||||
from ..routes import bp
|
||||
from ..oauth2 import require_oauth
|
||||
|
@ -37,3 +40,19 @@ def oidc_configuration():
|
|||
"subject_types_supported": ["pairwise"],
|
||||
"id_token_signing_alg_values_supported": ["RS256", "none"],
|
||||
})
|
||||
|
||||
|
||||
@bp.route("/.well-known/webfinger")
|
||||
def webfinger():
|
||||
ne = urlparse(ISSUER_URL).netloc
|
||||
acct = re.search(r'([a-z]+)@{}'.format(ne), request.args['resource'])
|
||||
return jsonify({
|
||||
"subject": f"acct:{acct}",
|
||||
"links":
|
||||
[
|
||||
{
|
||||
"rel": "http://openid.net/specs/connect/1.0/issuer",
|
||||
"href": ISSUER_URL
|
||||
}
|
||||
]
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue