Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

[Userinfo endpoint] Exception if token was released with unspecified/unknow scope #84

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/oidcendpoint/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from oidcmsg.oidc import Claims

from oidcendpoint import sanitize
from oidcendpoint.exception import FailedAuthentication
from oidcendpoint.exception import ImproperlyConfigured
from oidcendpoint.scopes import convert_scopes2claims

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -157,9 +157,9 @@ def collect_user_info(
logger.debug("userinfo_claim: %s" % sanitize(userinfo_claims.to_dict()))
else:
userinfo_claims = None
logger.warning('Client {} UnAllowed to access to Userinfo endpoint')
raise FailedAuthentication("UnAllowed to access to Userinfo endpoint: "
"invalid scope.")
logger.warning(("Client {} doesn't have any claims "
"belonging to one or more scopes.").format(authn_req["client_id"]))
raise ImproperlyConfigured("Some additional scopes doesn't have any claims.")

logger.debug("Session info: %s" % sanitize(session))

Expand Down