Socket
Socket
Sign inDemoInstall

browser-google-auth

Package Overview
Dependencies
57
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    browser-google-auth

A simple google authentication that launches browser and return auth token


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Browser-based Google Auth using NodeJS

A simple google authentication workflow that launches browser and return auth token, in the NodeJS script.

How to use

const BrowserGoogleAuth = require('browser-google-auth');
const credPath = __dirname + '/.google_credentials.json'; // required
const tokenPath =  __dirname + '/.google_token.json'; // optional
const scope = [
  'https://www.googleapis.com/auth/spreadsheets',
  'https://www.googleapis.com/auth/drive',
];
BrowserGoogleAuth.setOptions({ tokenPath, credPath, scope });
let auth = await BrowserGoogleAuth.getClient();

Callback URL

Add below callback URL through Google Console

http://localhost:3000/auth/callback

or change it using option parameters { domainRoot, port, callbackPath }

Keywords

FAQs

Last updated on 01 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc