# passport-firebase-azure-ad

> A modified passport-azure-ad module that allows a user to authenticate and authorise Microsoft Azure-ad accounts using __session cookies whilst working in a firebase environment.

Latest version **1.0.1** (published 2019-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install passport-firebase-azure-ad
pnpm add passport-firebase-azure-ad
yarn add passport-firebase-azure-ad
bun add passport-firebase-azure-ad
```

## 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.1 |
| Published | 2019-03-11 |
| First published | 2019-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.1 |
| Dependencies | 11 |
| Unpacked size | 511.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Johnathan Nicholas, Microsoft |
| Maintainers | j.nicholas |
| Keywords | firebase, auth, authorise, authorize, authenticate, passport, azure, ad, microsoft, graph |

## Links

- npm: https://www.npmjs.com/package/passport-firebase-azure-ad
- Repository: https://github.com/J-Nicholas/passport-firebase-azure-ad
- Homepage: https://github.com/J-Nicholas/passport-firebase-azure-ad#readme
- Issues: https://github.com/J-Nicholas/passport-firebase-azure-ad/issues
- npm.io page: https://npm.io/package/passport-firebase-azure-ad

## Dependencies (11)

- [jws](https://npm.io/package/jws.md) ^3.1.3
- [async](https://npm.io/package/async.md) ^1.5.2
- [oauth](https://npm.io/package/oauth.md) 0.9.14
- [bunyan](https://npm.io/package/bunyan.md) ^1.8.0
- [lodash](https://npm.io/package/lodash.md) ^4.11.2
- [request](https://npm.io/package/request.md) ^2.72.0
- [passport](https://npm.io/package/passport.md) ^0.3.2
- [base64url](https://npm.io/package/base64url.md) ^3.0.0
- [valid-url](https://npm.io/package/valid-url.md) ^1.0.6
- [jwk-to-pem](https://npm.io/package/jwk-to-pem.md) ^1.2.6
- [cache-manager](https://npm.io/package/cache-manager.md) ^2.0.0

## Alternatives

- [@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
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-03-11
- 1.0.0 — 2019-03-11

## README

# Microsoft Azure Active Directory Passport.js Plug-In

---
    
![npm version](https://img.shields.io/npm/v/passport-firebase-azure-ad.svg?style=for-the-badge&logo=appveyor&color=green)


_passport-azure-ad_ is a collection of [Passport](http://passportjs.org/) Strategies 
to help you integrate with Azure Active Directory. It includes OpenID Connect, 
WS-Federation, and SAML-P authentication and authorization. These providers let you 
integrate your Node app with Microsoft Azure AD so you can use its many features, 
including web single sign-on (WebSSO), Endpoint Protection with OAuth, and JWT token 
issuance and validation.

## 1. Installation

    $ npm install passport-firebase-azure-ad

## 2. Usage

This package is intended to allow users to authenticate and authorise Microsoft home, school and work accounts while working in a firebase environment. This is achieved by altering Microsoft's original passport-azure-ad npm package to store the time and encrypted cookie in the "\__session" cookie with the "azure" prefix, current time and date + encrypted cookie as the value. In firebase, cookies can only be titled "\__session" and anything else is removed.  Authenticating and authorising should be unchanged but if you are using firebase, you __must__ have useCookieInsteadOFSession and cookie encrypted keys set in your OIDCStrategy.

```javascript 
passport.use(new OIDCStrategy({
...
...
    useCookieInsteadOfSession: true,
    cookieEncryptionKeys: [
            {key: "12345678901234567890123456789012", iv: "012345678901"}
        ]
...
});
```
Note: __key__ must be a string of length 32 (32 bytes) and __iv__ must be a string of length 12 (12 bytes).

## 3. Full Documentation
Original passport-azure-ad module can be found on github: [Here](https://github.com/AzureAD/passport-azure-ad).
Please refer to this for full documentation on how to utilise passport-azure-ad. Almost everything should apply to this module as I have only made a small modification. 

## 4. Note
I am stil a student and don't have a lot of experience yet and there may be a better way to authorise/authenticate microsoft azure users using vanilla passport-azure-ad and firebase but I struggled to find a solution until I made this. Feel free to contact me about any tips you might have for me or any problems you face using this package. Thank you.

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