Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober 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 PC×
Skip to content
World desk5 min

Jenkins cURL POST Returns 403: Fix Crumbs, Authentication, and Project Permissions

A Jenkins cURL POST can fail because of missing authentication, CSRF protection, or insufficient job permissions. Use an API token or send the matching crumb and cookie, then verify the endpoint and authorization.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Jenkins cURL POST can return 403 Forbidden even when the request reaches the server because Jenkins may reject its authentication, require a CSRF crumb for password-based requests, or deny the user permission to change that job or project. For scripted clients, use a Jenkins API token as the password in Basic authentication; if you use a password instead, send both the crumb and its matching session cookie.

Why Jenkins returns 403 for a cURL POST

A 403 is not enough to identify the cause. Jenkins may return it when the client omits preemptive authentication, a password-authenticated POST lacks valid CSRF protection, or the authenticated user lacks permission for the requested operation. Jenkins documents that it does not negotiate authentication: it can return 403 immediately, so send credentials with the initial request. See the Jenkins Project’s Authenticating scripted clients and CSRF Protection documentation.

As an Amazon Associate I earn from qualifying purchases.

Authentication establishes who the user is; authorization determines what that user may do on the target object. A successful login, or a successful GET, does not prove the user can update project security. Jenkins checks the permission required for the requested operation against the configured authorization strategy. The Jenkins Project explains this distinction in its Access Control documentation.

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.

Try the API-token POST first

For scripted requests, Jenkins recommends using a user’s API token in place of the password. API-token-authenticated requests are exempt from Jenkins CSRF crumb protection, so this avoids the crumb-and-cookie exchange. The token does not grant extra permissions: the account still needs the permission for the operation on the target job or project.

#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.
curl -u 'USER:API_TOKEN' 
  -X POST 
  'https://jenkins.example.com/job/JOB/build'

Replace the example host, user, token, and job path with your values. For a job in a folder, include the folder path in Jenkins’ URL format, such as /job/FOLDER/job/JOB/; URL-encode names containing characters that have special meaning in a URL. Use your actual Jenkins root URL, including any context path, rather than assuming Jenkins is installed at the domain root.

For a project-security or configuration change, use the POST endpoint appropriate to that operation; the build endpoint above is only an example. A successful POST to one endpoint does not establish that the user is authorized for another.

Rank #2
Yubico - YubiKey 5C NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

If you use a password, send the crumb and cookie together

Jenkins POST requests generally require a crumb when authenticated with a username and password. Request the crumb first while saving the response cookie, then send the returned crumb request-field header and that same cookie with the POST. A crumb without its associated session cookie may be rejected.

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.

The following example uses jq to read the JSON fields returned by Jenkins’ crumb issuer:

Rank #3
Yubico - YubiKey 5 NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-A or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
curl -u 'USER:PASSWORD' 
  -c cookies.txt 
  'https://jenkins.example.com/crumbIssuer/api/json' 
  -o crumb.json

CRUMB_HEADER=$(jq -r '.crumbRequestField + ":" + .crumb' crumb.json)

curl -u 'USER:PASSWORD' 
  -b cookies.txt 
  -H "$CRUMB_HEADER" 
  -X POST 
  'https://jenkins.example.com/job/JOB/build'

Keep the root URL, credentials, and target path consistent across both requests. Treat the cookie file, crumb response, and credentials as sensitive; remove temporary files when finished. If the crumb request itself returns an error, resolve its URL, authentication, or proxy issue before retrying the POST. Jenkins’ CSRF documentation describes the crumb issuer API and the need to send the crumb with the cookie.

Choose the fix that matches the request

Authentication method CSRF handling What it does not solve
Username and API token using Basic authentication Jenkins exempts API-token-authenticated requests from crumb protection. Missing permission, incorrect endpoint, or wrong job path.
Username and password using Basic authentication Fetch a crumb and retain the matching session cookie; send both with the POST. Missing permission, incorrect endpoint, or wrong job path.

Check the URL and authentication before changing permissions

  1. Verify the Jenkins root URL. Use the same scheme, host, port, and any configured context path that you use to reach Jenkins. Account for a reverse proxy if it changes the public URL.
  2. Check the target with a harmless authenticated GET. Request a page or API endpoint for the intended job using the same user and API token. Confirm that the response identifies the expected Jenkins instance and job rather than a login page, proxy response, or different path.
  3. Send credentials on the first request. Use curl -u 'USER:API_TOKEN' rather than relying on an authentication challenge. Jenkins documents that scripted clients should use preemptive authentication.
  4. Verify folder and job names. Nested jobs require the correct repeated /job/NAME path segments. Encode reserved characters in names. A 404 more often points to a wrong URL or path than to a permission problem.
  5. Account for the proxy and crumb issuer. A reverse proxy or plugin-provided crumb issuer can affect the reachable URL or crumb flow. Ensure the crumb request and POST go through the intended Jenkins address and preserve the session cookie.

Confirm the exact permission for project security

Once the endpoint and authentication are sound, check the permission required by the specific action. Jenkins authorization strategies can grant access globally or, with Matrix-based or Project-based Matrix Authorization Strategy, at the project level. Whether a project can use its own access-control list depends on the configured strategy.

Rank #4
Yubico - Security Key NFC - Basic Compatibility - Multi-Factor Authentication (MFA) Key, Connect via USB-A or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key 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 NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A 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.

Ask a Jenkins administrator to inspect the effective permissions for the account on the target job or project, including inherited or global grants where applicable. Do not assume that permission to view or build a job includes permission to configure it or change its security settings. The necessary permission depends on the operation and authorization configuration; there is no single permission rule that applies to every Jenkins installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use the response to narrow down the failure

  • 403 on the crumb request: Check whether credentials are sent preemptively, the user is valid, and the crumb issuer URL is correct. Review Jenkins or proxy logs if the response remains unclear.
  • 403 on the POST with password authentication: Confirm that the crumb header came from the current crumb response and that the POST reuses the corresponding cookie file. Alternatively, use an API token.
  • 403 on the POST with an API token: Crumb handling is not the likely blocker for an API-token-authenticated request. Check that the token belongs to the intended user and that the user has the permission required for that action on that project.
  • 404: Recheck the Jenkins root URL, context path, folder/job segments, endpoint, and URL encoding.
  • Unexpected redirects or HTML instead of the expected response: Check whether the request is reaching the right Jenkins instance through the proxy and whether the URL points to the expected endpoint.

Inspect the HTTP status and Jenkins logs for the relevant request. Do not disable CSRF protection to make a script work: Jenkins recommends keeping it enabled, including on private trusted networks. Fix the request’s authentication and crumb handling instead.

Best Value
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.

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 *

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
Crashes, No Sound, or Screen Glitches?Free driver scan
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.