Authentication and authorization
Who are you, and what may you do?
Authentication checks a claim about an identity. Authorization decides whether that identity may perform a particular action. In a fictional library, Sara signs in successfully, but she may read her own loan record only. A successful sign-in does not give her permission to change someone else’s record.
Accounts, principals and credentials
An account is a stored representation of an identity. A principal is an entity that can request access, such as a person or service. A username identifies an account but does not prove control of it. A credential is associated with an identity and supports verification, for example a registered public-key credential. An authenticator is something the user controls and uses to prove the claim. An application may establish a session after authentication; that session must remain valid and bound to the correct identity.
Follow an access decision
Imagine two records: R1 belongs to Sara and R2 to Reza. The server receives Sara’s valid session, the action read and target R1. The ownership policy allows it. For R2 the same session is valid, but ownership differs, so the server denies it. A session that has expired fails the identity prerequisite for either record. The record identifier is only a label, not a permission.
Accountability is a separate concern
Accountability depends on reliable attribution and appropriate records of actions. A fictional audit entry might contain actor Sara, action read, target R1 and outcome allowed, with a timestamp. A log entry can help a reviewer reconstruct decisions; it does not prove that Sara personally performed an action if her account or session was compromised. Avoid recording passwords, session secrets or unnecessary record contents. Hiding a button in the browser cannot replace a server-side access check.
Try a decision
A valid session belongs to Reza. Under an owner-only read policy, predict the result for R1 and R2. Explain which check succeeds and which fails. Now consider an expired session. The next lesson explores stronger authentication and account recovery.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Authentication and authorization — Knowledge check
Apply identity and access principles to fictional library scenarios.
Sara signs in and requests Reza’s record. Which check must still occur?
What does a username by itself establish?
Under owner-only reads, Reza’s valid session requests R2, owned by Reza. What is the decision?
What should happen when a session expires in the library model?
Which audit entry best supports reviewing a decision without storing secrets?