Skip to content

Conversation

@maximelb
Copy link
Contributor

Summary

Adds lc-oauth.sh - a portable bash script that performs LimaCharlie OAuth authentication and outputs a JWT to stdout.

Features

  • Cross-platform compatibility: Works on Linux (Debian, Ubuntu, RHEL, Alpine) and macOS
  • Multiple netcat variants: Automatically detects and uses BSD, OpenBSD, GNU, or nmap netcat
  • MFA support: Handles both TOTP (authenticator apps) and SMS verification
  • Browser auto-open: Tries multiple openers (xdg-open, open, wslview, etc.) with manual fallback
  • Clean output: JWT goes to stdout only, all status messages to stderr

Usage

./lc-oauth.sh                    # Authenticate with Google
./lc-oauth.sh -p microsoft       # Authenticate with Microsoft  
./lc-oauth.sh -o abc123-def456   # Get JWT for specific org
./lc-oauth.sh -n                 # Manual browser mode (prints URL)

# Use with curl
JWT=$(./lc-oauth.sh)
curl -H "Authorization: bearer $JWT" https://api.limacharlie.io/v1/...

Dependencies

  • curl
  • netcat (nc, ncat, or netcat)
  • timeout (coreutils) or gtimeout (macOS via Homebrew) or perl

Test plan

  • Test on Linux (Debian/Ubuntu)
  • Test on macOS
  • Test with Google OAuth provider
  • Test with Microsoft OAuth provider
  • Test MFA flow (if account has 2FA enabled)
  • Test --no-browser mode

🤖 Generated with Claude Code

Adds lc-oauth.sh - a cross-platform bash script that performs LimaCharlie
OAuth authentication and outputs a JWT to stdout. Features:

- Works on Linux (Debian, Ubuntu, RHEL, Alpine) and macOS
- Handles multiple netcat variants (BSD, OpenBSD, GNU, nmap)
- Supports MFA (TOTP and SMS)
- Auto-opens browser with manual URL fallback
- Clean stdout/stderr separation for scripting use

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants