Authentication answers "Who are you?" It proves identity: a password, a one-time code, a fingerprint, a token.
Authorization answers "What are you allowed to do?" It happens after you are known: can this user view this page, edit this record, delete that file?
Airport analogy: showing your passport and boarding pass at the gate is authentication. Which areas you may enter, such as a lounge for business class only, is authorization.
In a web app, login is authentication. Roles (Admin, Editor, User), permissions and rules like "a user can only edit their own posts" are authorization.
Order matters: authenticate first, then authorize. In ASP.NET Core you call UseAuthentication() before UseAuthorization(). Note the error codes: 401 means not authenticated, 403 means authenticated but not allowed.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Airport analogy: showing your passport and boarding pass at the gate is authentication. Which areas you may enter, such as a lounge for business class only, is authorization.
In a web app, login is authentication. Roles (Admin, Editor, User), permissions and rules like "a user can only edit their own posts" are authorization.
Order matters: authenticate first, then authorize. In ASP.NET Core you call
UseAuthentication()beforeUseAuthorization(). Note the error codes: 401 means not authenticated, 403 means authenticated but not allowed.