8000 Remove fallback to sub in RAS by BinamB · Pull Request #969 · uc-cdis/fence · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove fallback to sub in RAS #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the communit 8000 y.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2021
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: 1 addition & 7 deletions fence/resources/openid/ras_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def get_encoded_visas_v11_userinfo(self, userinfo, pkey_cache=None):

def get_user_id(self, code):

err_msg = "Can't get user's info"
err_msg = "Unable to parse UserID from RAS userinfo response"

try:
token_endpoint = self.get_value_from_discovery_doc("token_endpoint", "")
Expand Down Expand Up @@ -182,12 +182,6 @@ def get_user_id(self, code):
elif userinfo.get("userid"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually see userid in almost all logs from RAS. We probably still want to support either case, but just not fallback on other fields

username = userinfo["userid"]
field_name = "userid"
elif userinfo.get("preferred_username"):
username = userinfo["preferred_username"]
field_name = "preferred_username"
elif claims.get("sub"):
username = claims["sub"]
field_name = "sub"
if not username:
self.logger.error(
"{}, received claims: {} and userinfo: {}".format(
Expand Down
0