Privacy

HTTP 401 or 403 on a website: find the refusing layer before changing access

401 vs 403: a refused page or API request needs a precise access diagnosis. Separate authentication challenges, permission decisions and delivery rules without opening private resources.

Made by Pagember · Editorial policy

Editorial guidancePublished Updated Sources

The short answer

Find which component refused the request before changing access. Record the exact failed action, method, path, status and time, then treat 401 as an authentication problem and 403 as a refusal that may have nothing to do with credentials. Ask an authorized administrator to confirm the responding layer, verify the intended access boundary, and make a narrow change without sharing cookies or authorization headers.

On this page8 sections

A familiar Forbidden message can come from different parts of a website. The useful first question is which request was refused and which component answered it. Giving everyone more access or disabling protection before answering that question can turn a small fault into a real exposure.

Two conceptual access doorways show 401 authentication and 403 access refused, with response context presented as a separate check.

Consider an association portal. A member can read their account page but cannot download a document that their membership should include. A separate integration also receives a refusal. These observations need their own request records; they are not proof of one shared password problem.

Read the status without overinterpreting its name

MDN describes 401 as a request lacking valid authentication credentials, with a WWW-Authenticate response header identifying a challenge. Despite its name, Unauthorized, the immediate protocol issue is authentication. Record the actual header rather than inventing a login method from the wording.

MDN's 403 reference describes a server refusal. RFC 9110 makes the important qualification: refusal can be unrelated to credentials. A 403 therefore does not prove the user successfully logged in or that their application role is the cause.

The status establishes a useful starting distinction, not a complete diagnosis. For the association, retain the public path, action and error time. If a branded error page names a protection service, treat that as a clue about response ownership and confirm it through the responsible operator.

Identify the failed action, not only the visible page

A page can load while a later document or data request fails. Describe what the reader did immediately before the error: open the document, save a change or request a list. The address visible in the browser may not be the address that received the refusal.

Ask an authorized administrator to inspect the particular request through the site's normal diagnostic tools. Preserve the method, destination, response status, safe request identifier and time zone. Do not paste complete authorization headers, cookies, private download links or a browser export into a public support thread.

The access and error log guide explains evidence collection. Use that process to correlate the failed action with the responding layer. A copied message without a timestamp can be difficult to match when several different requests fail near each other.

Build the intended access matrix

JourneyExpected resultComparison to preserve
Signed-out visitor requests member documentPrivate content remains unavailableA public test must not reveal the file
Eligible member requests the same documentApproved document journey succeedsUse the actual membership and route
Member without entitlement requests itClear refusal or supported upgrade pathDo not grant access merely to remove an error
Authorized integration requests its endpointOnly its permitted operation succeedsKeep integration and human login methods separate

Write this expectation with the product owner before changing a rule. Otherwise a successful administrator test can conceal a broken member journey, or a working public URL can conceal an accidentally exposed document. Success means the intended population can perform the intended action.

Use approved test accounts with known permissions in an appropriate test environment. Never try another person's credentials to obtain a contrasting result. If no safe comparison exists, record that limitation and ask the owner to provide a controlled way to verify the boundary.

Trace authentication and permission separately

For an authentication challenge, ask whether the request uses the mechanism that this endpoint actually expects. A signed-in browser and an external integration are different clients. Copying a browser cookie into an integration is not a maintainable repair or a reasonable substitute for its supported authentication route.

The WordPress application-password guide covers one specific integration method. Read it only when the endpoint and platform support that method; an application password is not a universal answer for a member download or a gateway challenge.

For a permission decision, ask the owner to compare the user's approved role, resource ownership and entitlement with the attempted operation. Keep a factual distinction between “the account is recognized” and “the operation is permitted.” A role change should follow a real authorization decision, not an experiment to make a chart turn green.

Find the owner of the refusal

The association's developer can ask whether the request reached the application and whether the application's own log records a decision. If the evidence instead belongs to a delivery or protection layer, hand the request identifier to that operator. State what is known and what still needs correlation.

Do not infer ownership solely from a response design. An operator may need to trace a rule or upstream response. Likewise, a clean application log does not prove an edge service is faulty; it may mean that the relevant request was not included in the captured scope.

Keep recent changes as leads, not verdicts. A deployment, route change or access-policy edit near the incident is worth comparing with the last working version. Preserve the evidence before toggling several unrelated controls, because multiple simultaneous changes make the result harder to explain.

Common causes on a WordPress site

  • Security plugin firewall: a login, form post or REST request matched a blocking rule. The plugin’s blocked-requests or live-traffic log shows the rule and IP; allow the specific request rather than switching the firewall off.
  • Host or CDN firewall: a 403 when saving a post or uploading a file often comes from the host’s web application firewall, such as ModSecurity, or from a CDN rule. The error page design and response headers (for example server: cloudflare) point to the layer. Send the time and URL to that provider.
  • .htaccess rules: on Apache, a line such as Require all denied or Deny from all in the site root, wp-admin or wp-content/uploads refuses every request to that folder. Compare the file with a known-good copy.
  • File permissions: the web server needs read access. WordPress’s file permissions guide describes the usual 755 for folders and 644 for files.
  • A 401 on wp-admin: a browser password prompt before the WordPress login usually means the host’s directory password protection is on. That prompt has its own username and password, separate from WordPress accounts.

For more on reading the logs these checks depend on, use the access and error log guide; if the refusal began after a hack or cleanup, start with the hacked-site first steps.

Repair the smallest supported mismatch

A supported fix might correct an endpoint's client configuration, a documented entitlement or an overly broad rule confirmed by its owner. Record the previous value, the exact scope and the recovery step. Avoid a global exception where the evidence describes one operation.

The temporary access and user-role guide can help plan a scoped investigation account. Access created for troubleshooting should have an owner and an end point. It should not become a permanent administrator account simply because the original diagnosis was inconvenient.

If the request changes data, check whether an earlier attempt actually completed before retrying. A visible refusal in one part of the journey does not establish the state of every preceding action. Ask the application owner to confirm the outcome rather than repeatedly submitting a sensitive operation.

Verify both access and refusal after the change

  1. Repeat the eligible journey using its normal supported client.
  2. Confirm the intended content or operation, not only a different status.
  3. Verify that signed-out and ineligible journeys remain appropriately restricted.
  4. Correlate the new result with the layer and rule that changed.
  5. Remove temporary investigative access and retain a concise recovery record.

Close the issue when the intended boundary is demonstrably correct. Repeated login attempts, a universal administrator role or publicly reachable private content may remove a visible message while leaving the actual product worse.