Ability to pass down WWW-Authenticate challenges down to Auth Providers #261717
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #260156
Here's what a WWW-Authenticate header looks like from the very real Azure situation:
This generically looks like this:
A challenge looks like this:
Where:
auth-schemeis a case-insensitive stringauth-paramiskey=valuewherekeyandvalueare strings (key is unique within the challenge)which in TypeScript becomes:
Regardless of all of that, the API for "extension that wants auth" is as simple as possible... and all about simply passing the WWW-Authenticate value into the Auth API so the extension doesn't have to be in the business of parsing this complex string:
In other words:
This shape let's us support:
claimsin the challenge (aka metadata inside of the token that arent scopes)The challenge becomes the star, and since the auth extension is stateless, it will need to know the scopes so the option to provide them is there if needed.
extension supplying auth perspective
From the "extension supplying auth perspective" we are starting with this API but it doesn't need to be finalized at the same time as the above:
AuthProvider implements two new functions:
This lets the Auth Provider Opt-in to supporting challenges.