Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def find_subscriptions_in_vm_with_msi(self, identity_id=None, allow_no_subscript
token_entry = msi_creds.token
token = token_entry['access_token']
logger.info('MSI: token was retrieved. Now trying to initialize local accounts...')
decode = jwt.decode(token, verify=False, algorithms=['RS256'])
decode = jwt.decode(token, algorithms=['RS256'], options={"verify_signature": False})
Copy link
Member Author

Choose a reason for hiding this comment

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

https://pyjwt.readthedocs.io/en/latest/changelog.html?highlight=verify#dropped-deprecated-verify-param-in-jwt-decode

Dropped deprecated verify param in jwt.decode(...)
Use jwt.decode(encoded, key, options={"verify_signature": False}) instead.

tenant = decode['tid']

subscription_finder = SubscriptionFinder(self.cli_ctx, self.auth_ctx_factory, None)
Expand All @@ -382,7 +382,7 @@ def find_subscriptions_in_cloud_console(self):

_, token, _ = self._get_token_from_cloud_shell(self.cli_ctx.cloud.endpoints.active_directory_resource_id)
logger.info('MSI: token was retrieved. Now trying to initialize local accounts...')
decode = jwt.decode(token, verify=False, algorithms=['RS256'])
decode = jwt.decode(token, algorithms=['RS256'], options={"verify_signature": False})
tenant = decode['tid']

subscription_finder = SubscriptionFinder(self.cli_ctx, self.auth_ctx_factory, None)
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli-core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'msal>=1.10.0,<2.0.0',
'paramiko>=2.0.8,<3.0.0',
'pkginfo>=1.5.0.1',
'PyJWT==1.7.1',
'PyJWT>=2.1.0',
'pyopenssl>=17.1.0', # https://github.com/pyca/pyopenssl/pull/612
'requests~=2.22',
'six~=1.12',
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ portalocker==1.7.1
psutil==5.8.0
pycparser==2.19
PyGithub==1.38
PyJWT==1.7.1
PyJWT==2.1.0
PyNaCl==1.4.0
pyOpenSSL==19.0.0
python-dateutil==2.8.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ portalocker==1.7.1
psutil==5.8.0
pycparser==2.19
PyGithub==1.38
PyJWT==1.7.1
PyJWT==2.1.0
PyNaCl==1.4.0
pyOpenSSL==19.0.0
python-dateutil==2.8.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ portalocker==1.7.1
psutil==5.8.0
pycparser==2.19
PyGithub==1.38
PyJWT==1.7.1
PyJWT==2.1.0
PyNaCl==1.4.0
pyOpenSSL==19.0.0
pyreadline==2.1
Expand Down