-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore DefaultCredentials when doing Basic & Digest auth in SocketsHttpHandler #113728
base: main
Are you sure you want to change the base?
Ignore DefaultCredentials when doing Basic & Digest auth in SocketsHttpHandler #113728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents Basic authentication from mistakenly using DefaultCredentials in SocketsHttpHandler.
- Adds a conditional check in the Basic authentication case to skip processing when DefaultCredentials is used.
- Enhances the authentication handling by ensuring only supported credential types are processed in Basic auth.
Comments suppressed due to low confidence (1)
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.cs:269
- [nitpick] Consider verifying that the variable name 'credentials' is consistent with other parts of the code where a similar credential is referred to as 'credential'. If applicable, renaming it for consistency may help reduce confusion.
if (CredentialCache.DefaultCredentials == credentials)
cc @MihaZupan |
Can you please add a test that validates the new behavior? |
Fixes #113145.
As described in #113145 (comment)