1.1.0-beta.1 (2021-05-06)
Features Added
- Add a new
bearerTokenChallengeAuthenticationPolicy
that provides a skeleton of handling challenge-based authorization. There are two extensible points:authorizeRequest
andauthorizeRequestOnChallenge
callbacks.authorizeRequest
allows customizing the policy to alter how it authorizes a request before sending it. By default when no callbacks are specified, this policy has the same behavior asbearerTokenAuthenticationPolicy
. It will retrieve the token from the underlying token credential, and if it gets one, it will cache the token and set it to the outgoing request.authorizeRequestOnChallenge
, which gets called only if we've found a challenge in the response. This callback has access to the original request and its response and is expected to handle the challenge. If this callback returns true, the request, usually updated after handling the challenge, will be sent again. If this call back returns false, no further actions will be taken.
Fixed
- Rewrote
bearerTokenAuthenticationPolicy
to use a new backend that refreshes tokens only when they're about to expire and not multiple times before. This is based on a similar fix implemented on@azure/core-http@1.2.4
(PR with the changes). This fixes the issue: 13369. - Delay loading of NO_PROXY environment variable until when request pipeline is being created. This fixes issue 14873