flakey-bit / dotnetdigestauth Goto Github PK
View Code? Open in Web Editor NEWImplementation of Digest Authentication for ASP.NET Core & ASP.NET
License: MIT License
Implementation of Digest Authentication for ASP.NET Core & ASP.NET
License: MIT License
I've a software where I added DIGEST authentication. Everything works fine in my development machine, I'm using https and valid certificates, exactly as production environment.
In production environment it does not works, I'm using to let word authenticate, but against production server it simply continue to ask me credentials.
Is there any way I can log what went wrong during DIGEST auth? actually I have no error logs.
Could you please add license information of this library?
Currently, AuthenticationBuilderExtensions::AddDigestAuthentication
does not allow customizing the scheme name or scheme display name, we should add an overload that allows specifying it.
Check for other areas of the code where the scheme name is assumed to be "Digest"
Upgrade to dotnet core 6.0 because current release is based on asp.net core 2.0.
How can I increase Nonce expiration time?
I tried increasing maxNonceAgeSeconds
but no effect was seen
Dear @flakey-bit,
I have used Your project in our ASP.NET Core 5 application and updated it to .NET 5 in my fork.
I use it in combination with cookie authentication which allows me to do login/logout as well, but that integration is part of our another library we use internally.
Thank You for Your work.
Marek Ištvánek
Hi, great library, however I was looking for some example implementation of this library, is it available on any repo?
Both the AspNetCore & the AspNetClassic DigestAuthenticationHandler
construct the ClaimsIdentity
with incorrect parameters - here and here respectively.
In both cases, the constructor expecting the authenticationType (string) is being called with validatedUsername
as the argument.
RFC 7616 from September 2015 about HTTP Digest Access Authentication adds support for two new algorithms, SHA2-256 as mandatory and SHA2-512/256 as a backup, and defines the proper algorithm negotiation.
Does this project have support for SHA-256 and SHA-512/256 algorithms?
Does this project implement RFC 7616 or the original RFC 2617 from June 1999?
If not, it is planned to implement RFC 7616? Will be pull requests accepted?
Using your example, trying to implement this to protect static files using a simple auth method such as digest.
I implemented a middleware, but for whatever reason I can't get it to prompt with the HandleChallengeAsync
but the HandleAuthenticateAsync
is called every time.
I wrote up a more detailed Stackoverflow post (https://stackoverflow.com/questions/58494687/aspnet-core-3-protecting-static-files-wwwroot-with-custom-auth-provider-such) but was curious if you had a better / cleaner solution to protecting the files hosted under static / wwwroot folder in Kestral / netcore3.
The ASP.NET Core NuGet package has a stated dependency on the FlakeyBit.DigestAuthentication.Implementation NuGet package with a version greater than or equal to 2019.3.20.3. Since there is no .3 package, only .4, this causes a warning when restoring packages using Visual Studio 2019.
This is understandably just a nuisance issue, so if you'd want to simply close it without taking any action on it, that's understandable. Otherwise, publishing a new ASP.NET Core package with the bumped implementation package dependency should clear up the issue.
Hello,
I'm using multipart/form-data to upload a file and want to protect it using digest authentication.
Without the Authorize attribute the test file gets read without any issue. The file is small enough (100kB) to pass through without hitting any dotnet core limits.
Using digest authentication I suddenly get:
InvalidDataException: Multipart body length limit 16384 exceeded.
Among other things I've tried setting [RequestSizeLimit(long.MaxValue)] on the action and configuring the global MultipartBodyLengthLimit to a higher limit but with no success.
Since it seems to work without authentication I believe it is somehow related.
Any ideas?
I've attached a small example to reproduce.
[Authorize(AuthenticationSchemes = "Digest")]
public async Task<IActionResult> PostFormData([FromForm] IFormFile file)
{
using (var sr = new StreamReader(file.OpenReadStream()))
{
var content = await sr.ReadToEndAsync();
return Ok(content);
}
}
I've implemented DIGEST auth with your library (kudo it seems to work fine). I have only a small question, the User object that get injected into the ASP.NET core controller has a username null and a claim DIGEST_AUTHENTICATION_NAME that contains the username used to authenticate.
My question is: is there an option to let the username to be also the Name of generated user?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.