DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Fix WordPress REST API Auth: Match Credentials to Your Script

Use a logged-in cookie with a REST nonce for same-origin WordPress requests; use an Application Password over HTTPS for external API clients. A nonce is CSRF protection, not authorization.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For authenticated REST API requests from JavaScript running on the same WordPress site as a logged-in user, use the session cookie with a REST nonce. For an external script, scheduled job, or integration, use an Application Password over HTTPS. A nonce helps prevent cross-site request forgery; it is not a login credential or permission to perform an operation.

How cookie authentication with a REST nonce works

In a logged-in WordPress session, the browser’s authentication cookie identifies the user. A same-origin client making an authenticated REST API request supplies a nonce created for the wp_rest action, commonly in the X-WP-Nonce request header. Together, the cookie and nonce support requests in that existing session while helping guard against cross-site request forgery. See WordPress’s REST API authentication guidance.

As an Amazon Associate I earn from qualifying purchases.

The nonce is not what logs the user in: the session cookie authenticates the request. Nor does a nonce grant permission to change data or access a protected endpoint. WordPress states, “Nonces should never be relied on for authentication, authorization, or access control.” The official Nonces handbook, last updated July 23, 2026, also explains that nonces are time-limited, can repeat during their validity window, and do not prevent replay attacks. Endpoints must still check the current user’s capabilities.

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

How Application Passwords work

An Application Password is a separate credential attached to a WordPress user for programmatic access, including REST API clients. It is not the user’s ordinary WordPress password and is not intended to sign a person into wp-login.php. WordPress introduced the feature in version 5.6 in December 2020. The password is generated separately, stored hashed by WordPress, shown only once when created, and can be revoked independently. Read the Application Passwords integration guide.

#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.

Clients commonly send the WordPress username and Application Password using HTTP Basic Authentication in the Authorization header. Basic Authentication does not encrypt credentials, so send it only over HTTPS. Application Passwords are available by default over HTTPS, but site configuration, plugins, or filters can disable the feature or restrict which users can use it. WordPress documents the mechanism and its security considerations in its REST API authentication guidance.

The REST API reference documents endpoints to create, retrieve, update, introspect, and delete Application Password records. A record can include its name, creation date, last-used date, and last IP address; the generated password itself is available only at creation. See the Application Passwords REST API reference.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which method should you use?

Situation Use Why
JavaScript on the same WordPress site, while the user is logged in Cookie plus REST nonce It uses the existing session and provides the nonce used for CSRF protection.
Deployment script, scheduled job, external client, or integration Application Password It is intended for programmatic API access and can be revoked separately from the user’s main password.
Interactive sign-in to WordPress Neither as a login-form substitute Use the site’s normal login process; Application Passwords are not interactive login credentials.
Permission to carry out a protected REST operation Capability and endpoint permission checks Authentication and a valid nonce do not establish that the user is allowed to perform every operation.

WordPress’s integration guidance notes that external applications using the nonce-based pattern need authentication in addition to a nonce. For a standalone integration, use the Application Password flow intended for external API clients rather than treating a nonce as a portable credential.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
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.

Set up an Application Password safely

  1. Confirm support. Check that the site uses HTTPS and that its configuration permits Application Passwords for the intended user. A plugin, filter, or site-level setting may disable them.
  2. Create a dedicated credential. Generate an Application Password for the integration and give it a descriptive name. Separate credentials make it possible to identify and revoke one integration without changing the user’s primary password.
  3. Save the value securely. Copy it when WordPress displays it at creation; it is shown only once. Store it as a secret rather than embedding it in publicly accessible code or logs.
  4. Send it over HTTPS. Use the intended WordPress username and Application Password with HTTP Basic Authentication in the Authorization header. Do not send Basic Authentication credentials over an unencrypted connection.
  5. Check permissions and access. Confirm the authenticated user has the capabilities required by the endpoint. Revoke the Application Password when the integration no longer needs it.

When authentication fails

  • The Application Password is not available: Check HTTPS, site settings, plugins, and filters that may disable Application Passwords or restrict eligible users.
  • The server appears to ignore credentials: If the request includes an Authorization header but WordPress does not authenticate it, check the web server or CGI configuration. Some setups strip the header before WordPress receives it; see the official integration FAQ.
  • A request is authenticated but access is denied: Authentication does not imply authorization. Check the user’s capabilities and the endpoint’s permission checks rather than treating a nonce as an access grant.
  • A request does not need private access: WordPress generally exposes public site data through the REST API without authentication. Private content and restricted data require authentication unless the site has been specifically configured otherwise. See the REST API FAQ.

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 *

Free tools Windows power users keep installed

One-click scans. No signup required.

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.