Skip to content

Commit

Permalink
Entity_id and client_id might not be the same.
Browse files Browse the repository at this point in the history
More log info.
  • Loading branch information
rohe committed May 24, 2024
1 parent 142fb8b commit 9af1a1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/flask_op/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"verify": false
},
"issuer": "https://{domain}:{port}",
"entity_id": "https://{domain}:{port}",
"keys": {
"private_path": "private/jwks.json",
"key_defs": [
Expand Down
7 changes: 6 additions & 1 deletion src/idpyoidc/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def __init__(
entity_id: Optional[str] = "",
key_conf: Optional[dict] = None,
):
self.entity_id = entity_id or conf.get("entity_id")
self.entity_id = entity_id or conf.get("entity_id", None)
if not self.entity_id:
_conf = conf.get("conf", None)
if _conf:
self.entity_id = _conf.get("entity_id", "")
self.issuer = conf.get("issuer", self.entity_id)
self.persistence = None

Expand Down Expand Up @@ -80,6 +84,7 @@ def __init__(
cwd=cwd,
cookie_handler=cookie_handler,
keyjar=self.keyjar,
entity_id=self.entity_id
)

# Need to have context in place before doing this
Expand Down
3 changes: 3 additions & 0 deletions src/idpyoidc/server/client_authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,13 @@ def verify_client(

_method = None
_cdb = _cinfo = None
_tested = []
for _method in (methods[meth] for meth in allowed_methods):
if not _method.is_usable(request=request, authorization_token=authorization_token):
continue
try:
logger.info(f"Verifying client authentication using {_method.tag}")
_tested.append(_method.tag)
auth_info = _method.verify(
keyjar=endpoint.upstream_get("attribute", "keyjar"),
request=request,
Expand Down Expand Up @@ -557,6 +559,7 @@ def verify_client(
break

logger.debug(f"Authn methods applied")
logger.debug(f"Method tested: {_tested}")

# store what authn method was used
if "method" in auth_info and client_id and _cdb:
Expand Down

0 comments on commit 9af1a1e

Please sign in to comment.