1.1.1 • Published 10 months ago

@daisycon/oauth-cli-client v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Daisycon oAuth CLI client

Installation

Using yarn

yarn add @daisycon/oauth-cli-client

Using npm

npm install @daisycon/oauth-cli-client

Usage in your code

To start the oAuth request in your initial starting page add the following snippit

import {OauthService, PkceService} from '@daisycon/oauth-cli-client';

const oAuthService: OauthService = new OauthService(new PkceService());
oAuthService.startAuthorizationRequest(YOUR_CLIENT_ID, YOUR_AUTHORIZED_REDIRECT_URI);

Then on the authorized redirect URI add the following snippet. Then store the returned tokens somewhere safe.

import {AccessTokenResponseInterface, OauthService, PkceService} from '@daisycon/oauth-cli-client';

const oAuthService: OauthService = new OauthService(new PkceService());
const accessTokens: AccessTokenResponseInterface = oAuthService.startAccessTokenExchange(YOUR_CLIENT_ID, YOUR_AUTHORIZED_REDIRECT_URI);
console.log(accessTokens);

Running as CLI script

After installation, you can run the client as follows

npx daisycon-oauth-cli --clientId=CLIENT_ID --clientSecret=CLIENT_SECRET --outputFile="./tokens.json"
1.1.1

10 months ago

1.1.0

10 months ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago