Passport strategy for HTTP Bearer authentication using custom header, body field, or query parameter names (rather than the standard Authorization header). Version 1.0.15 is the latest stable release; the package sees infrequent updates. It forks passport-http-bearer to allow configurable field names like X-APIAuth or api_token. Key differentiator: flexibility for non-standard token placements, commonly used in legacy or custom API gateway setups. Supports Node >=0.4.0 and works with Express/Connect-style middleware.
npm install passport-http-custom-bearerVerified import paths — ran on the pinned version, not inferred.
Configures CustomBearerStrategy with custom header/body/query field names and uses it in an Express route.
If you want an exact header name without prefix, set headerName to include 'X-' yourself or use a workaround.
Always specify a custom name like 'api-bearer' to avoid confusion.
Use passport.authenticate with a custom callback and delete req.query[info.queryName] or req.body[info.bodyName].
Use Passport 0.6.x or test with newer versions carefully.
Use `import CustomBearerStrategy from 'passport-http-custom-bearer'` (no curly braces).
Run `npm install passport-http-custom-bearer` and verify package.json.
Ensure client sends token in the expected header (e.g., X-APIAuth), body field (api_token), or query parameter (api_token).