# oidc-client-console

> OpenID Connect (OIDC) & OAuth2 for console

Latest version **1.0.14** (published 2025-01-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install oidc-client-console
pnpm add oidc-client-console
yarn add oidc-client-console
bun add oidc-client-console
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2025-01-10 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 34.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Furman |
| Maintainers | alexf4dev |
| Keywords | auth, authentication, client, connect, console, identity, pkce, oauth2, oidc, openid |

## Links

- npm: https://www.npmjs.com/package/oidc-client-console
- Repository: https://github.com/AlexF4Dev/oidc-client-js-console
- Issues: https://github.com/AlexF4Dev/oidc-client-js-console/issues
- npm.io page: https://npm.io/package/oidc-client-console

## Dependencies (7)

- [open](https://npm.io/package/open.md) ^10.1.0
- [uuid](https://npm.io/package/uuid.md) ^11.0.5
- [dotenv](https://npm.io/package/dotenv.md) ^16.4.7
- [keytar](https://npm.io/package/keytar.md) ^7.9.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [oidc-client-ts](https://npm.io/package/oidc-client-ts.md) ^3.1.0
- [node-window-polyfill](https://npm.io/package/node-window-polyfill.md) ^1.0.4

## 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.14 (latest) — 2025-01-10
- 1.0.13 — 2025-01-10
- 1.0.12 — 2021-11-10
- 1.0.11 — 2021-08-11
- 1.0.10 — 2021-08-11
- 1.0.9 — 2021-03-10
- 1.0.8 — 2020-12-05
- 1.0.7 — 2020-10-09
- 1.0.6 — 2020-10-04
- 1.0.5 — 2020-10-02
- 1.0.4 — 2020-10-02
- 1.0.3 — 2020-10-02
- 1.0.2 — 2020-10-02
- 1.0.1 — 2020-10-02
- 1.0.0 — 2020-10-02

## README

[![npm package](https://badge.fury.io/js/oidc-client-console.svg)](https://www.npmjs.com/package/oidc-client-console)

# oidc-client-console

The library provides OpenID Connect (OIDC) and OAuth2 protocol support for the console applications. 
The library is an extension for [oidc-client](https://www.npmjs.com/package/oidc-client) to support console applications.

The logged in user is stored encrypted in the user profile directory with the encryption key stored by keytar [keytar](https://www.npmjs.com/package/keytar).


## Install

##### Node.js

Node.js v4.4 or later required.

##### NPM

`npm install oidc-client-console --save`

##### Using LIbrary
The library can be used with any OIDC provider Auth0, Azure AD, Okta, Keyclock etc.


```
const oidcConsole = require('oidc-client-console');

(async function() {
    const user = await oidcConsole.getUser({
        authority: 'https://login.microsoftonline.com/<tenant>/v2.0',
        client_id: '<clientId>',
        response_type: 'code',
        scope: 'openid profile email'
    });
    console.log(JSON.stringify(user));

})();
```

## Global Settings
```
appSettings.appName = 'oidc-console-app'; //default
appSettings.port = 5000; //default
```

## Building the Source

```
git clone https://github.com/AlexF4Dev/oidc-client-console.git
cd oidc-client-console
npm install
npm run build
```

## Running the Sample

create .env file in root folder (Azure example): 

Create application in Azure with http://localhost:5000 callback url
```
AUTHORITY=https://login.microsoftonline.com/<tenant>/v2.0
CLIENT_ID=<clientId>
```

`npm start`

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