advanced24 min studyLesson 426 in Engineering

Identity proof and resource decisions

Evaluate who called separately from what that caller may do to a particular resource.

On this page

What you’ll understand

  • Distinguish authentication from an action-resource authorization decision.
  • Preserve validated caller context through service boundaries.
  • Test tenant and ownership checks after successful credential validation.

Mutual TLS or a validated token can establish an authenticated principal without granting it every operation on the server. Authorization evaluates a requested action, a resource, and relevant context against policy. Confusing the two creates APIs that are secure at the transport layer yet expose another tenant's data. Follow a request from identity validation to the exact object selected and the side effect performed.

Authentication produces context, not a universal allow

A successful credential check should produce a principal with validated authority and relevant claims, not merely a Boolean that any internal caller is trusted. The application still needs to decide whether that principal may read, update, delete, or delegate access to the requested resource. A network location or service certificate can be useful policy context, but neither automatically establishes ownership of every object identifier present in the request.

A user-supplied tenant or resource parameter must be checked against authoritative relationships rather than copied into the authorization context as truth. An authenticated user can change a URL identifier just as an anonymous one can. Evaluate the final resource actually accessed, including redirects, aliases, and backend lookups where they affect the decision. Authorization performed on one object while the operation mutates another is a correctness failure even when the initial identity was fully valid.

d=policy⁡(p,a,r,c)d=\operatorname{policy}(p,a,r,c)
The decision d depends on validated principal p, requested action a, resolved resource r, and trusted context c. It is a logical policy evaluation, not a probability or a consequence of successful TLS alone.↔ Scroll wide equations horizontally.

Context propagation has its own trust boundary

When a frontend calls a backend, distinguish an authenticated service assertion from arbitrary forwarded headers. A header naming a user is trustworthy only if the backend authenticates its source and the protocol prevents callers from forging that context. Delegation may preserve both actor and subject, or the backend may rely on a carefully defined service authorization. Document which model applies rather than accepting every internal header as proof of user authority.

Authorization decisions can become stale when membership, ownership, or policy changes. Cache them only with keys and lifetimes covering the principal, action, resource, relevant policy version, and required revocation behavior. Reusing a cached allow for a different tenant or action can bypass a correct policy engine. Likewise, checking permission and then acting after the resource changes can create a time-of-check/time-of-use race; strict invariants may need a transaction or version condition at the resource boundary.

allowed⁡=authenticated⁡(p)∧(p,a,r,c)∈P\operatorname{allowed}=\operatorname{authenticated}(p)\land(p,a,r,c)\in\mathcal P
For this protected-request model, an authenticated principal must also match the permitted policy relation P. The expression omits provider-specific policy combination and anonymous-access exceptions, which need their own explicit contract.↔ Scroll wide equations horizontally.

Audit allowed and rejected actions separately

Test valid credentials with forbidden actions and resources, not just invalid credentials. Include same-identifier objects across tenants, recently removed group membership, and a resource whose ownership changes during a request. Audit both authentication failure and authorization denial with distinct reasons and safe identifiers. A spike in denials may reveal an overbroad client or a stale policy cache; a drop to zero denials can indicate a broken enforcement path rather than improved security.

The probability lab is a statistical contrast. Reset and set both p=0.5, n=10, predict five successes on average, then inspect. The trials are independent and interchangeable; real authentication and authorization outcomes need not be. The instrument does not validate identities, query ownership, or enforce policy. Use it to explain why multiplying two imagined success percentages is unjustified unless conditional relationships are known, then classify actual request outcomes by their distinct validation stages.

One hundred protected requests

A trace contains 100 requests. Ninety authenticate successfully; among those ninety, seventy are authorized for the actual action and resource. Assume the other ten fail before a resource decision is made.

  1. Authentication succeeds for 90% of the trace. That percentage does not mean ninety operations should run; the resource policy still applies to those requests.

  2. Seventy requests execute under the stated conditions, twenty authenticated requests are denied, and ten fail authentication. Total rejected requests are thirty, with two different reasons.

  3. Authorization success conditional on authentication is 70/90≈77.78%, while overall successful execution is 70%. Preserve that conditioning instead of treating authentication and authorization as independent random events.

The result

Distinct stage outcomes explain both enforcement and user-visible completion without equating identity proof with permission.

Explore the model

Interactive lab

Interactive lab · probability

Independent trials are not an access pipeline

Reset, set p=0.5, n=10, predict mean 5. These exact binomial trials have no identity, resources, policy, or conditional access stages and do not estimate production authorization success.

Independent trials are not an access pipelineThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forMeasure actual conditional outcomes instead of multiplying unrelated percentages.

Check your understanding

A caller authenticates with a valid service identity and requests another tenant's object. What remains necessary?

Try it yourself

A backend accepts a forwarded user header from any network peer and uses it for access decisions. Explain why encrypted transport alone does not make the user assertion trustworthy.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Encryption protects a channel; it does not define who may assert another principal's identity.

Compare with the solution

An arbitrary peer can supply a chosen header unless the backend authenticates and authorizes the forwarding source and validates the assertion protocol. TLS encryption to the backend may protect that forged text in transit without making it true. Use a supported authenticated delegation/context mechanism, and still apply action-resource policy after resolving the target object.

Take it with you

  • Authentication supplies validated principal context.
  • Authorization binds that principal to the actual action, resource, and trusted context.
  • Forwarded context, cached allows, and concurrent resource changes need separate enforcement rules.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.