# @types/passport-microsoft

> TypeScript definitions for passport-microsoft

Latest version **2.1.1** (published 2025-10-24) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2025-10-24 |
| First published | 2020-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 2.1.1 (latest) — 2025-10-24
- 2.1.0 (ts5.1) — 2025-06-29
- 1.0.3 (ts4.6) — 2023-11-07
- 1.0.0 (ts4.4) — 2023-01-30
- 0.0.0 (ts3.5) — 2020-01-25
- 1.0.2 — 2023-10-18
- 1.0.1 — 2023-09-24

## README

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

// Disable automatic exporting
export {};

// The passport-microsoft library provides defaults for these fields, so they become optional
// when calling the constructor. (No need to export this).
type OptionalOptionParameters = "authorizationURL" | "tokenURL" | "scopeSeparator" | "customHeaders";

interface MicrosoftSpecificStrategyOptions {
    apiEntryPoint: string;
    graphApiVersion: string;
    tenant: string;
}

export type MicrosoftStrategyOptions =
    & Omit<oauth2.StrategyOptions, OptionalOptionParameters>
    & Partial<oauth2.StrategyOptions>
    & Partial<MicrosoftSpecificStrategyOptions>;

export type MicrosoftStrategyOptionsWithRequest =
    & Omit<oauth2.StrategyOptionsWithRequest, OptionalOptionParameters>
    & Partial<oauth2.StrategyOptionsWithRequest>
    & Partial<MicrosoftSpecificStrategyOptions>;

export class Strategy extends oauth2.Strategy {
    constructor(options: MicrosoftStrategyOptions, verify: oauth2.VerifyFunction);
    constructor(options: MicrosoftStrategyOptionsWithRequest, verify: oauth2.VerifyFunctionWithRequest);
}

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/passport-oauth2](https://npmjs.com/package/@types/passport-oauth2)

# Credits
These definitions were written by [Eitan Levi](https://github.com/skrud).

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