OAuth 2.0 Error: access_denied (The user or authorization server denied the request)

The authorization request was refused — the user clicked Cancel/Deny on the consent screen, or a policy denied access.

Exact message you may see The user denied accessThe resource owner or authorization server denied the requestError 403: access_denied
Seen on: REST API

Meaning

Providers redirect back with ?error=access_denied. Apart from a real user “No”, it happens when an app in testing mode is used by a non-test user, an admin blocks the app, or the account can’t grant the requested scopes.

Common causes

  • User cancelled or denied consent
  • App in testing mode and user not added as a tester (Google)
  • Organisation policy blocks third-party apps
  • Requested scopes not allowed for this account

⚡ Quick fix

  1. Handle error=access_denied gracefully (show “sign-in cancelled”)
  2. Add test users or publish the OAuth app
  3. Ask the admin to allow the app / reduce scopes

Detailed fix by platform

JavaScript

  1. javascript
    const params = new URLSearchParams(location.search);
    if (params.get("error") === "access_denied") showMessage("Sign-in was cancelled.");

How to diagnose

  1. Callback — error and error_description params
  2. App status — Testing or production?
  3. Admin — Policies?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

401 — 401 Bearer error="invalid_token" (HTTP)401403 — 403 Bearer error="insufficient_scope" (HTTP)403AADSTS65001 — AADSTS65001: The user or administrator has not consented to use the application (Azure)AADSTS65001Access blocked: has not completed the Google verification process — Google OAuth: Error 403: access_denied — The developer hasn't given you access to this app / has not completed the Google verification process (Authentication)Access blocked: has n…auth/account-exists-with-different-credential — Firebase Auth: account exists with a different credential (same email, other provider) (Google Cloud / Firebase)auth/account-exists-w…auth/popup-closed-by-user — Firebase Auth: auth/popup-closed-by-user / auth/popup-blocked / auth/cancelled-popup-request (Authentication)auth/popup-closed-by-…auth/unauthorized-domain — Firebase Auth: auth/unauthorized-domain — This domain is not authorized for OAuth operations for your Firebase project (Authentication)auth/unauthorized-dom…bad_verification_code — GitHub OAuth: {"error":"bad_verification_code","error_description":"The code passed is incorrect or expired."} (Authentication)bad_verification_codeaccess_de…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.