# @types/passport-http

> TypeScript definitions for passport-http

Latest version **0.3.11** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/passport-http
pnpm add @types/passport-http
yarn add @types/passport-http
bun add @types/passport-http
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.11 |
| Published | 2023-11-07 |
| First published | 2016-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51436 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/passport-http
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-http
- npm.io page: https://npm.io/package/@types/passport-http

## Dependencies (2)

- [@types/express](https://npm.io/package/@types/express.md) *
- [@types/passport](https://npm.io/package/@types/passport.md) *

## Recent versions

- 0.3.11 (latest) — 2023-11-07
- 0.3.9 (ts3.6) — 2021-07-08
- 0.3.8 (ts2.3) — 2019-05-06
- 0.3.2 (ts2.0) — 2016-11-04
- 0.3.10 — 2023-10-18
- 0.3.7 — 2018-12-25
- 0.3.6 — 2018-04-03
- 0.3.5 — 2018-02-15
- 0.3.4 — 2018-02-08
- 0.3.3 — 2017-10-25
- 0.3.1 — 2016-11-01

## README

# Installation
> `npm install --save @types/passport-http`

# Summary
This package contains type definitions for passport-http (https://github.com/jaredhanson/passport-http).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-http.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-http/index.d.ts)
````ts
import passport = require("passport");
import express = require("express");

export interface BasicStrategyOptions<req extends boolean = boolean> {
    realm?: string | undefined;
    passReqToCallback?: req | undefined;
}

export interface DigestStrategyOptions {
    realm?: string | undefined;
    domain?: string | string[] | undefined;
    opaque?: string | undefined;
    algorithm?: string | undefined;
    qop?: string | string[] | undefined;
}

export interface DigestValidateOptions {
    nonce: string;
    cnonce: string;
    nc: number;
    opaque: string;
}

export type BasicVerifyFunction = (
    username: string,
    password: string,
    done: (error: any, user?: any) => void,
) => any;

export type BasicVerifyFunctionWithRequest = (
    req: express.Request,
    username: string,
    password: string,
    done: (error: any, user?: any) => void,
) => any;

export type DigestSecretFunction = (
    username: string,
    done: (error: any, user?: any, password?: any) => void,
) => any;

export type DigestValidateFunction = (
    params: DigestValidateOptions,
    done: (error: any, valid: boolean) => void,
) => any;

export class BasicStrategy implements passport.Strategy {
    constructor(verify: BasicVerifyFunction);
    constructor(options: BasicStrategyOptions<false>, verify: BasicVerifyFunction);
    constructor(options: BasicStrategyOptions<true>, verify: BasicVerifyFunctionWithRequest);

    name: string;
    authenticate(req: express.Request, options?: object): void;
}

export class DigestStrategy implements passport.Strategy {
    constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction);
    constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction);

    name: string;
    authenticate(req: express.Request, options?: object): void;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/passport](https://npmjs.com/package/@types/passport)

# Credits
These definitions were written by [Christophe Vidal](https://github.com/krizalys), [Tomek Łaziuk](https://github.com/tlaziuk), [Chris Barth](https://github.com/cjbarth), and [James Adarich](https://github.com/jamesadarich).

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