Azure / azure-sdk-for-cpp

This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-cpp.
MIT License
181 stars 126 forks source link

BearerTokenAuthenticationPolicy should support CAE token revocation challenges by default #6022

Open christothes opened 2 months ago

christothes commented 2 months ago

This feature entails adding CAE support for all clients lacking a custom challenge handler i.e., everyone except Key Vault and Storage.

Adding support involves adding logic to your BearerTokenAuthenticationPolicy such that it does the following:

Example PRs: https://github.com/Azure/azure-sdk-for-go/pull/23414 https://github.com/Azure/azure-sdk-for-net/pull/46277

ahsonkhan commented 1 month ago

This feature is blocked on MSAL support for CAE in C++.

We can handle the following in BearerTokenAuthenticationPolicy within Azure::Core and invalidate the token in that policy whenever we see a 401:

Detects when a CAE challenge is issued (401 response with a WWW-Authenticate header)