packages/platform/examples/base/README-OAUTH2.MD
This readme will guide you how to run the examples app with an OAuth 2.0 client.
First, we need to create test OAuth client. You can do it manually by creating the following in the OAuthClient table: { "clientId": "1c70be53f35aa480a5e3146d361fd993d265e564d2d86a203df3adbd05186517", "redirectUri": "http://localhost:4321", "clientSecret": "970db2cf14112013ba3a510b945294fef8737d42ee58c32031d2351692068ce7", "name": "atoms examples app oauth 2 client", "logo": null, "clientType": "confidential", "isTrusted": false, "createdAt": "2026-01-22 15:50:40.722", "purpose": "test atoms examples app with oauth 2", "rejectionReason": null, "status": "approved", "userId": 10, "websiteUrl": "http://localhost:4321" } Or you can do it automatically by: In the root .env set: SEED_OAUTH2_CLIENT_ID=1c70be53f35aa480a5e3146d361fd993d265e564d2d86a203df3adbd05186517 SEED_OAUTH2_CLIENT_SECRET_HASHED=970db2cf14112013ba3a510b945294fef8737d42ee58c32031d2351692068ce7 Then run yarn db-reset in the prisma folder which will create an OAuth client for the [email protected] user.
Second, we need to setup environment for the examples app. Go to packages/platform/examples/base/.env and paste the following NEXT_PUBLIC_OAUTH2_CLIENT_ID="1c70be53f35aa480a5e3146d361fd993d265e564d2d86a203df3adbd05186517" OAUTH2_CLIENT_SECRET_PLAIN="2df0d9b1450ea95f2376fce5bc1d352e2d7a253d7e1c68a96a44745413b7dc4c" OAUTH2_REDIRECT_URI="http://localhost:4321" NEXT_PUBLIC_CALCOM_API_URL="http://localhost:5555/api/v2"
NEXT_PUBLIC_OAUTH2_MODE="true" Here we have OAUTH2_CLIENT_SECRET_PLAIN in plain because it will be used for api request when exchanging authorization code for tokens. NEXT_PUBLIC_OAUTH2_MODE tells that the examples app will run not with platform OAuth client but with OAuth 2.0 client, so in the packages/platform/examples/base/src/pages/_app.tsx we will use CalOAuthProvider and not CalProvider.
packages/platform/examples/base run rm -f prisma/dev.db && yarn prisma db push to reset its SQLite. If you don't and there are users already then an entry for the [email protected] will not be created.