Authentication & Authorization

Chapter 9
Full-Stack Identity Implementation

Bachelors Program in Full Stack Development
Authentication & Authorization   •   Bachelor

Full-Stack Identity Implementation

Introduction

Authentication and authorization are not isolated backend features. In a modern application, identity crosses browser interfaces, mobile clients, APIs, databases, background workers, caches, and service-to-service communication. A user may authenticate through a web form, receive a session cookie or token, access a tenant-scoped resource, and trigger asynchronous work executed by another service. Each transition creates an opportunity for incorrect assumptions or unauthorized access.

Authentication answers who is making the request? Authorization answers what is that identity permitted to do? A secure implementation must also answer: which tenant owns the resource, which client is allowed to use a credential, whether the credential is still valid, and whether a server-side policy permits the specific operation.

This chapter develops an implementation model for full-stack identity. It emphasizes defense in depth: secure credential handling, explicit authorization decisions, database enforcement, tenant isolation, middleware and guards, policy engines, secure routing, mobile considerations, microservice trust boundaries, and operational monitoring.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Distinguish authentication, authorization, session management, and identity lifecycle management.
  2. Design identity flows for web, mobile, APIs, and microservices.
  3. Implement middleware, route guards, server-side policy checks, and tenant isolation.
  4. Compare cookies, access tokens, refresh tokens, and service credentials.
  5. Identify common failures such as insecure direct object references, confused-deputy behavior, and client-only authorization.
  6. Explain how databases, policy engines, logging, testing, and governance contribute to a secure identity architecture.

1. A Full-Stack Identity Model

An identity system can be viewed as five related layers:

LayerMain questionTypical mechanisms
Identity proofHow is the subject verified?Passwords, passkeys, federated login, MFA
Credential issuanceWhat evidence is given after verification?Session ID, access token, refresh token
Request authenticationHow does the server validate evidence?Cookie validation, token verification, introspection
AuthorizationWhat may the subject do?Roles, permissions, policies, ownership checks
Lifecycle and governanceHow are identities controlled over time?Revocation, recovery, audit, retention

The word subject means the identity acting in a request. It may be a human user, an organization, a device, or a service. The resource is the object being accessed, such as an invoice, project, or user record. The action is an operation such as read, update, approve, or delete.

A useful authorization abstraction is:

Decision = Policy(subject, action, resource, context)

Here, subject, action, and resource are required inputs, while context may include tenant, time, device assurance, network, or transaction state. The result should be an explicit allow or deny. Authentication supplies evidence about the subject; it does not itself create permission.

Identity is not the same as a user record

A user record is application data. An identity may be managed by an internal identity provider, a social provider, an enterprise directory, or several providers linked to one account. Applications should use stable internal identifiers rather than treating email addresses as immutable identity keys. Email can change, be reused, or be unverified.

Trust boundaries

Trust boundaries occur at browser-to-API, mobile-to-API, API-to-database, and service-to-service connections. Data received across a boundary is untrusted until validated. A token signed by a trusted issuer may establish identity, but its claims still require validation for issuer, audience, expiry, intended use, and tenant context.

2. Authentication Flows Across Clients

2.1 Browser applications

A common browser flow is:

  1. The browser submits credentials over HTTPS.
  2. The identity service verifies the password or federated assertion.
  3. The server creates a session record containing a cryptographically random identifier.
  4. The server sends the identifier in a cookie configured with Secure, HttpOnly, and an appropriate SameSite value.
  5. Subsequent requests include the cookie automatically.
  6. Backend middleware resolves the session and attaches a server-side principal to the request.

A session cookie should contain an opaque identifier rather than sensitive user data. The session state can be stored in a database or an appropriately secured distributed cache. On logout, the session is invalidated server-side. This is especially valuable when immediate revocation is required.

Cookie authentication introduces cross-site request forgery (CSRF) considerations because browsers attach cookies automatically. Applications should use an appropriate CSRF defense, such as a synchronizer token or a carefully designed same-site strategy. Cross-origin resource sharing (CORS) is not a CSRF defense; CORS controls which browser origins may read responses, not whether a browser sends a cookie.

2.2 Single-page applications

A single-page application may call an API directly. A safer design avoids placing long-lived credentials in localStorage, because any successful cross-site scripting attack can read them. A short-lived access credential held in memory, combined with a secure refresh mechanism, reduces exposure. Another design uses a backend-for-frontend (BFF): the browser holds a secure session cookie, while the BFF handles tokens and calls downstream APIs.

A route guard in a frontend framework improves user experience by hiding pages from unauthenticated users. It is not a security boundary. Every protected operation must be enforced by the server.

2.3 Mobile applications

Mobile applications should use the platform’s secure credential storage, such as a hardware-backed keystore where available. Authorization-code flow with Proof Key for Code Exchange (PKCE) is appropriate for public clients because the client cannot safely keep a client secret. A claimed HTTPS redirect or an application-universal link is generally safer than an unclaimed custom scheme, although platform support and deployment constraints must be assessed.

Mobile access tokens should be short-lived. Refresh tokens require rotation, reuse detection, secure storage, and revocation. A mobile client must also handle lost devices, application reinstalls, clock differences, network interruption, and API version changes.

2.4 Federated authentication

With OpenID Connect, the identity provider authenticates the user and returns an identity assertion to the relying application. The application must validate the issuer, audience, signature, nonce, state, and time-related claims according to the protocol and library guidance. An ID token is intended to communicate authentication to the client; it should not automatically be presented to an API as an access token.

3. Credential and Token Design

Sessions and tokens

A server-side session provides centralized control. A bearer access token provides portability but creates a serious consequence if stolen: whoever possesses it may use it until expiry or revocation. Token format alone does not make a system secure. A signed token ensures integrity only when the verifier validates the signing algorithm, issuer, audience, expiry, and relevant claims.

Important token concepts include:

  • Issuer (iss): the authority that created the token.
  • Audience (aud): the service for which the token is intended.
  • Subject (sub): the stable identity identifier.
  • Expiry (exp): the time after which the token must not be accepted.
  • Issued-at (iat): when the token was created.
  • Scope: delegated permissions, normally expressed as constrained capabilities.
  • Token identifier (jti): an identifier useful for replay detection or revocation records.

The server should reject expired tokens, tokens for another audience, tokens from an untrusted issuer, malformed tokens, and tokens with unacceptable algorithms. Do not accept an algorithm selected by an untrusted token without an explicit allow-list.

Password storage

Passwords must not be encrypted for later decryption. They should be processed with a password hashing function designed to be slow and memory-intensive, such as Argon2id, with parameters selected through testing and periodically reviewed. Each password receives a unique salt. A server may use a separately protected pepper as additional defense, but a pepper does not replace salts or a strong password hashing function.

Password verification should avoid revealing whether the username or password was incorrect. Rate limiting, breached-password checks, MFA, and secure recovery procedures are also necessary. Password-reset tokens should be random, single-use, short-lived, and stored in a form that does not expose the usable token if the database is read.

Refresh-token rotation

A robust refresh design treats each refresh token as a one-time credential. When a refresh token is used, the server issues a new one and invalidates the old one. Reuse of an invalidated token may indicate theft and should cause the associated token family or session to be revoked. This design must account for limited concurrent requests so that ordinary mobile retries do not create unnecessary lockouts.

4. Middleware, Guards, and Server-Side Enforcement

Middleware is an ordered request-processing mechanism. A typical API pipeline is:

  1. Parse the request safely.
  2. Apply transport and request-size protections.
  3. Authenticate the request.
  4. Load tenant and principal context.
  5. Apply route-level authorization.
  6. Validate input and resource identifiers.
  7. Perform object-level authorization.
  8. Execute business logic.
  9. Record security-relevant outcomes.

Authentication middleware should attach a structured principal, for example { subjectId, tenantIds, assuranceLevel }, rather than allowing controllers to parse raw headers independently. Centralization reduces inconsistent behavior.

A guard is a reusable authorization checkpoint. Guards may enforce authentication, roles, scopes, or policies. However, a role guard alone is insufficient for object-level decisions. A user may have the editor role but still lack permission to edit a particular project belonging to another tenant.

Secure route design

A protected route should be protected by default. Explicitly mark genuinely public routes rather than requiring developers to remember protection for every new route. Avoid relying on URL obscurity. Resource identifiers should be unguessable where practical, but authorization must remain correct even when identifiers are known.

A server should return a consistent denial response without exposing whether a sensitive resource exists. In some cases 404 Not Found is preferable to 403 Forbidden to avoid revealing resource existence; this is a policy decision, not a universal rule.

Object-level authorization

For every resource request, the server should answer:

  • Does the resource exist?
  • Does it belong to the caller’s tenant or permitted organizational scope?
  • Is the requested action allowed for this subject?
  • Are additional conditions satisfied, such as ownership, workflow state, or approval separation?

The check must occur before returning data or performing a side effect. Authorization after a database write is too late.

5. Roles, Permissions, and Policy Engines

Role-based access control

Role-based access control (RBAC) assigns permissions to roles and roles to subjects. It is easy to explain and useful for broad administrative responsibilities. A permission is more precise than a role; for example, invoice:approve is preferable to embedding an assumption that every administrator can perform every action.

RBAC becomes difficult when permissions depend on resource ownership, department, time, geography, or workflow state. Adding many roles to represent every combination creates role explosion.

Attribute- and relationship-based models

Attribute-based access control (ABAC) evaluates properties of the subject, resource, action, and environment. Relationship-based access control (ReBAC) evaluates relationships such as “member of project” or “manager of employee.” Real applications frequently combine these approaches.

A policy might state: a subject may update a document when the subject belongs to the document’s tenant, has the document:update permission, and either owns the document or belongs to its project with editor privileges. This policy is richer than a simple role test.

A policy decision point (PDP) evaluates policy; a policy enforcement point (PEP) intercepts the request and applies the decision. A policy information point (PIP) supplies attributes such as tenant membership or resource classification. Separating these responsibilities improves consistency, but policy services introduce latency, availability, versioning, and caching concerns.

Policy decisions should be fail-closed when required information is unavailable. A cache must not extend authorization beyond intended revocation or policy-change windows. Policy definitions should be version-controlled, tested, reviewed, and observable.

6. Tenant Isolation

Multi-tenant applications must ensure that one customer cannot access another customer’s data. Tenant identity should come from a trusted server-side source, such as a validated membership relationship or a carefully verified token claim. It must not be accepted merely because the client sends tenantId in a request body.

A safe data-access pattern applies tenant scope to every query:

SELECT * FROM invoices
WHERE tenant_id = authenticated_tenant
  AND invoice_id = requested_invoice;

The application should also enforce tenant ownership at write time and in background jobs. A database can provide an additional boundary through row-level security, separate schemas, or separate databases. The choice depends on risk, scale, operational capability, and regulatory requirements.

Tenant isolation is not only a query concern. It includes caches, search indexes, object storage paths, logs, analytics exports, message queues, and notifications. Cache keys should include tenant context. A background job should carry a validated tenant identifier and use a service identity constrained to that tenant or operation.

7. Databases and Identity Integrity

Identity-related tables commonly include users, external identities, sessions, refresh-token families, memberships, roles, permissions, and audit events. Database constraints should enforce invariants that application code might accidentally violate. Examples include unique constraints on provider-plus-provider-subject, foreign keys for memberships, non-null tenant ownership, and restricted deletion behavior for audit records.

Authorization queries should avoid a time-of-check/time-of-use gap. Prefer an atomic, constrained operation such as updating a record only when the caller has the required ownership or tenant condition. If a separate authorization check is necessary, use appropriate transaction isolation and recheck conditions before a sensitive write.

Never log passwords, raw session identifiers, refresh tokens, access tokens, MFA secrets, or full identity-provider assertions. Logs should contain a correlation identifier and a privacy-conscious subject reference where operationally necessary.

8. Microservices and Service-to-Service Identity

In a microservice architecture, user authentication at the edge does not automatically authorize every downstream operation. A gateway may validate a user token, but downstream services still need trustworthy context and must enforce authorization for resources they own.

Service identity can use mutual TLS, workload identity, signed service tokens, or a combination. A service credential should have a narrow audience and least privilege. Avoid a single universal secret shared by all services. Rotate credentials and design for key overlap during rotation.

Two patterns are common:

  • End-user propagation: the downstream service receives validated user context and makes a user-level authorization decision.
  • Delegated service action: a service acts on behalf of a user, with evidence of both the calling service and the original subject.

The second pattern must prevent confused-deputy behavior. A powerful service should not accept a user-supplied claim that the request was authorized elsewhere without verifying the trusted delegation mechanism and its intended audience.

Message queues require the same discipline as HTTP APIs. A message should identify the initiating subject, tenant, purpose, and correlation identifier where appropriate. Consumers must not assume that a message’s presence proves permission for every operation.

9. A Practical Implementation Pattern

Consider an API endpoint that updates a project. A secure implementation can be organized as follows:

request
  → authenticate session/token
  → resolve tenant membership
  → validate project identifier and input
  → load project within tenant scope
  → evaluate project:update policy
  → perform constrained update
  → emit audit event
  → return safe response

Illustrative pseudocode:

principal = authenticate(request)
require principal

membership = memberships.find(principal.subjectId, request.tenantId)
require membership is active

project = projects.find(tenantId=request.tenantId,
                        projectId=request.path.projectId)
require project exists

allowed = policy.can(principal, "project:update", project,
                     context={tenantId: request.tenantId})
require allowed

projects.updateIfVersionMatches(project.id,
                                 request.body,
                                 project.version)
audit.record("project.updated", principal, project.id)

The example demonstrates several principles: authentication precedes authorization; tenant membership is verified; the resource is loaded within tenant scope; the policy receives the actual resource; and the update can use optimistic concurrency to prevent accidental overwrites. The policy check remains necessary even if the user interface hides the edit control.

10. Case Study: Illustrative Multi-Tenant Learning Platform

Background

An illustrative company operates a learning platform for universities. Students, instructors, and departmental administrators use a web application and mobile app. Each university is a tenant. Services include identity, courses, assessments, files, notifications, and analytics.

Problem

The initial application accepted a universityId from the client, used frontend route guards, and allowed the assessment service to trust a gateway-provided role claim. A penetration test demonstrated that a student could alter the university identifier and retrieve another institution’s course metadata. A second flaw allowed an instructor to view an assessment from a course outside the instructor’s department.

Analysis

The system confused authentication with authorization. It trusted client-selected tenant context, used a coarse role check, and lacked object-level policy enforcement. The gateway’s decision was treated as sufficient by downstream services. Caches also omitted tenant identifiers from keys, creating a potential cross-tenant data leak.

Approach and solution

The team introduced the following controls:

  1. The identity service issued stable subject identifiers and short-lived access tokens.
  2. An API middleware resolved active tenant membership from the database rather than trusting a body field.
  3. Every repository method required a tenant context.
  4. Assessment authorization evaluated subject, action, assessment, course, department, and workflow state.
  5. The assessment service independently enforced its policy, even when called by the gateway.
  6. Cache keys included tenant and resource identifiers.
  7. Mobile refresh tokens were rotated and stored using platform secure storage.
  8. Audit events recorded denied access, administrative changes, and policy outcomes without recording credentials.
  9. Automated tests attempted cross-tenant reads and writes for every protected resource type.

Outcome

Cross-tenant access attempts were denied at the service and database layers. The platform gained more precise instructor permissions, and administrators could review authorization failures. The policy service introduced some latency, so decisions for stable, low-risk attributes were cached for a bounded period while revocation-sensitive operations remained uncached.

Learning points

The case illustrates that tenant isolation is a system property, not a single middleware line. It must extend through queries, policies, caches, services, jobs, and observability. It also shows why downstream services cannot blindly trust a gateway and why authorization should be tested as a matrix of subjects, actions, resources, and tenants.

11. Testing, Monitoring, and Failure Analysis

Identity systems require more than happy-path tests. Essential tests include:

  • unauthenticated requests to protected routes;
  • expired, malformed, wrong-audience, and wrong-issuer tokens;
  • users with no tenant membership;
  • users attempting cross-tenant access;
  • legitimate users lacking a specific permission;
  • revoked sessions and reused refresh tokens;
  • race conditions around concurrent updates;
  • policy-service timeout and unavailable behavior;
  • service credentials used against the wrong audience;
  • mobile logout, reinstall, and token-refresh scenarios.

Property-based or matrix testing can generate combinations of subjects, roles, tenants, resources, and actions. Security tests should verify both positive and negative decisions. A denial should not accidentally disclose sensitive resource existence.

Monitoring should identify unusual login failures, token reuse, privilege changes, policy-denial spikes, impossible travel patterns where appropriate, and cross-tenant query errors. Security logs need integrity protection, access controls, retention rules, and privacy review.

12. Common Implementation Failures

Client-only authorization

Hiding a button or protecting a frontend route improves usability but does not protect an API. The server must enforce every permission.

Trusting user-supplied identity fields

Fields such as userId, role, or tenantId in a request are claims from an untrusted client. Derive them from validated credentials and server-side relationships.

Insecure direct object references

An endpoint that retrieves /invoices/1002 without checking ownership permits unauthorized access even if the identifier is difficult to guess.

Overbroad service credentials

A service that can read and modify every tenant creates a large blast radius. Use narrow audiences, scopes, and tenant constraints.

Token leakage

Tokens can leak through URLs, browser storage, logs, crash reports, referrer headers, or overly permissive debugging. Keep credentials out of these channels.

Confusing authentication artifacts

An ID token, access token, refresh token, session cookie, and API key have different purposes. Validate and accept each only in its intended context.

Fail-open authorization

If a policy dependency is unavailable, granting access for convenience can create a serious vulnerability. Define availability behavior explicitly and prefer denial for sensitive operations.

13. Governance, Ethics, and Regulation

Identity systems process sensitive personal information. Design should follow data minimization, purpose limitation, access control, retention limits, and transparency principles. Users should not be profiled or denied essential services through opaque automated decisions without appropriate oversight.

Organizations should define who may administer identities, how privileged access is approved, how emergency access is logged, and how access is removed when employment or enrollment ends. Accessibility matters: MFA and recovery processes must not exclude users with disabilities or limited device access.

Regulatory obligations vary by jurisdiction and sector. Applications may need to address privacy rights, breach notification, electronic records, education or health data, and contractual security requirements. Technical controls do not replace legal analysis; developers should work with security, privacy, and compliance stakeholders.

14. Contemporary Directions

Passkeys based on public-key credentials reduce dependence on reusable passwords and resist phishing when implemented through platform authenticators. Risk-based authentication can request stronger verification when device, location, behavior, or transaction context changes, but such systems require careful privacy and bias evaluation.

Zero-trust architectures treat every request as requiring explicit verification rather than assuming that an internal network is safe. Continuous authorization can reassess session assurance, device posture, and resource sensitivity. Policy-as-code improves reviewability and consistency, while automated tools can detect missing authorization checks or generate adversarial test cases. AI-assisted security tooling is useful for code review and anomaly detection, but it can produce false positives, miss contextual flaws, and should not make unreviewed access decisions for high-impact systems.

Best-Practice Checklist

  • Use HTTPS and secure, modern identity protocols.
  • Store passwords with a suitable adaptive password hash, never reversible encryption.
  • Use secure, short-lived credentials and rotate refresh tokens.
  • Validate issuer, audience, signature, algorithm, expiry, and intended use.
  • Enforce authorization on the server and at the object level.
  • Resolve tenant context from trusted membership data.
  • Apply tenant scope to databases, caches, files, jobs, and events.
  • Give each service a distinct, least-privileged identity.
  • Fail closed for sensitive authorization decisions.
  • Keep secrets and tokens out of logs and URLs.
  • Audit administrative actions and security-relevant denials.
  • Test negative cases, cross-tenant access, revocation, and dependency failure.
  • Review policies, retention, accessibility, and privacy impacts regularly.

Chapter Summary

Full-stack identity implementation connects authentication, credential management, authorization, data access, client behavior, and operational governance. Sessions and tokens are evidence, not permission. Middleware and guards provide reusable enforcement points, but object-level and tenant-aware checks must reach the service and database layers. RBAC is useful for broad permissions, while ABAC and ReBAC address contextual and relationship-based decisions. Mobile applications require PKCE and secure storage; microservices require explicit service identity and protection against confused deputies. Secure systems test denial paths, isolate tenants across every data channel, rotate credentials, log carefully, and fail closed when authorization information is unavailable. The strongest architecture treats identity as a system-wide property rather than a feature added to one route or screen.

Key Terms

Authentication: Verification of the identity or acting subject.

Authorization: Determination of whether a subject may perform an action.

Principal: A validated identity represented in a request.

Session: Server-managed state associated with an authenticated client.

Access token: A credential presented to an API to request permitted access.

Refresh token: A credential used to obtain a new access token.

Scope: A constrained permission expressed in a credential.

Issuer: The authority that creates and signs an identity artifact.

Audience: The service or recipient for which a token is intended.

Middleware: Ordered request-processing logic applied before or after a handler.

Guard: A reusable checkpoint that permits or denies access.

RBAC: Authorization based on roles assigned to subjects.

ABAC: Authorization based on subject, resource, action, and environmental attributes.

ReBAC: Authorization based on relationships among subjects and resources.

Policy decision point: Component that evaluates an authorization policy.

Policy enforcement point: Component that applies the policy decision.

Tenant isolation: Prevention of unauthorized access between customer or organizational partitions.

CSRF: An attack that causes a browser to send an unintended authenticated request.

Confused deputy: A situation in which a more privileged component is tricked into misusing its authority.

PKCE: A protocol extension that protects authorization-code flow for public clients.

Review Questions

Short Answer Questions

  1. What is the difference between authentication and authorization?
  2. Why is a frontend route guard not a sufficient security boundary?
  3. Name three token claims that an API should validate.
  4. Why should tenant context not be accepted solely from a request body?
  5. What is the purpose of refresh-token rotation?

Long Answer Questions

  1. Compare server-side sessions and bearer access tokens, including their security and operational trade-offs.
  2. Explain how middleware, guards, policy decision points, and policy enforcement points can cooperate in an API.
  3. Discuss how tenant isolation must be enforced across databases, caches, background jobs, and microservices.
  4. Compare RBAC, ABAC, and ReBAC and identify a suitable use case for each.
  5. Design a secure authentication and authorization architecture for a web application and mobile client sharing one API.

Analytical / Application Questions

  1. A user can change tenantId in a request and retrieve another organization’s records. Identify the failure points and propose layered corrections.
  2. A gateway validates a user token, but a downstream service trusts the gateway’s role claim and performs a deletion. Analyze the confused-deputy and least-privilege risks and redesign the flow.
  3. A policy service becomes unavailable during a sensitive financial approval operation. Decide whether the request should proceed, and justify the availability, security, audit, and user-experience consequences.

Multiple Choice Questions with Answers

Question 1

Which statement best distinguishes authentication from authorization?

A. Authentication determines what a user may do, while authorization verifies identity.

B. Authentication verifies identity, while authorization evaluates permitted actions.

C. Authentication encrypts data, while authorization compresses data.

D. Authentication applies only to databases, while authorization applies only to browsers.

Correct Answer: B. Authentication verifies identity, while authorization evaluates permitted actions.

Question 2

Which property is most appropriate for a server-managed session cookie?

A. HttpOnly

B. Stored in a public URL

C. Permanent expiration

D. Readable by frontend scripts

Correct Answer: A. HttpOnly

Question 3

Why is a frontend route guard insufficient as the only authorization control?

A. It prevents HTTPS from working.

B. It cannot improve user experience.

C. A client can be modified or bypassed, so the server must enforce access.

D. It makes database queries slower.

Correct Answer: C. A client can be modified or bypassed, so the server must enforce access.

Question 4

Which token claim identifies the service for which a token is intended?

A. sub

B. iat

C. aud

D. jti

Correct Answer: C. aud

Question 5

What is the principal purpose of refresh-token rotation?

A. To make passwords reversible

B. To detect or limit reuse of stolen refresh credentials

C. To eliminate the need for access tokens

D. To allow tokens to remain valid forever

Correct Answer: B. To detect or limit reuse of stolen refresh credentials

Question 6

Which design best supports tenant isolation?

A. Accepting tenant identity only from a hidden form field

B. Using a trusted membership context and applying tenant scope to every query

C. Using sequential resource identifiers without authorization checks

D. Relying only on the frontend to select the tenant

Correct Answer: B. Using a trusted membership context and applying tenant scope to every query

Question 7

What does a policy decision point do?

A. Stores browser cookies

B. Evaluates an authorization policy

C. Renders a mobile screen

D. Hashes a password for display

Correct Answer: B. Evaluates an authorization policy

Question 8

Which flow protection is especially relevant for mobile public clients using authorization code flow?

A. PKCE

B. FTP

C. CSS isolation

D. Database indexing

Correct Answer: A. PKCE

Question 9

What is a confused deputy?

A. A user who forgets a password

B. A privileged component tricked into misusing its authority

C. A database with duplicate rows

D. A token that has reached its expiry time

Correct Answer: B. A privileged component tricked into misusing its authority

Question 10

What is generally the safest default when a sensitive authorization dependency is unavailable?

A. Grant access to preserve convenience

B. Ignore the resource owner

C. Fail closed and deny the operation

D. Accept any client-supplied role

Correct Answer: C. Fail closed and deny the operation

Authentication & Authorization
Chapter 9 of 15