🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

google-oauth-token-generator

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-oauth-token-generator

A simple web-based tool to generate Google OAuth access tokens and refresh tokens

1.0.4
latest
Source
npm
Version published
Weekly downloads
199
9850%
Maintainers
0
Weekly downloads
 
Created
Source

Google OAuth Token Generator

A simple web-based tool to generate Google OAuth access tokens. This tool helps developers quickly obtain OAuth tokens for testing and development purposes.

Installation

# Run directly with npx
npx google-oauth-token-generator

# Or install globally
npm install -g google-oauth-token-generator
google-oauth-token-generator

Features

  • Simple web interface
  • Automatic browser opening
  • Copy-to-clipboard functionality
  • Token information display
  • Support for all Google API scopes
  • Real-time token validation
  • Configurable port number

Usage

  • Run the command:

    # Using default port (2323)
    npx google-oauth-token-generator
    
    # Using custom port
    npx google-oauth-token-generator --port=3000
    
  • The tool will:

    • Start a local server (default port: 2323)
    • Open your default browser automatically
    • Display the setup instructions
  • Follow the on-screen instructions to:

    • Set up your Google Cloud Project
    • Configure OAuth consent screen:
      • Set User Type as "External"
      • Set Publishing Status to "In Production"
      • Fill in required app information
    • Create credentials
    • Generate your token

Port Configuration

  • Default port: 2323
  • To use a different port: --port=<number>
  • Valid port range: 0-65535
  • Example: npx google-oauth-token-generator --port=3000

OAuth Configuration Requirements

  • Publishing Status: Your application must be set to "In Production" in the OAuth consent screen

    • Go to Google Cloud Console → APIs & Services → OAuth consent screen
    • Under "Publishing status", select "In Production"
    • This is required for public access to your application
  • User Type: Must be set to "External"

    • This allows any Google account to authenticate
    • Internal user type is only for Google Workspace users
  • Required Information:

    • Application name
    • User support email
    • Application home page
    • Authorized domains (if needed)
    • Developer contact information

Common Scopes

  • https://www.googleapis.com/auth/userinfo.profile - User profile information
  • https://www.googleapis.com/auth/userinfo.email - User email information
  • https://www.googleapis.com/auth/calendar - Google Calendar access
  • https://www.googleapis.com/auth/drive - Full Google Drive access
  • https://www.googleapis.com/auth/gmail.readonly - Gmail read-only access

For a complete list of available scopes, visit Google OAuth 2.0 Scopes.

Important Notes

  • The application must be run on a web server (localhost is fine for development)
  • You need to configure your Google Cloud Console project properly
  • Some scopes may require verification from Google
  • Always handle tokens securely and never expose them in client-side code
  • Your application must be in "Production" status, not "Testing"
  • Verification may be required for certain sensitive scopes

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Keywords

google

FAQs

Package last updated on 23 Feb 2025

Did you know?

Socket

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