Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 783 Bytes

File metadata and controls

31 lines (22 loc) · 783 Bytes

oauth-example-cli

CLI OAuth example that starts the iRacing browser authorization flow, waits for the callback on localhost, and writes returned credentials to examples/oauth-example-cli/credentials.json.

Usage

  1. Create an .env file in this directory with:
IRACING_AUTH_CLIENT=<your-client-id>
IRACING_AUTH_SECRET=<your-client-secret-if-required>
OAUTH_CALLBACK_PORT=4040
  1. Run:
pnpm --filter iracing-oauth-example-cli start

Optional flags:

pnpm --filter iracing-oauth-example-cli start -- --callback-port 4040 --credentials-path ./credentials.json --timeout-seconds 300
  1. Press Enter in the CLI prompt to open your browser.
  2. Complete sign-in in the browser and return to the CLI.
  3. Find credentials in credentials.json.