# @cumulus/launchpad-auth

> Utilities for authentication with Launchpad

Latest version **22.4.1** (published 2026-09-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @cumulus/launchpad-auth
pnpm add @cumulus/launchpad-auth
yarn add @cumulus/launchpad-auth
bun add @cumulus/launchpad-auth
```

## Health

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

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 22.4.1 |
| Published | 2026-09-14 |
| First published | 2020-04-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.21.1 |
| Dependencies | 6 |
| Unpacked size | 662.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 304 |
| Author | Cumulus Authors |
| Maintainers | cumuluspublisher, nsidc_kovarik, jennyhliu, npauzenga, ppilone84, etcart |
| Keywords | CUMULUS, NASA |

## Links

- npm: https://www.npmjs.com/package/@cumulus/launchpad-auth
- Repository: https://github.com/nasa/cumulus
- Homepage: https://github.com/nasa/cumulus/tree/master/packages/launchpad-auth#readme
- Issues: https://github.com/nasa/cumulus/issues
- npm.io page: https://npm.io/package/@cumulus/launchpad-auth

## Dependencies (6)

- [got](https://npm.io/package/got.md) ^11.8.5
- [uuid](https://npm.io/package/uuid.md) ^11.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [p-retry](https://npm.io/package/p-retry.md) ^4.2.0
- [@cumulus/logger](https://npm.io/package/@cumulus/logger.md) 22.4.1
- [@cumulus/aws-client](https://npm.io/package/@cumulus/aws-client.md) 22.4.1

## Recent versions

- 22.4.1 (latest) — 2026-09-14
- 21.3.5 (release-v21.3.5) — 2026-06-03
- 20.3.3 (release-v20.3.3) — 2026-04-16
- 21.2.1 (release-v21.2.1) — 2026-03-18
- 21.3.2-testlerna.0 (release-v21.3.2-testlerna.0) — 2026-03-02
- 21.3.1-alpha.0 (release-v21.3.1-alpha.0) — 2026-01-28
- 20.3.2 (release-v20.3.2) — 2025-12-04
- 20.2.3 (release-v20.2.3) — 2025-12-03
- 21.0.0-echo10 (release-v21.0.0-echo10) — 2025-11-21
- 20.3.1 (release-v20.3.1) — 2025-10-14
- 20.2.2 (release-v20.2.2) — 2025-10-08
- 20.1.3-alpha.2 (release-v20.1.3-alpha.2) — 2025-05-15
- 20.1.3-alpha.1 (release-v20.1.3-alpha.1) — 2025-05-15
- 20.1.3-alpha.0 (release-v20.1.3-alpha.0) — 2025-05-14
- 18.5.6 (release-v18.5.6) — 2025-04-11
- … 161 more at https://npm.io/package/@cumulus/launchpad-auth/versions

## README

# @cumulus/launchpad-auth

Utilities for authentication by Cumulus using Launchpad.

## Usage

```bash
  npm install @cumulus/launchpad-auth
```

## API

### Modules

<dl>
<dt><a href="#module_launchpad-auth">launchpad-auth</a></dt>
<dd><p>Utility functions for generating, refreshing, and validating Launchpad tokens</p>
</dd>
</dl>

### Classes

<dl>
<dt><a href="#LaunchpadToken">LaunchpadToken</a></dt>
<dd><p>A class for sending requests to Launchpad token service endpoints</p>
</dd>
</dl>

<a name="module_launchpad-auth"></a>

### launchpad-auth
Utility functions for generating, refreshing, and validating Launchpad tokens


* [launchpad-auth](#module_launchpad-auth)
    * [getLaunchpadToken(params, skipLockWait)](#exp_module_launchpad-auth--getLaunchpadToken) ⇒ ⏏
    * [validateLaunchpadToken(params, token, [userGroup])](#exp_module_launchpad-auth--validateLaunchpadToken) ⇒ ⏏

<a name="exp_module_launchpad-auth--getLaunchpadToken"></a>

#### getLaunchpadToken(params, skipLockWait) ⇒ ⏏
Get a Launchpad token. There may be a lock file if the token is being recreated by
a process due to a launchpad 401 auth error, so this function will check if there is one
and wait until it's removed by the process creating the new token, and then will get the
newly made valid token.

**Kind**: Exported function
**Returns**: - the Launchpad token

| Param | Description |
| --- | --- |
| params | the configuration parameters for creating LaunchpadToken object |
| params.api | the Launchpad token service api endpoint |
| params.passphrase | the passphrase of the Launchpad PKI certificate |
| params.certificate | the name of the Launchpad PKI pfx certificate |
| skipLockWait | whether or not to skip waiting for the lock to release |

<a name="exp_module_launchpad-auth--validateLaunchpadToken"></a>

#### validateLaunchpadToken(params, token, [userGroup]) ⇒ ⏏
Validate a Launchpad token

**Kind**: Exported function
**Returns**: The validate result object with:
  status - 'success' or 'failed';
  message - reason for failure;
  session_maxtimeout - number (seconds);
  session_starttime - number (milliseconds);
  owner_auid - string

| Param | Description |
| --- | --- |
| params | the configuration parameters for creating LaunchpadToken object |
| params.api | the Launchpad token service api endpoint |
| params.passphrase | the passphrase of the Launchpad PKI certificate |
| params.certificate | the name of the Launchpad PKI pfx certificate |
| token | the token to be validated |
| [userGroup] | the cumulus user group that a valid user should belong to |

<a name="LaunchpadToken"></a>

### LaunchpadToken
A class for sending requests to Launchpad token service endpoints

**Kind**: global class

* [LaunchpadToken](#LaunchpadToken)
    * [new LaunchpadToken(params)](#new_LaunchpadToken_new)
    * [.requestToken()](#LaunchpadToken+requestToken) ⇒ <code>Promise.&lt;Object&gt;</code>
    * [.validateToken(token)](#LaunchpadToken+validateToken) ⇒ <code>Promise.&lt;Object&gt;</code>

<a name="new_LaunchpadToken_new"></a>

#### new LaunchpadToken(params)

| Param | Type | Description |
| --- | --- | --- |
| params | <code>Object</code> |  |
| params.api | <code>string</code> | the Launchpad token service api endpoint |
| params.passphrase | <code>string</code> | the passphrase of the Launchpad PKI certificate |
| params.certificate | <code>string</code> | the name of the Launchpad PKI pfx certificate |

**Example**
```js
const LaunchpadToken = require('@cumulus/launchpad-auth/LaunchpadToken');

const launchpadToken = new LaunchpadToken({
 api: 'launchpad-token-api-endpoint',
 passphrase: 'my-pki-passphrase',
 certificate: 'my-pki-certificate.pfx'
});
```
<a name="LaunchpadToken+requestToken"></a>

#### launchpadToken.requestToken() ⇒ <code>Promise.&lt;Object&gt;</code>
Get a token from Launchpad

**Kind**: instance method of [<code>LaunchpadToken</code>](#LaunchpadToken)
**Returns**: <code>Promise.&lt;Object&gt;</code> - - the Launchpad gettoken response object
<a name="LaunchpadToken+validateToken"></a>

#### launchpadToken.validateToken(token) ⇒ <code>Promise.&lt;Object&gt;</code>
Validate a Launchpad token

**Kind**: instance method of [<code>LaunchpadToken</code>](#LaunchpadToken)
**Returns**: <code>Promise.&lt;Object&gt;</code> - - the Launchpad validate token response object

| Param | Type | Description |
| --- | --- | --- |
| token | <code>string</code> | the Launchpad token for validation |


## About Cumulus

Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

[Cumulus Documentation](https://nasa.github.io/cumulus)

## Contributing

To make a contribution, please [see our contributing guidelines](https://github.com/nasa/cumulus/blob/master/CONTRIBUTING.md).

---
Generated automatically using `npm run build-docs`

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