全部搜尋項
bullseye  ] [  bookworm  ] [  trixie  ] [  sid  ]
[ 原始碼: node-basic-auth  ]

套件:node-basic-auth(2.0.1-4)

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。9 kB21。0 kB [檔案列表]