Skip to content

Commit

Permalink
Change authenticate method
Browse files Browse the repository at this point in the history
  • Loading branch information
MircoT committed Sep 15, 2021
1 parent c0e1134 commit 0720f57
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docker/single-node-jupyterhub/jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ def pre_spawn_start(self, user, spawner):
)
raise Exception("OAuth user not in the allowed groups %s" % allowed_groups)

# https://github.com/jupyterhub/oauthenticator/blob/master/oauthenticator/generic.py#L157
async def authenticate(self, handler, data=None):
code = handler.get_argument("code")
# TODO: Configure the curl_httpclient for tornado
http_client = self.http_client()

params = dict(
redirect_uri=self.get_callback_url(handler),
Expand All @@ -116,9 +115,9 @@ async def authenticate(self, handler, data=None):

headers = self._get_headers()

token_resp_json = await self._get_token(http_client, headers, params)
token_resp_json = await self._get_token(headers, params)

user_data_resp_json = await self._get_user_data(http_client, token_resp_json)
user_data_resp_json = await self._get_user_data(token_resp_json)

if callable(self.username_key):
name = self.username_key(user_data_resp_json)
Expand Down

0 comments on commit 0720f57

Please sign in to comment.