Olyron
Developer Documentation

Add Sign in with Olyron to any app

Two API calls. Full OAuth flow. Your users sign in once and get seamless access across every service you build.

How it works

Olyron Identity uses a standard OAuth 2.0 authorization-code flow.

01

Register your app

Head to your Olyron org dashboard → Developer Apps and register a new OAuth client. You'll get an app_key and client_secret.

02

Redirect to Olyron

Send users to the authorize endpoint with your app_key and a redirect URI. If they're not signed in, Olyron handles the entire login flow.

03

Exchange the code

After the user approves, Olyron redirects back with a one-time code. POST it to the token endpoint with your client_secret to get the user profile.

Step 1 — Redirect to Olyron

sign-in-button.tsx
// Build the authorize URL
const OLYRON_URL = "https://accounts.olyron.com";
const params = new URLSearchParams({
  app_key: "your-app-key",
  redirect_uri: "https://yourapp.com/auth/callback",
  state: crypto.randomUUID(), // CSRF protection
});

// Redirect the user
window.location.href =
  `${OLYRON_URL}/api/sso/authorize?${params}`;

Step 2 — Exchange the code (server-side)

auth/callback/route.ts
// In your callback handler
const res = await fetch(
  "https://accounts.olyron.com/api/sso/token",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      code: searchParams.get("code"),
      app_key: "your-app-key",
      client_secret: process.env.OLYRON_CLIENT_SECRET,
    }),
  }
);

const { user } = await res.json();
// user = { id, email, full_name, avatar_url }

// Create a session in your app
await createSession(user);

Token response shape

200 OK — application/json
{
  "user": {
    "id": "a1b2c3d4-...",
    "email": "user@example.com",
    "full_name": "Jane Doe",
    "avatar_url": "https://..."
  }
}

Why build on Olyron Identity

Enterprise-grade auth

MFA, session management, and brute-force protection handled for you.

Org-aware tokens

JWTs carry organization context and RBAC roles out of the box.

5-minute integration

Two API calls — authorize and token. No SDK required.

Secret rotation

Rotate client secrets instantly from the dashboard with zero downtime.

Ready to integrate?

Create an Olyron account, register your app, and start accepting "Sign in with Olyron" in under five minutes.