Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
google-oauth2-env-vars
Advanced tools
Helper class to generate and cache Google OAuth 2.0
tokens in .env
files:
GOOGLE_OAUTH_CLIENT_ID=23...8o1jm.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=QL...naxL
GOOGLE_PHOTOS_TOKEN={"access_token":"ya..54c","refresh_token":"1..qq0","scope":"https://www.googleapis.com/auth/photoslibrary.readonly","token_type":"Bearer","expiry_date":1598277881619}
Download package from the NPM registry:
yarn add google-oauth2-env-vars
const GoogleOAuth2 = require("google-oauth2-env-vars")
const googleOAuth2 = new GoogleOAuth2({
// .env token var name
token: "GOOGLE_PHOTOS_TOKEN",
// Authorization scope
scope: ["https://www.googleapis.com/auth/photoslibrary.readonly"],
// APIs to enable in Google console
apis: ["photoslibrary.googleapis.com"],
//
// Optional
//
// Port for node server
port: 5000, // DEFAULT
})
const envVars = await googleOAuth2.generateEnvVars()
const GoogleOAuth2 = require("google-oauth2-env-vars")
const googleOAuth2 = new GoogleOAuth2({
// .env token var name
token: "GOOGLE_PHOTOS_TOKEN",
})
const auth = await googleOAuth2.getAuth()
const {token} = await auth.getAccessToken()
const googlePhotos = new GooglePhotos(token)
FAQs
Generate and cache Google OAuth 2.0 tokens in .env files
The npm package google-oauth2-env-vars receives a total of 57 weekly downloads. As such, google-oauth2-env-vars popularity was classified as not popular.
We found that google-oauth2-env-vars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.