全部搜索项
bullseye  ] [  bookworm  ] [  trixie  ] [  sid  ]
[ 源代码: node-basic-auth  ]

软件包:node-basic-auth(2.0.1-2)

node-basic-auth 的相关链接

Screenshot

Debian 的资源:

下载源码包 node-basic-auth

维护小组:

外部的资源:

相似软件包:

Generic basic auth Authorization header field parser for whatever

nodejs basic auth parser module. This package is used as a dependency for node web applications that require a simple authentication mechanism.

API

var auth = require('basic-auth')

auth(req)

Get the basic auth credentials from the given request. The Authorization header is parsed and if the header is invalid, undefined is returned, otherwise an object with name and pass properties.

auth.parse(string)

Parse a basic auth authorization header string. This will return an object with name and pass properties, or undefined if the string is invalid.

Example

Pass a Node.js request object to the module export. If parsing fails undefined is returned, otherwise an object with .name and .pass.

var auth = require('basic-auth') var user = auth(req) // => { name: 'something', pass: 'whatever' }

A header string from any other location can also be parsed with auth.parse, for example a Proxy-Authorization header:

var auth = require('basic-auth') var user = auth.parse(req.getHeader('Proxy-Authorization'))

其他与 node-basic-auth 有关的软件包

  • 依赖
  • 推荐
  • 建议
  • 增强

下载 node-basic-auth

下载可用于所有硬件架构的
硬件架构 软件包大小 安装后大小 文件
all 5.6 kB21.0 kB [文件列表]