DEV Community

Cover image for We built our own "Sign in with Google" and opened it to every developer
Zeno Innovations
Zeno Innovations

Posted on AI-assisted

We built our own "Sign in with Google" and opened it to every developer

We run Zeno Innovations: hosting for websites and servers, Discord bots (JARVIS), an AI app, a Chrome extension and a webshop. Every one of them needed accounts, so we built Zeno ID: one account for all of it, like an Epic Games account.

Then we asked ourselves why we should keep it to our own apps. Zeno ID is now a full OpenID Connect provider, so any developer can add a "Sign in with Zeno ID" button to their app, the same way they'd add Google or GitHub.

Here's how to add it to a Supabase project. It takes about 5 minutes.

1. Start a custom provider in Supabase

Supabase supports custom OIDC providers. In your project go to:

Authentication → Sign In / Providers → Custom Providers → New Provider → Auto-discovery (OIDC)

  • Identifier: custom:zeno-id
  • Issuer URL: https://id.zeno-innovations.com

Copy the Callback URL it shows. It looks like https://<project>.supabase.co/auth/v1/callback.

2. Register your app

Go to Zeno ID apps, click Register an app, paste the callback URL as the return address and choose Server app. You get a client ID and a client secret.

3. Finish in Supabase

Paste the client ID and secret and click Create and enable provider.

4. Add the button

await supabase.auth.signInWithOAuth({
  provider: "custom:zeno-id",
  options: { redirectTo: window.location.origin },
});
Enter fullscreen mode Exit fullscreen mode

That's it. People appear in auth.users like any other provider.

What's under the hood

  • Authorization code flow with PKCE (S256) and nonce
  • RS256-signed ID tokens, with keys published at /jwks
  • A pairwise sub: each app gets its own user id per person, so apps can't follow people across each other
  • A consent screen that shows exactly what the app gets, and people can revoke access at any time
  • Rotating refresh tokens with offline_access

It also works with Auth.js / NextAuth and any other OIDC library: give it the issuer and it finds the rest.

Full guide, including Next.js and the button: https://zeno-innovations.com/sign-in-with-zeno-id

We'd love feedback, especially from people who have built auth before. What would you want from a provider like this?

Top comments (0)