Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auth-header

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-header

For HTTP `Authorization` and `WWW-Authenticate` headers.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
157K
increased by5.37%
Maintainers
1
Weekly downloads
 
Created

What is auth-header?

The auth-header npm package is a utility for parsing and creating HTTP Authorization headers. It simplifies the process of handling authentication headers in HTTP requests, making it easier to work with various authentication schemes.

What are auth-header's main functionalities?

Parse Authorization Header

This feature allows you to parse an Authorization header string into an object. The example demonstrates parsing a Basic Auth header.

const authHeader = require('auth-header');
const header = 'Basic dXNlcjpwYXNz';
const parsed = authHeader.parse(header);
console.log(parsed);

Create Authorization Header

This feature allows you to create an Authorization header string from a scheme and token. The example demonstrates creating a Basic Auth header.

const authHeader = require('auth-header');
const header = authHeader.create('Basic', 'dXNlcjpwYXNz');
console.log(header);

Check Authorization Scheme

This feature allows you to check if an Authorization header uses a specific scheme. The example demonstrates checking if the header uses the Basic scheme.

const authHeader = require('auth-header');
const header = 'Basic dXNlcjpwYXNz';
const isBasic = authHeader.is(header, 'Basic');
console.log(isBasic);

Other packages similar to auth-header

Keywords

FAQs

Package last updated on 21 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc