0.1.9 • Published 3 years ago

mo-oauth-cli v0.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

mo-oauth-cli

cli usage:

npx mo-oauth-cli \
  --config ./client_secret_something.json \
  --scope https://www.googleapis.com/auth/spreadsheets.readonly \
  --write-token .token.json

api usage:

import * as oauthcli from 'mo-oauth-cli';

const config: oauthcli.Config = {
  "client_id": "..",
  "client_secret": "...",
  "auth_url": "https://accounts.google.com/o/oauth2/auth",
  "token_url": "https://oauth2.googleapis.com/token",
  "redirect_url": "http://localhost:8000/",
};

const token = await oauthcli.getToken(config, {
  scope: args.scope,
  openBrowser: true,
  readCodeFromConsole: false,
});

console.log(token.access_token);
0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago