// use case

Expose your Laravel dev server to the OAuth provider for OAuth callback

OAuth flows demand HTTPS callback URLs registered in advance. Localhost works for some providers but not all (Auth0, Okta, custom SSO often refuse), and a churning ngrok URL breaks the registration. Laravel (PHP) dev server.
  1. Reserve a stable subdomain

    On the lrok free plan you keep one reserved subdomain forever. Pick a name your the OAuth provider dashboard can hold onto — webhook URLs that survive laptop restarts mean fewer dashboard re-pastes.

    $ lrok reserve lar-oauth
      Reserved https://lar-oauth.lrok.io
  2. Run your Laravel app

    Start the dev server on port 8000 (the Laravel default).

    $ php artisan serve
  3. Tunnel localhost to the public URL

    lrok forwards https://lar-oauth.lrok.io/api/webhook → http://127.0.0.1:8000/api/webhook. The flag --hint binds your reserved subdomain to this tunnel.

    $ lrok http 8000 --hint lar-oauth
      Forwarding https://lar-oauth.lrok.io  ->  http://127.0.0.1:8000
  4. Paste the URL into the OAuth provider

    OAuth app settings → Redirect URIs. Paste https://lar-oauth.lrok.io/api/webhook as the destination.

  5. Watch deliveries land in the request inspector

    Every webhook the OAuth provider sends shows up at lrok.io/dashboard with full body, headers, status, and latency. Re-deliver any request to your Laravel handler with one click. Make sure the redirect URI you register matches exactly — protocol, host, path, and trailing slash. Mismatches produce the cryptic "redirect_uri_mismatch" error.

// why lrok for this

lrok's reserved subdomain is free and lives forever, so your the OAuth provider oauth callback URL never rotates. $9/mo flat for unlimited tunnels — no SSO tax, no enterprise-only signature verification, no bandwidth metering. The request inspector is built in.

Related workflows