# http-auth-connect

> Connect framework integration with http-auth module.

Latest version **1.0.6** (published 2022-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-auth-connect
pnpm add http-auth-connect
yarn add http-auth-connect
bun add http-auth-connect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2022-09-21 |
| First published | 2020-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Gevorg Harutyunyan |
| Maintainers | gevorg |
| Keywords | connect, http, basic, digest, access, authentication |

## Links

- npm: https://www.npmjs.com/package/http-auth-connect
- Repository: https://github.com/http-auth/http-auth-connect
- Issues: http://github.com/http-auth/http-auth-connect/issues
- npm.io page: https://npm.io/package/http-auth-connect

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2022-09-21
- 1.0.5 — 2021-06-24
- 1.0.4 — 2020-02-03
- 1.0.3 — 2020-02-03
- 1.0.2 — 2020-02-02
- 1.0.1 — 2020-02-02
- 1.0.0 — 2020-02-02

## README

# http-auth-connect
[Connect](https://github.com/senchalabs/connect) integration with [http-auth](https://github.com/gevorg/http-auth) module.

[![build](https://github.com/http-auth/http-auth-connect/workflows/build/badge.svg)](https://github.com/http-auth/http-auth-connect/actions/workflows/build.yml)

## Installation

Via git (or downloaded tarball):

```bash
$ git clone git://github.com/http-auth/http-auth-connect.git
```
Via [npm](http://npmjs.org/):

```bash
$ npm install http-auth-connect
```    

## Usage
```javascript
// Express module.
// eslint-disable-next-line node/no-unpublished-require
const express = require("express");

// Authentication module.
// eslint-disable-next-line node/no-unpublished-require
const auth = require("http-auth");
// eslint-disable-next-line node/no-unpublished-require
const authConnect = require("http-auth-connect");

const basic = auth.basic({
  realm: "Simon Area.",
  file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass
});

// Application setup.
const app = express();
app.use(authConnect(basic));

// Setup route.
app.get("/", (req, res) => {
  res.send(`Hello from express - ${req.user}!`);
});

// Start server.
app.listen(1337, () => {
  // Log URL.
  console.log("Server running at http://127.0.0.1:1337/");
});
```


## Running tests

It uses [mocha](https://mochajs.org/), so just run following command in package directory:

```bash
$ npm test
```

## License

The MIT License (MIT)

---
_Source: https://npm.io/package/http-auth-connect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
