1.0.0b6 (2025-03-27)
Features Added
- The
TokenCredential
andAsyncTokenCredential
protocols have been updated to include a newget_token_info
method. This method should be used to acquire tokens and return anAccessTokenInfo
object. #38346 - Added a new
TokenRequestOptions
class, which is aTypedDict
with optional parameters, that can be used to define options for token requests through theget_token_info
method. #38346 - Added a new
AccessTokenInfo
class, which is returned byget_token_info
implementations. This class contains the token, its expiration time, and optional additional information like when a token should be refreshed. #38346 BearerTokenCredentialPolicy
andAsyncBearerTokenCredentialPolicy
now check if a credential has theget_token_info
method defined. If so, theget_token_info
method is used to acquire a token. #38346- These policies now also check the
refresh_on
attribute when determining if a new token request should be made.
- These policies now also check the
- Added
model
attribute toHttpResponseError
to allow accessing error attributes based on a known model. #39636 - Added
auth_flows
support inBearerTokenCredentialPolicy
. #40084
Breaking Changes
- The
get_token
method has been removed from theTokenCredential
andAsyncTokenCredential
protocols. Implementations should now use the newget_token_info
method to acquire tokens. #38346 - The
AccessToken
class has been removed and replaced with a newAccessTokenInfo
class. #38346 BearerTokenCredentialPolicy
andAsyncBearerTokenCredentialPolicy
now rely on credentials having theget_token_info
method defined. #38346