© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3mo ago•
25 replies
Giuseppe

Setup of Mixed-Authentication WebApi

asp.netintermediateadvanced
Hi all!
I was asked at work to start a new WebApi project, where authentication should work in "two layers":
- 1° Software authentication [Done by cookie]: Where the client tell us which is the software trying to contact us
- 2° User authentication [WindowsAuth / Negotiate]: Where the client tell us who's the user trying to contact us

(don't ask me why they made those decisions)

Authentication Flow:
- Client authenticates itself (so our webapi checks if the credentials given match the ones in a specific table)
- User authenticates itself by an authenticated client (so with the claim generated by negotiate we get the domain user and we check if the user is present/enabled in another table)

First question, can those two coexist in the same request? (Since its the mechanism i need)

I started the project by creating more authorization policies where each one applied a specific authentication scheme, but i had problems when setting the defaultScheme

Second question, what's the difference between Policies and Filters?

Third question, am i following the optimal path?
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

Similar Threads

WebAPI authentication with Blazor WASM
C#CC# / help
8mo ago
Need authentication from MVC to WebAPI
C#CC# / help
3y ago
✅ Custom TimeProvider for WebApi
C#CC# / help
8mo ago
Cookies help Dotnet webapi
C#CC# / help
2y ago