cuuupid / electron-google-oauth2

A Google OAuth2 module for your Electron app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@getstation/electron-google-oauth2

Library that manages Google OAuth2 authentication for your Electron app.

Install

// npm
$ npm install --save @getstation/electron-google-oauth2
// yarn
$ yarn add @getstation/electron-google-oauth2

Usage

import ElectronGoogleOAuth2 from '@getstation/electron-google-oauth2';

app.on('ready', () => {
  const myApiOauth = new ElectronGoogleOAuth2(
    'CLIENT_ID',
    'CLIENT_SECRET',
    ['https://www.googleapis.com/auth/drive.metadata.readonly']
  );

  myApiOauth.openAuthWindowAndGetTokens()
    .then(token => {
      // use your token.access_token
    });
});

License

MIT

About

A Google OAuth2 module for your Electron app

License:MIT License


Languages

Language:TypeScript 100.0%