October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Authenticate WordPress REST API Requests Securely

Use a REST nonce with cookie authentication for logged-in same-origin requests, or a dedicated Application Password over HTTPS for remote API clients. Authentication does not replace capability checks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use cookie authentication with a REST nonce for requests from a logged-in user in a same-origin WordPress plugin or theme. For a remote script, app, or integration, use a dedicated Application Password over HTTPS. In either case, authentication identifies the user; WordPress permissions still determine what the user can do.

How do I authenticate WordPress REST API requests?

Choose the method by where the request originates. WordPress documents two built-in approaches: cookie authentication for a logged-in browser context, and Application Passwords for programmatic access from a remote client.

Request origin Use Key condition
Logged-in user in a same-origin plugin or theme WordPress cookie authentication with a nonce for the wp_rest action Send the nonce as X-WP-Nonce for custom requests; the user must have the capability the operation requires.
Remote script, app, or external integration A dedicated Application Password using HTTP Basic authentication Send credentials over HTTPS and store the password securely.
Special external authentication design A reviewed plugin that adds an approach such as OAuth 1.0a Server or JWT Check the plugin’s current maintenance, implementation, and compatibility; WordPress documentation does not establish that any particular plugin is secure or current.

WordPress’s REST API authentication guide, last updated June 4, 2025, describes cookie authentication for logged-in requests. Its Application Passwords guide, last updated January 28, 2026, describes the programmatic credential option. REST API authentication · Application Passwords

How do I send a REST nonce for cookie authentication?

For a request made in a logged-in WordPress context, obtain a nonce for the wp_rest action. WordPress checks it as part of cookie authentication. A custom request should include the value in the X-WP-Nonce header. Without a nonce, WordPress treats the request as unauthenticated even if the user is logged in.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

For plugin and theme code, WordPress recommends using its built-in JavaScript API, which handles nonce delivery. Consult the REST API authentication guide for the documented flow.

How do I use an Application Password with the WordPress REST API?

Application Passwords are user-specific credentials for programmatic access. Create a separate, labeled password for the integration rather than sharing the user’s main account password. WordPress shows the generated password only once; save it securely at creation, and revoke it when it is no longer needed. The feature was introduced in WordPress 5.6 and is available by default when requests are served over HTTPS.

Rank #2
Cryptnox FIDO2 Security Key with MIFARE DESFire NFC Smart Card for 2FA MFA
  • HARDWARE 2FA AND MFA: FIDO Alliance Certified FIDO2 v2.1 with CTAP2 plus legacy U2F and CTAP1 for strong two-factor login and passwordless sign-in on services that support security keys
  • BUILDING ACCESS ON ONE CARD: MIFARE DESFire EV2 4K applet with AES encryption adds office door and physical access control alongside digital authentication
  • CERTIFIED SECURE ELEMENT: An NXP Common Criteria EAL6+ certified secure controller and Java Card platform protects your keys on a tamper-resistant chip
  • DUAL INTERFACE SMART CARD: Contactless NFC ISO 14443 plus ISO 7816 contact reader support in an ISO 7810 ID-1 format that is passive and needs no battery
  • SWISS ENGINEERED DESIGN: Built by Cryptnox as a single card for authentication and access control and backed by a 2 year warranty
  1. In WordPress, open the user’s profile and find the Application Passwords section.
  2. Enter a descriptive label for the integration and generate the password.
  3. Copy and store the password securely; it cannot be retrieved from the profile later.
  4. Send the WordPress username and Application Password using HTTP Basic authentication over HTTPS.

The official guide demonstrates a request to inspect the authenticated user’s account:

curl --user "USERNAME:APPLICATION_PASSWORD" https://example.com/wp-json/wp/v2/users/me

Replace the example host, username, and password with your own. Do not place the credential in public source control, logs, or client-side code. These are practical protections for a reusable secret; HTTPS protects it in transit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Thetis Nano-A FIDO2 Security Key Hardware Passkey Device with USB Type A, TOTP/HOTP, FIDO2.0 Two Factor Authentication 2FA MFA, Works with Windows/mac/iOS/Android/Linux/Gmail/Facebook/GitHub/Coinbase
  • Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
  • USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
  • FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
  • Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
  • Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.

Authentication is not authorization

A valid cookie or Application Password establishes which WordPress user made the request; it does not automatically grant access to every REST API operation or resource. WordPress applies its authentication restrictions, and endpoint permission checks and the user’s capabilities determine what the request may do. Use an account with only the capabilities the integration needs, where the site’s roles and workflow allow it.

A REST nonce is a cross-site request forgery (CSRF) defense, not a substitute for authentication, authorization, or access control. WordPress’s nonce guidance explicitly warns: “Nonces should never be relied on for authentication, authorization, or access control.” Protect sensitive operations with appropriate capability checks. See the WordPress nonce security guide and the REST API FAQ.

Rank #4
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why does my WordPress REST API Authorization header not work?

Check the request and the server path systematically:

  • Confirm HTTPS. Application Passwords are intended to be sent over HTTPS and are available by default when requests are served over HTTPS.
  • Check which password you are using. For Basic authentication, use the Application Password with the WordPress username, not the account’s normal password.
  • Check whether the feature is disabled. Site code or a security plugin may disable Application Passwords.
  • Check header forwarding. CGI or web-server configuration can strip the Authorization header before WordPress receives it. The official FAQ includes examples for forwarding it through Apache and Nginx.
  • For a browser cookie request, check the nonce instead. A logged-in session without a valid X-WP-Nonce is treated as unauthenticated.

See the WordPress REST API FAQ for the Apache and Nginx configuration examples and additional troubleshooting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When should I use OAuth or JWT?

WordPress documentation lists OAuth 1.0a Server and JWT as examples of authentication added by plugins, rather than built-in alternatives equivalent to cookie authentication and Application Passwords. The documentation does not compare the security or current compatibility of individual plugins. Before choosing one, review its present maintenance status, code and configuration, and compatibility with your site. The REST API handbook’s overview provides the broader API context.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5Ă— more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.