Skip to content

Commit a1074ad

Browse files
committed
azuread: refactor to rely on userdata_from_id_token
1 parent 612b97f commit a1074ad

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

oauthenticator/azuread.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import os
66

7-
import jwt
87
from jupyterhub.auth import LocalAuthenticator
98
from traitlets import Unicode, default
109

@@ -66,15 +65,9 @@ def _authorize_url_default(self):
6665
def _token_url_default(self):
6766
return f"https://login.microsoftonline.com/{self.tenant_id}/oauth2/token"
6867

69-
async def token_to_user(self, token_info):
70-
id_token = token_info['id_token']
71-
decoded = jwt.decode(
72-
id_token,
73-
options={"verify_signature": False},
74-
audience=self.client_id,
75-
)
76-
77-
return decoded
68+
@default("userdata_from_id_token")
69+
def _userdata_from_id_token_default(self):
70+
return True
7871

7972

8073
class LocalAzureAdOAuthenticator(LocalAuthenticator, AzureAdOAuthenticator):

0 commit comments

Comments
 (0)