# koa-gcp-iap

> A koa middleware to verify requests with the GCP Identity-Aware Proxy

Latest version **1.0.7** (published 2020-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-gcp-iap
pnpm add koa-gcp-iap
yarn add koa-gcp-iap
bun add koa-gcp-iap
```

## 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.7 |
| Published | 2020-12-26 |
| First published | 2020-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | saka1 |
| Maintainers | saka1 |
| Keywords | koa, middleware, auth, authentication |

## Links

- npm: https://www.npmjs.com/package/koa-gcp-iap
- npm.io page: https://npm.io/package/koa-gcp-iap

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^6.0.1

## 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.7 (latest) — 2020-12-26
- 1.0.6 — 2020-09-26
- 1.0.5 — 2020-09-09
- 1.0.4 — 2020-09-08
- 1.0.3 — 2020-09-01
- 1.0.2 — 2020-08-11
- 1.0.1 — 2020-06-24
- 1.0.0 — 2020-06-09

## README

# koa-gcp-iap

![Node.js CI](https://github.com/saka1/koa-gcp-iap/workflows/Node.js%20CI/badge.svg)

A koa middleware to verify requests with the [GCP Identity-Aware Proxy](https://cloud.google.com/iap).

## Install

```sh
npm i koa-gcp-iap
```

## Usage

Insert `iap` middleware before your application.
It needs projectNumber/backendServiceId or projectNumber/projectId, which depends on your runtime environment.

Following application can read `sub` and `email` field from `ctx.iapPayload`.
See <https://cloud.google.com/iap/docs/signed-headers-howto#retrieving_the_user_identity> for more details.

This is a minimal example.

```js
const iap = require("koa-gcp-iap");
const Koa = require("koa");
const app = new Koa();

app.use(
  iap({
    projectNumber: "123456789",
    // projectId: "dummyProjectId",
    backendServiceId: "dummyBackendServiceId",
  })
);

app.use(async (ctx) => {
  ctx.body = `Hello World: ${ctx.iapPayload}`;
});
```

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