Fixing Clio OAuth2 in n8n: Resolving 'Invalid key=value pair' Authorization Errors
An 'Invalid key=value pair (missing equal-sign) in Authorization header' error when using Generic OAuth2 with Clio usually stems from incorrect header formatting-often an Authorization header being hashed/encoded unexpectedly or the node sending a header Clio doesn't expect. The solution is to ensure the request uses a proper Bearer token and to avoid double-encoding or duplicate Authorization headers.
The error message quoting a Base64-like string suggests the Authorization header content is not in the form Clio expects. Clio's APIs expect standard OAuth2 semantics (Authorization: Bearer ) for API calls. Problems arise when a generic OAuth connector either: 1) sends an encoded or hashed header instead of a Bearer token, 2) duplicates the Authorization header (one from the credential and one manually set), or 3) includes characters that Clio's parser rejects because they don't conform to a key=value pair format when a custom auth scheme is used.
Start troubleshooting by inspecting the exact HTTP request n8n sends. Use n8n's request logging, a proxy (e.g., mitmproxy), or check Clio's API request logs. Confirm the token exchange response contains an access_token and that the call sets Authorization: Bearer . If the Generic OAuth2 credential is configured to add a header manually, remove any extra Authorization headers and let the node handle Bearer injection. If the token contains characters that cause issues, ensure it is not double-encoded and that you're not unintentionally hashing the token in a pre-request step.
If Clio requires a custom auth format (rare), switch to a Generic Credential with a manual header and construct the exact Authorization header Clio requires. Another pragmatic workaround is using an HTTP Request node with explicit headers after obtaining the token manually to control the exact Authorization value. Also validate the OAuth client configuration (redirect_uri, scopes) and check for middleware or proxies that might rewrite headers.
For leaders: API integrations frequently fail on subtle protocol or header mismatches. Encourage teams to add integration tests, capture request/response logs during onboarding, and maintain runbooks for common OAuth failure modes. When integrations are business-critical, consider vendor-supported SDKs or managed connectors to reduce operational risk and accelerate support.
Original Source
n8n Community
