{"library":"passport-http-custom-bearer","title":"passport-http-custom-bearer","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install passport-http-custom-bearer"],"cli":null},"imports":["import CustomBearerStrategy from 'passport-http-custom-bearer'","import Strategy from 'passport-http-custom-bearer'","const CustomBearerStrategy = require('passport-http-custom-bearer')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import passport from 'passport';\nimport CustomBearerStrategy from 'passport-http-custom-bearer';\n\npassport.use('api-bearer', new CustomBearerStrategy(\n  {\n    headerName: 'APIAuth',\n    bodyName: 'api_token',\n    queryName: 'api_token'\n  },\n  (token, done) => {\n    // Replace with actual user lookup\n    if (token === 'valid-token') {\n      return done(null, { id: 1, name: 'John' }, { scope: 'read' });\n    }\n    return done(null, false);\n  }\n));\n\n// Express route example\nimport express from 'express';\nconst app = express();\napp.get('/profile', passport.authenticate('api-bearer', { session: false }), (req, res) => {\n  res.json(req.user);\n});","lang":"typescript","description":"Configures CustomBearerStrategy with custom header/body/query field names and uses it in an Express route.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}