Urgent.News

What's breaking now, across thousands of outlets.

Tech

CF7 Bearer Token vs API Key vs Basic Auth: When to Use Which

You are configuring your Contact Form 7 form to send data to an external API. You open the plugin's authentication settings and see three options: Basic Auth, API Key, and Bearer Token. Which one do you choose? The answer depends entirely on what the target API expects. Using the wrong method is one of the most common causes of 401 errors, and it is entirely preventable. This guide explains each…

The article <source>5ebc4064-02d</source> discusses the three methods for configuring authentication when sending data from Contact Form 7 to an external API: Basic Auth, API Key, and Bearer Token. The choice of method depends entirely on the expectations of the target API.

Basic Auth involves encoding a username and password in Base64 and including it in the request header. It is simple and works well for legacy systems or quick testing, but it is not inherently secure as the credentials are not encrypted and can be easily intercepted.

API Key is a static token that identifies an application or account. It can be passed in various ways, such as an Authorization header, custom header, or query parameter. API keys are common for internal APIs and simple integrations but provide authorization without verifying user identity. Store API keys securely in environment variables or configuration files.

Bearer Token is the most common method for modern APIs, typically using JSON Web Tokens (JWT) or OAuth 2.0 access tokens. The token is obtained from the API's authentication endpoint and included in the Authorization header as "Bearer your-token-here". Bearer tokens are standard for OAuth 2.0 flows and are more secure than static API keys, as they expire and require refreshing. However, this method is more complex to implement and may require additional configuration.

The article recommends checking the API documentation to determine the required authentication method. It suggests starting with the simplest method if debugging, then upgrading to a more secure method if needed. Configuring authentication in the plugin involves manually inputting the appropriate header or token in the provided fields.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Integration Digest for September 2026

Articles 🔍 API Features as a First-Class Artifact with OpenAPI Overlays OpenAPI Overlay 1.1 documents model API features as separate, reviewable artifacts: each has metadata, a description, and…

London’s Foundational exits stealth with €9.6 million to track satellites and debris with “millimetre-level” precision

Foundational, a London-based SpaceTech startup developing infrastructure for a more precise understanding of Earth and orbit, has emerged from stealth with €9.6 million (£8.2 million) in pre-Seed…

  • Foundational startup exits stealth with €9.6 million funding
  • Investors include Inflection, BACKED, Final Frontier, Adjacent, and Type One Ventures
  • Company automates Satellite Laser Ranging for millimetre-level precision

I built a chat app solo — rooms, voice/video calls, E2EE, and in-room games

I didn't want to build another messenger. There are plenty. What I wanted was a place where you walk into a room built around a shared interest — movies, music, gaming — and people are just...

  • Developer created PTT Chat in 2021 to enable themed interest-based rooms
  • Features include topic rooms, voice/video calls, E2EE, and in-room games
  • App uses Node.js, Express, Socket.io, SQLite, and WebRTC for calls

More from Thursday 1 October →