Skip to content

🌐 Web Integration Track ​

The fastest path to integrating logi in server-side web apps like Next.js, Rails, and Express.

Is this the right track?

The four core promises ​

  1. Confidential client + client_secret held server-side. Never expose it in the browser bundle.
  2. redirect_uri is https://... or http://localhost β€” the server callback route path.
  3. Verify state + nonce and issue the session with HttpOnly + Secure cookies.
  4. Keep the app RP and the web RP separate β€” details: Common / Public Clients Β· One RP per surface

Step 1 Β· Register the app ​

Email verification required before registering an app (RP)

Before you can register an app (RP) in the developer console, you must verify your email. After signing up, click the link in the verification email, or resend it from the console at /account. Registration is blocked until you verify. β†’ App registration guide Β· Prerequisite

  • SPA / client-side β†’ register the RP with client_type: public (PKCE-only, no secret).

  • Server-side (Next.js / Rails / Express) β†’ register the RP with client_type: confidential β†’ you get a client_id + client_secret.

  • App registration guide

  • Choosing Public vs Confidential

Step 2 Β· Integration patterns ​

For a pure SPA (token exchange directly in the browser, with no backend callback), use the official SDK @logi-auth/browser@0.1.0:

bash
npm install @logi-auth/browser
ts
import { LogiAuth } from '@logi-auth/browser';

const auth = new LogiAuth({
  clientId: 'logi_xxx',
  redirectUri: window.location.origin + '/auth/callback',
});

// Page A β€” start login
await auth.signIn();

// Page B β€” callback page
const tokens = await auth.handleCallback();

For the full API and error classification β†’ SPA Quickstart

Server-side (Next.js / Rails / Express) ​

Hold client_secret on the server and handle the callback there. logi provides standard OIDC discovery (https://api.1pass.dev/.well-known/openid-configuration), so general OIDC libraries β€” oauth4webapi, openid-client, next-auth, auth.js β€” configure themselves automatically from issuer: 'https://api.1pass.dev' alone.

StackGuideCore
Next.js (App Router)integrations/nextjsRoute Handler + iron-session pattern
Rails 8integrations/railsDirect OAuth client (no omniauth). ⚠️ With Hotwire/Turbo, data-turbo="false" is required
Express.jsintegrations/expresscookieParser + crypto PKCE

Step 3 Β· Avoid the web-specific pitfalls ​

⚠️ When adding a web surface to an existing mobile RP, you must update the redirect_uri whitelist

When a single client_id is shared by a mobile app and a web surface (safe for a public + PKCE RP), the web callback URL must also be explicitly registered in the RP's redirect_uris whitelist. If it's missing, logi rejects the request immediately:

json
{ "error": "invalid_request", "error_description": "redirect_uri not registered" }

Before you start the web build, always:

bash
# check the currently registered whitelist
logi app show $CLIENT_ID
# if missing, add it (existing URIs are kept; this appends)
logi app update $CLIENT_ID --add-redirect-uri "https://app.example.dev/auth/1pass/callback"
# if you have preview/staging domains, register them too
logi app update $CLIENT_ID --add-redirect-uri "https://preview.example.dev/auth/1pass/callback"
# verify
logi apps verify $CLIENT_ID -r "https://app.example.dev/auth/1pass/callback"

This pitfall commonly happens "when bolting a new web flow onto an RP that was already registered for mobile." For a new RP, register the callbacks for every surface up front in the redirect_uris array of the App registration guide.

Step 4 Β· Pre-build checks ​

Common reference (track-agnostic) ​


Hand the whole thing to an AI ​

Paste @/llms-full.txt into Claude Code, Cursor, or Codex, then say:

"Integrate logi 1pass as an RP into my [Next.js / Rails / Express] web app, using a confidential client + a server-held secret."

β†’ It generates the env, route, controller, callback handler, and login button UI automatically.

Identityκ°€ μ œν’ˆμ˜ μ‹ λ’°λ₯Ό λ§Œλ“­λ‹ˆλ‹€.