-
Notifications
You must be signed in to change notification settings - Fork 0
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
Integrated .NET solution #1
Comments
Thats great! I'll test it with .NET 6 and update the blog post and the projects README.md to point out it out. Should save people the hassle of doing it manually if they're on the latest .NET version :) |
Any ideas on what do you do with the realm? I have been provided with a realm. |
The realm kind of tells you the protection scope of the resource you're accessing (usually it's retrieved from the var headerString =
$"Digest username=\"{digest.Username}\", realm=\"{digest.Realm}\", nonce=\"{digest.Nonce}\", uri=\"{digestUri}\", " +
$"algorithm=MD5, qop={digest.QualityOfProtection}, nc={digest.NonceCount:00000000}, cnonce=\"{digest.ClientNonce}\", " +
$"response=\"{digestResponse}\", opaque=\"{digest.Opaque}\""; |
Did anyone of you find a way to work with IHttpClientFactory since this way we have to create a new HttpClient every single time. |
If you’re referring to the way done in this repository you should just be able to use the extension method on the HttpClient instance that’s injected into your service (I think). If you give a code example of what isn’t working for you I’ll try and find the time to take a look :) |
Thank you really works in .NET 6 (probably even works in earlier versions). |
Thank you, @CallumHoughton18, your extension helped a lot at the time! |
You’re welcome @YuriyNev :) |
This worked great! Thanks for the info! |
No problem - glad it was helpful :) |
Hey,
on your blog you asked for information if someone finds a default way to do this.
I got the digest authentication working for an IoT device on .NET 6 just with this little code:
Seems the framework does automatically detect the authentication method from the initial
401
response and then performs the hashing stuff and so on.The text was updated successfully, but these errors were encountered: