Skip to content
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

accept empty realm for digest auth (#56369) #56455

Merged
merged 5 commits into from
Aug 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ internal static partial class AuthenticationHelper
}

// Add realm
if (realm != string.Empty)
sb.AppendKeyValue(Realm, realm);
sb.AppendKeyValue(Realm, realm);

// Add nonce
sb.AppendKeyValue(Nonce, nonce);
Expand Down Expand Up @@ -407,9 +406,10 @@ private void Parse(string challenge)
break;

// Ensure value is valid.
// Opaque and Domain can have empty string
// Opaque, Domain and Realm can have empty string
if (value == string.Empty &&
(!key.Equals(Opaque, StringComparison.OrdinalIgnoreCase) && !key.Equals(Domain, StringComparison.OrdinalIgnoreCase) &&
(!key.Equals(Opaque, StringComparison.OrdinalIgnoreCase) &&
!key.Equals(Domain, StringComparison.OrdinalIgnoreCase) &&
!key.Equals(Realm, StringComparison.OrdinalIgnoreCase)))
karelz marked this conversation as resolved.
Show resolved Hide resolved
break;

Expand Down