# @atlassian/atlassian-oauth2

> Atlassian Connect OAuth2 library

Latest version **0.9.0** (published 2025-08-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @atlassian/atlassian-oauth2
pnpm add @atlassian/atlassian-oauth2
yarn add @atlassian/atlassian-oauth2
bun add @atlassian/atlassian-oauth2
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2025-08-28 |
| First published | 2025-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Seb Ruiz |
| Maintainers | atlassianartifactteam |
| Keywords | atlassian, oauth |

## Links

- npm: https://www.npmjs.com/package/@atlassian/atlassian-oauth2
- Repository: http://bitbucket.org/atlassian/atlassian-oauth2-js
- npm.io page: https://npm.io/package/@atlassian/atlassian-oauth2

## Dependencies (3)

- [rsvp](https://npm.io/package/rsvp.md) ^4.8.4
- [request](https://npm.io/package/request.md) ^2.88.2
- [@atlassian/atlassian-jwt](https://npm.io/package/@atlassian/atlassian-jwt.md) ^2.2.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

- 0.9.0 (latest) — 2025-08-28
- 0.8.0 — 2025-07-04
- 0.7.0 — 2025-06-27
- 0.6.0 — 2025-05-19
- 0.5.1 — 2025-05-15

## README

# atlassian-oauth2

A node module which facilitates the exchange of an add-ons JWT token for an OAuth 2 bearer token,
following the [RFC-7521](https://tools.ietf.org/html/rfc7521) and [RFC-7523](https://tools.ietf.org/html/rfc7523)
specifications.

## Install

```bash
npm i @atlassian/atlassian-oauth2
```

## Usage

```javascript
var oauth2 = require('@atlassian/atlassian-oauth2');

var options = {
    hostBaseUrl: 'https://instance.atlassian.net',
    oauthClientId: '{oauth client id your add-on was given at installation}',
    sharedSecret: '{the shared secret your add-on was given at installation}',
    userKey: '{the userkey of the user to retreive the token for}',
    scopes: ['{an array of scopes requested}']
};

oauth2.getAccessToken(options).then(function (token) {
    console.log(token);
    // token.access_token = '{your access token}'
    // token.expires_in = '{expiry time}'
    // token.token_type = 'Bearer'
});
```

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