rfc7235-parser
v0.1.0
Published
A parser for RFC 7235 HTTP/1.1 Authentication headers
Downloads
15
Maintainers
Readme
rfc7235-parser
A parser for RFC 7235 HTTP/1.1 Authentication headers
Install
$ npm install rfc7235-parser
Usage
const {
parseAuthenticateHeader,
parseAuthorizationHeader
} = require('rfc7235-parser');
const challenges = parseAuthenticateHeader(
'Basic asdQWE==, Digest realm="foo@bar"'
);
console.log(challenges);
// [
// {scheme: 'basic', params: {Encoded: 'asdQWE=='}},
// {scheme: 'digest', params: {realm: 'foo@bar'}}
// ]
const credentials = parseAuthorizationHeader(
'Digest realm="foo@bar", QoP="auth,auth-int"'
);
console.log(credentials);
// {
// scheme: 'digest',
// params: {
// realm: 'foo@bar',
// qop: 'auth,auth-int'
// }
// }
Crafted with ♡ by raphinesse using the nearley parser toolkit.