© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
Kiel

❔ AuthZ/AuthN with ASP.NET Minimal APIs

What's the correct way to do authz/authn with minimal APIs in asp.net? I'm doing both of those things based on the provided Authorization header, which is an API token of the format:
+              Hashed ID portion                       Generated cryptographic portion  
MQAzADIAMwA0ADkANAAzADkANQAwADYAMwA4ADIAOAA0ADgA.EFujxWr7BQRRBkiVEmJozkcGMjtIbAbOjQdQiw7GB+Q=
+              Hashed ID portion                       Generated cryptographic portion  
MQAzADIAMwA0ADkANAAzADkANQAwADYAMwA4ADIAOAA0ADgA.EFujxWr7BQRRBkiVEmJozkcGMjtIbAbOjQdQiw7GB+Q=

AuthZ will be treating the hashed ID like a username and the cryptographic portion like an auto-generated password to validate a user's identity.

AuthN will be simply validating that the (unhashed) ID matches the ID in the route the user is requesting.

What's the simplest (but still correct) way to do this? the article I read went wayyy over my head and looked designed for much more complicated solutions so maybe if someone else were to explain it I'd hopefully understand.

I'm unsure if it's just as simple as me implementing my own
IAuthorizationService
IAuthorizationService
/
IAuthenticationService
IAuthenticationService
thonk2
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

ASP.NET REST APIs with Custom Error Models
C#CC# / help
4y ago
Eagerly compile minimal apis
C#CC# / help
2y ago
❔ WebApplicationFactory and Minimal-APIs
C#CC# / help
3y ago
Help with asp.net
C#CC# / help
3y ago