We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de8d4d5 commit 9f5a4d5Copy full SHA for 9f5a4d5
packages/web/src/app/api/(server)/ee/.well-known/oauth-protected-resource/route.ts
@@ -0,0 +1,16 @@
1
+import { apiHandler } from '@/lib/apiHandler';
2
+import { env } from '@sourcebot/shared';
3
+
4
+// RFC 9728: OAuth 2.0 Protected Resource Metadata
5
+// Tells OAuth clients which authorization server protects this resource.
6
+// @see: https://datatracker.ietf.org/doc/html/rfc9728
7
+export const GET = apiHandler(async () => {
8
+ const issuer = env.AUTH_URL.replace(/\/$/, '');
9
10
+ return Response.json({
11
+ resource: `${issuer}/api/mcp`,
12
+ authorization_servers: [
13
+ issuer
14
+ ],
15
+ });
16
+}, { track: false });
0 commit comments