All lessons Leer en español

Foundations · Unit 14 · Lesson 2 of 2

Authentication versus authorization

A valid account still needs permission for the particular action, object, and moment.

7 minready

Helpful before thisAuthentication

After this lesson you can

  • Separate confidence in account control from permission to act.
  • Describe access decisions using subject, action, resource, and context.
  • Explain why changed roles and hidden buttons require server-side enforcement.

Maya signs into a fictional reading club successfully. She can edit her own review, read published reviews, and see the date of the next meeting. She cannot change the club’s payment details. There is no contradiction: the service can be confident about her account and still deny an operation.

A decision for this requestWho is acting?: Account and session context. What is requested?: Action + particular resource. What applies now?: Role, relationship, conditions. Decision: Allow or deny on the serverA decision for this requestWho is acting?Account and session contextWhat is requested?Action + particular resourceWhat applies now?Role, relationship,conditionsDecisionAllow or deny on the server
Authentication supplies context; authorization evaluates a particular requested action.

Ask a complete permission question

Authentication asks whether the claimant has demonstrated the expected account or authenticator control. Authorization asks whether a subject may perform an action on a resource under the current conditions. “Maya is allowed” is incomplete. “Maya may edit the review she owns while her membership is active” is much more useful.

The subject might be a person, an application, or an automated job. The resource might be a record, file, room booking, or administrative setting. Context can include the relationship to that resource, the current role, or a requirement for recent authentication. Naming each part reveals missing assumptions.

Roles are a starting point

A role groups permissions for a kind of work. The club’s event editor can update meeting descriptions; the treasurer can manage payment records. A member role alone does not explain which member’s review may be changed. Ownership or another relationship may be part of the rule.

Likewise, giving someone a role in one group should not silently grant that role in every group using the service. The organization or tenant context belongs in the decision. These distinctions are why one successful sign-in cannot replace all later permission checks.

The interface is not the authority

Hiding a button can make a screen easier to use, but the service must enforce its rule when it receives a protected request. The same operation may be reachable through different screens or through an application interface. Every supported path needs the appropriate checks.

This does not mean beginners need to invent their own access-control engine. It means designers should state the rules explicitly, use well-supported mechanisms, and verify both allowed and denied cases using fictional records in their own development environment.

PredictMaya’s event-editor role is removed, but an old browser tab still displays an Edit button. Should that tab preserve her editing permission?

No. The screen can be stale. The service should apply the current relevant policy when handling the operation. How quickly cached roles or issued tokens reflect a change is part of the design and must be accounted for.

Changes matter as much as sign-in

Permission can change during a session. A membership may end, a document may be transferred, or a sensitive operation may require stronger proof. A valid session and a current permission decision are different checks. Logout, role removal, and token expiry also have different meanings; none should be treated as a universal substitute for the others.

For the club, make the rule review concrete: a member edits their own review, an editor updates meeting details, and a treasurer changes payment settings after the required checks. Then ask about a different member’s review, a removed role, and a different club. Good explanations include why each request is allowed or denied.

Check yourself

No timer. No penalties. Read the explanation and try again whenever you like.

  1. Maya signs in but cannot change payment details. Which explanation fits?

    Show the answer

    Correct answer: Authentication succeeded; authorization denied that action. The two decisions have different jobs.

  2. Which is the most complete permission rule?

    Show the answer

    Correct answer: An active member may edit the review they own. It identifies a subject condition, action, and resource relationship.

  3. Where must a protected operation’s rule be enforced?

    Show the answer

    Correct answer: At the service handling the request. The service must check supported request paths.

  4. An old tab retains an Edit button after a role is removed. What should govern access?

    Show the answer

    Correct answer: The current relevant policy, including any defined propagation behavior. The system must account for changes and cached authorization information.

Try it

  • WriteCreate a paper access table for a fictional club: member, event editor, treasurer. Give each two allowed actions and one denied action. Then remove the editor role and explain which decisions must change.
References