diff --git a/oauthenticator/bitbucket.py b/oauthenticator/bitbucket.py index 25faf1f2..d31c6404 100644 --- a/oauthenticator/bitbucket.py +++ b/oauthenticator/bitbucket.py @@ -60,7 +60,7 @@ async def update_auth_model(self, auth_model): auth_model["admin"] = True if self.allowed_teams: - user_teams = self._fetch_user_teams(access_token, token_type) + user_teams = await self._fetch_user_teams(access_token, token_type) auth_model["auth_state"]["user_teams"] = user_teams return auth_model diff --git a/oauthenticator/cilogon.py b/oauthenticator/cilogon.py index 4a04ae88..8d5ab09f 100644 --- a/oauthenticator/cilogon.py +++ b/oauthenticator/cilogon.py @@ -249,12 +249,11 @@ def _validate_allowed_idps(self, proposal): ) def user_info_to_username(self, user_info): - selected_idp = user_info["idp"] - username_claims = [self.username_claim] if self.additional_username_claims: username_claims.extend(self.additional_username_claims) if self.allowed_idps: + selected_idp = user_info["idp"] # The username_claim which should be used for this idp username_claims = [ self.allowed_idps[selected_idp]["username_derivation"]["username_claim"] diff --git a/oauthenticator/generic.py b/oauthenticator/generic.py index 937949ed..9b576ae4 100644 --- a/oauthenticator/generic.py +++ b/oauthenticator/generic.py @@ -109,7 +109,7 @@ def get_user_groups(self, user_info): if callable(self.claim_groups_key): return set(self.claim_groups_key(user_info)) try: - return reduce(dict.get, self.claim_groups_key.split("."), user_info) + return set(reduce(dict.get, self.claim_groups_key.split("."), user_info)) except TypeError: self.log.error( f"The claim_groups_key {self.claim_groups_key} does not exist in the user token" diff --git a/oauthenticator/oauth2.py b/oauthenticator/oauth2.py index 48de273b..e60e8ebd 100644 --- a/oauthenticator/oauth2.py +++ b/oauthenticator/oauth2.py @@ -722,7 +722,7 @@ def build_auth_state_dict(self, token_info, user_info): self.user_auth_state_key: user_info, } - async def update_auth_model(self, username, auth_model): + async def update_auth_model(self, auth_model): """ Updates and returns the `auth_model` dict.