Start Here
Client Quick Start

Quick Start: Connect Client App

Connect your application to Optare ID using standard OAuth 2.0 / OpenID Connect.

Your Domain

https://id.optare.one

Step 1: Create OAuth Client

  1. Go to PortalOAuth Clients.
  2. Click Create OAuth Client.
  3. Enter details:
    • Name: My App
    • Redirect URIs: http://localhost:3000/api/auth/callback/optare (for Next.js)
    • Allowed Origins: http://localhost:3000
  4. Copy the Client ID and Client Secret.

Step 2: Choose Your Framework

Next.js (Recommended)

Using next-auth (Auth.js) is the easiest way to integrate.

1. Install

npm install next-auth

2. Environment (.env.local)

OPTARE_CLIENT_ID=oauth_xxxxxxxxxxxxxxxx
OPTARE_CLIENT_SECRET=secret_xxxxxxxxxxxxxxxx
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-random-secret-key

3. Configure (app/api/auth/[...nextauth]/route.ts)

import NextAuth from "next-auth";
 
export const handler = NextAuth({
  providers: [
    {
      id: "optare",
      name: "Optare",
      type: "oauth",
      wellKnown: "https://id.optare.one/.well-known/openid-configuration",
      clientId: process.env.OPTARE_CLIENT_ID,
      clientSecret: process.env.OPTARE_CLIENT_SECRET,
      authorization: { params: { scope: "openid email profile" } },
      checks: ["pkce", "state"],
      profile(profile) {
        return {
          id: profile.sub,
          name: profile.name,
          email: profile.email,
          image: profile.picture,
        };
      },
    },
  ],
});
 
export { handler as GET, handler as POST };

Next Steps