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

import passport = require("passport");
import express = require("express");
import koa = require("koa");

interface IStrategyOptions {
    scope?: string | string[] | undefined;
    realm?: string | undefined;
    passReqToCallback?: boolean | undefined;
}
interface IVerifyOptions {
    message?: string | undefined;
    scope?: string | string[];
}

interface VerifyFunction {
    (token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}

interface IKoaContextContainer {
    ctx: koa.Context;
}
type KoaPassportExpressRequestMock = Partial<express.Request> & IKoaContextContainer;

interface VerifyFunctionWithRequest {
    (
        req: express.Request,
        token: string,
        done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
    ): void;
}
interface VerifyFunctionWithContext {
    (
        req: KoaPassportExpressRequestMock,
        token: string,
        done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
    ): void;
}

type VerifyFunctions =
    | VerifyFunction
    | VerifyFunctionWithRequest
    | VerifyFunctionWithContext;

declare class Strategy<T extends VerifyFunctions> implements passport.Strategy {
    constructor(verify: VerifyFunction);
    constructor(options: IStrategyOptions, verify: T);

    name: string;
    authenticate(req: express.Request, options?: Object): void;
}

````

### Additional Details
 * Last updated: Tue, 23 Sep 2025 23:32:05 GMT
 * Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/koa](https://npmjs.com/package/@types/koa), [@types/passport](https://npmjs.com/package/@types/passport)

# Credits
These definitions were written by [Isman Usoh](https://github.com/isman-usoh).
