
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
http-auth-parser
Advanced tools
This little library is used to parse and put the auth header data at req.auth
. It can currently handle basic
and bearer
authentication types.
This has support for JWT tokens when bearer
auth is being used. The token value will attempt to be parsed by the JWT parser. It ONLY does decode. If you would like to verify the token it is available at req.auth.jwt.token
.
req.auth = {
type: 'basic|bearer',
username: 'username',
password: 'password',
token: 'token',
jwt: {
token: 'rawjwttoken',
claims: 'Object of Claims from Token'
}
}
var authparser = require('http-auth-parser')
var http = require('http');
http.createServer(function (req, res) {
authparser(req)
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(JSON.stringify(req.auth, null, 4));
}).listen(8000, '127.0.0.1');
curl -XGET -H 'Authorization: Bearer mytoken' http://localhost:8000
{
"type": "basic",
"username": "Aladdin",
"password": "open sesame"
}
FAQs
Parses known HTTP headers and places them in req.auth
The npm package http-auth-parser receives a total of 14 weekly downloads. As such, http-auth-parser popularity was classified as not popular.
We found that http-auth-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.