Skip to content

Commit cf5092c

Browse files
mjunaidcaclaude
andcommitted
feat(sso): Add LearnFlow SSO public client
- Add learnflow-sso-public-client to trusted clients - Configure redirect URLs for localhost and learnflow.avixato.com - Add client to seed script for database seeding - Fix Taskflow URLs to use avixato.com consistently Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d8954e7 commit cf5092c

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

apps/sso/scripts/seed-prod-client.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const TASKFLOW_SSO_CLIENT = {
3939
name: "Taskflow SSO",
4040
redirectUrls: [
4141
"http://localhost:3000/api/auth/callback",
42-
"https://taskflow.org/api/auth/callback",
42+
"https://avixato.com/api/auth/callback",
43+
"https://api.avixato.com/auth/callback",
4344
].join(","),
4445
type: "public",
4546
disabled: false,
@@ -68,6 +69,24 @@ const AI_NATIVE_CLIENT = {
6869
}),
6970
};
7071

72+
const LEARNFLOW_SSO_CLIENT = {
73+
id: "learnflow-sso-public-client-id",
74+
clientId: "learnflow-sso-public-client",
75+
clientSecret: null,
76+
name: "LearnFlow SSO",
77+
redirectUrls: [
78+
"http://localhost:3000/api/auth/callback",
79+
"https://learnflow.avixato.com/api/auth/callback",
80+
].join(","),
81+
type: "public",
82+
disabled: false,
83+
metadata: JSON.stringify({
84+
token_endpoint_auth_method: "none",
85+
grant_types: ["authorization_code", "refresh_token"],
86+
description: "LearnFlow educational course platform",
87+
}),
88+
};
89+
7190
async function upsertClient(client: typeof TASKFLOW_SSO_CLIENT) {
7291
const existing = await db
7392
.select()
@@ -116,12 +135,14 @@ async function seed() {
116135

117136
await upsertClient(TASKFLOW_SSO_CLIENT);
118137
await upsertClient(AI_NATIVE_CLIENT);
138+
await upsertClient(LEARNFLOW_SSO_CLIENT);
119139

120140
// Verify and display all production clients
121141
const allClients = await db.select().from(oauthApplication);
122142
const prodClients = allClients.filter(c =>
123143
c.clientId === TASKFLOW_SSO_CLIENT.clientId ||
124-
c.clientId === AI_NATIVE_CLIENT.clientId
144+
c.clientId === AI_NATIVE_CLIENT.clientId ||
145+
c.clientId === LEARNFLOW_SSO_CLIENT.clientId
125146
);
126147

127148
console.log("\n✅ Successfully configured!\n");

apps/sso/src/lib/trusted-clients.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ export const TRUSTED_CLIENTS = [
109109
skipConsent: true,
110110
metadata: {},
111111
},
112+
{
113+
clientId: "learnflow-sso-public-client",
114+
name: "LearnFlow SSO",
115+
type: "public" as const,
116+
redirectUrls: filterRedirectUrls([
117+
"http://localhost:3000/api/auth/callback",
118+
"https://learnflow.avixato.com/api/auth/callback",
119+
]),
120+
disabled: false,
121+
skipConsent: true,
122+
metadata: {},
123+
},
112124
// =============================================================================
113125
// MCP OAuth Clients - 014-mcp-oauth-standardization
114126
// These clients use Device Authorization Flow (RFC 8628) for headless auth
@@ -216,6 +228,11 @@ export const CLIENT_DESCRIPTIONS = {
216228
audience: "All Taskflow users across platforms",
217229
security: "Public client with PKCE, no client secret",
218230
},
231+
"learnflow-sso-public-client": {
232+
purpose: "LearnFlow educational course platform",
233+
audience: "Teachers and students using LearnFlow",
234+
security: "Public client with PKCE, no client secret",
235+
},
219236
"ai-native-public-client": {
220237
purpose: "AI Native development platform",
221238
audience: "Developers building AI applications",

0 commit comments

Comments
 (0)