© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
160 replies
The Fog from Human Resources

❔ Massive issue with Authentication

So im trying to add server password handling but instead of making my own handler im forced to implement some AuthenticationHandler for it, which I did, but now the AuthenticateResults aren't even being given to the request user so its useless, and the Authentication Checks are being ran on every Endpoint instead of the ones i added [Authorize(myStuff)] into, and i have no idea what to do
Program.cs:
            var builder = WebApplication.CreateBuilder(args);

            builder.Services.AddAuthentication(options =>
            {
                
            }).AddScheme<Utils.ServerKeyAuthenticationOptions, Utils.ServerKeyAuthenticationHandler>("serverPass", options => { });

            builder.Services.AddControllers();
            
            ConfigureServices(builder.Services);
            var app = builder.Build();
            
            app.UseHttpsRedirection();

            app.UseMiddleware<Utils.RequestCounter>();


            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();
            app.MapControllers();
            var builder = WebApplication.CreateBuilder(args);

            builder.Services.AddAuthentication(options =>
            {
                
            }).AddScheme<Utils.ServerKeyAuthenticationOptions, Utils.ServerKeyAuthenticationHandler>("serverPass", options => { });

            builder.Services.AddControllers();
            
            ConfigureServices(builder.Services);
            var app = builder.Build();
            
            app.UseHttpsRedirection();

            app.UseMiddleware<Utils.RequestCounter>();


            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();
            app.MapControllers();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ Weird issue with authentication flow
C#CC# / help
9mo ago
✅ Discord Authentication Redirection Issue
C#CC# / help
2y ago
✅ massive question with OOP (beginner)
C#CC# / help
4y ago
✅ .net 7 rest api CORS issue with Authentication
C#CC# / help
3y ago