Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

Support `get_token_info` protocol #29967

Open jiasli opened 1 month ago

jiasli commented 1 month ago

Is your feature request related to a problem? Please describe. https://github.com/Azure/azure-sdk-for-python/pull/36565 and https://github.com/Azure/azure-sdk-for-python/pull/36882 introduced a new get_token_info token protocol.

Azure CLI currently supports 2 types of protocols:

  1. Track 1: signed_session
  2. Track 2: get_token

Describe the solution you'd like After Azure CLI fully drops Track 1 SDK's signed_session support, we should consider migrating get_token to get_token_info. The main benefit is that the returned AccessTokenInfo object has a token_type attribute which can be used for a PoP token.

Meanwhile, Azure CLI Core should be refactored to not rely on SDK's token protocol, in order to be more cohesive and less coupled with SDK (https://github.com/Azure/azure-cli/pull/29955). For example, get_raw_token should not call

https://github.com/Azure/azure-cli/blob/89ebb602dc23234cabfebc4828d3db0fba4d89d0/src/azure-cli-core/azure/cli/core/_profile.py#L419

yonzhan commented 1 month ago

Support get_token_info protocol