From 8e6bbe822c6d506d23b53d154c151a84374a626a Mon Sep 17 00:00:00 2001 From: Kevin J Gao <32936811+gaokevin1@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:52:57 -0700 Subject: [PATCH 1/6] Updated Descope Docs --- .../getting-started/providers/descope.mdx | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/pages/getting-started/providers/descope.mdx b/docs/pages/getting-started/providers/descope.mdx index 3d9ea92fff..89994afe73 100644 --- a/docs/pages/getting-started/providers/descope.mdx +++ b/docs/pages/getting-started/providers/descope.mdx @@ -7,7 +7,7 @@ import { Code } from "@/components/Code" ## Resources -- [Descope OIDC](https://docs.descope.com/customize/auth/oidc) +- [Descope OIDC](https://docs.descope.com/manage/idpapplications/oidc/) - [Descope Flows](https://docs.descope.com/customize/flows) ## Setup @@ -43,7 +43,6 @@ https://example.com/auth/callback/descope ``` AUTH_DESCOPE_ID AUTH_DESCOPE_SECRET -AUTH_DESCOPE_ISSUER ``` ### Configuration @@ -51,7 +50,7 @@ AUTH_DESCOPE_ISSUER Follow these steps: 1. Log into the [Descope console](https://app.descope.com) -2. Follow the [OIDC instructions](https://docs.descope.com/customize/auth/oidc) +2. Follow the [OIDC instructions](https://docs.descope.com/manage/idpapplications/oidc/) Add the required environment variables from above to your `.env.local` file. @@ -63,7 +62,11 @@ import NextAuth from "next-auth" import Descope from "next-auth/providers/descope" export const { handlers, auth, signIn, signOut } = NextAuth({ - providers: [Descope], + providers: [ Descope({ + clientId: process.env.AUTH_DESCOPE_ID, + clientSecret: process.env.AUTH_DESCOPE_SECRET, + checks: ["pkce", "state"], + })] }) ``` @@ -76,7 +79,11 @@ import Descope from "@auth/qwik/providers/descope" export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$( () => ({ - providers: [Descope], + providers: [ Descope({ + clientId: process.env.AUTH_DESCOPE_ID, + clientSecret: process.env.AUTH_DESCOPE_SECRET, + checks: ["pkce", "state"], + })] }) ) ``` @@ -89,7 +96,11 @@ import { SvelteKitAuth } from "@auth/sveltekit" import Descope from "@auth/sveltekit/providers/descope" export const { handle, signIn, signOut } = SvelteKitAuth({ - providers: [Descope], + providers: [ Descope({ + clientId: process.env.AUTH_DESCOPE_ID, + clientSecret: process.env.AUTH_DESCOPE_SECRET, + checks: ["pkce", "state"], + })] }) ``` @@ -100,7 +111,11 @@ export const { handle, signIn, signOut } = SvelteKitAuth({ import { ExpressAuth } from "@auth/express" import Descope from "@auth/express/providers/descope" -app.use("/auth/*", ExpressAuth({ providers: [Descope] })) +app.use("/auth/*", ExpressAuth({ providers: [ Descope({ + clientId: process.env.AUTH_DESCOPE_ID, + clientSecret: process.env.AUTH_DESCOPE_SECRET, + checks: ["pkce", "state"], + })]})) ``` From fa2c3e9d608240acbe2994e5a321d7306a1f95a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Aug 2024 19:39:37 +0100 Subject: [PATCH 2/6] Update descope.mdx --- .../getting-started/providers/descope.mdx | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/pages/getting-started/providers/descope.mdx b/docs/pages/getting-started/providers/descope.mdx index 89994afe73..0f69fcf9cd 100644 --- a/docs/pages/getting-started/providers/descope.mdx +++ b/docs/pages/getting-started/providers/descope.mdx @@ -62,11 +62,7 @@ import NextAuth from "next-auth" import Descope from "next-auth/providers/descope" export const { handlers, auth, signIn, signOut } = NextAuth({ - providers: [ Descope({ - clientId: process.env.AUTH_DESCOPE_ID, - clientSecret: process.env.AUTH_DESCOPE_SECRET, - checks: ["pkce", "state"], - })] + providers: [ Descope ] }) ``` @@ -79,11 +75,7 @@ import Descope from "@auth/qwik/providers/descope" export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$( () => ({ - providers: [ Descope({ - clientId: process.env.AUTH_DESCOPE_ID, - clientSecret: process.env.AUTH_DESCOPE_SECRET, - checks: ["pkce", "state"], - })] + providers: [ Descope ] }) ) ``` @@ -96,11 +88,7 @@ import { SvelteKitAuth } from "@auth/sveltekit" import Descope from "@auth/sveltekit/providers/descope" export const { handle, signIn, signOut } = SvelteKitAuth({ - providers: [ Descope({ - clientId: process.env.AUTH_DESCOPE_ID, - clientSecret: process.env.AUTH_DESCOPE_SECRET, - checks: ["pkce", "state"], - })] + providers: [ Descope ] }) ``` @@ -111,11 +99,7 @@ export const { handle, signIn, signOut } = SvelteKitAuth({ import { ExpressAuth } from "@auth/express" import Descope from "@auth/express/providers/descope" -app.use("/auth/*", ExpressAuth({ providers: [ Descope({ - clientId: process.env.AUTH_DESCOPE_ID, - clientSecret: process.env.AUTH_DESCOPE_SECRET, - checks: ["pkce", "state"], - })]})) +app.use("/auth/*", ExpressAuth({ providers: [ Descope ]})) ``` From d178b38ecac478a3eac8c55a9e3bef07ab2bd8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Aug 2024 19:40:18 +0100 Subject: [PATCH 3/6] Update descope.mdx --- docs/pages/getting-started/providers/descope.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/getting-started/providers/descope.mdx b/docs/pages/getting-started/providers/descope.mdx index 0f69fcf9cd..6d80fa763f 100644 --- a/docs/pages/getting-started/providers/descope.mdx +++ b/docs/pages/getting-started/providers/descope.mdx @@ -62,7 +62,7 @@ import NextAuth from "next-auth" import Descope from "next-auth/providers/descope" export const { handlers, auth, signIn, signOut } = NextAuth({ - providers: [ Descope ] + providers: [Descope], }) ``` @@ -75,7 +75,7 @@ import Descope from "@auth/qwik/providers/descope" export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$( () => ({ - providers: [ Descope ] + providers: [Descope], }) ) ``` @@ -88,7 +88,7 @@ import { SvelteKitAuth } from "@auth/sveltekit" import Descope from "@auth/sveltekit/providers/descope" export const { handle, signIn, signOut } = SvelteKitAuth({ - providers: [ Descope ] + providers: [Descope], }) ``` @@ -99,7 +99,7 @@ export const { handle, signIn, signOut } = SvelteKitAuth({ import { ExpressAuth } from "@auth/express" import Descope from "@auth/express/providers/descope" -app.use("/auth/*", ExpressAuth({ providers: [ Descope ]})) +app.use("/auth/*", ExpressAuth({ providers: [Descope]})) ``` From a7df0365426f6d0e7e0fa62c6711f95730e58ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Aug 2024 19:40:36 +0100 Subject: [PATCH 4/6] Update descope.mdx --- docs/pages/getting-started/providers/descope.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/getting-started/providers/descope.mdx b/docs/pages/getting-started/providers/descope.mdx index 6d80fa763f..5e3d8dd44f 100644 --- a/docs/pages/getting-started/providers/descope.mdx +++ b/docs/pages/getting-started/providers/descope.mdx @@ -99,7 +99,7 @@ export const { handle, signIn, signOut } = SvelteKitAuth({ import { ExpressAuth } from "@auth/express" import Descope from "@auth/express/providers/descope" -app.use("/auth/*", ExpressAuth({ providers: [Descope]})) +app.use("/auth/*", ExpressAuth({ providers: [Descope] })) ``` From e39881a083c7c10d69723010624875a05f3341cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Aug 2024 19:43:11 +0100 Subject: [PATCH 5/6] Update descope.ts --- packages/core/src/providers/descope.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/core/src/providers/descope.ts b/packages/core/src/providers/descope.ts index a2c0eb80a9..c19356493a 100644 --- a/packages/core/src/providers/descope.ts +++ b/packages/core/src/providers/descope.ts @@ -50,14 +50,7 @@ export interface DescopeProfile { * import Descope from "@auth/core/providers/descope" * * const request = new Request(origin) - * const response = await Auth(request, { - * providers: [ - * Descope({ - * clientId: DESCOPE_ID, - * clientSecret: DESCOPE_SECRET, - * }), - * ], - * }) + * const response = await Auth(request, { providers: [Descope] }) * ``` * * ### Configuring Descope @@ -71,8 +64,8 @@ export interface DescopeProfile { * * Get the following from the Descope's console: * ``` - * DESCOPE_ID="" # Descope's Issuer can be found in "Authentication Methods > SSO > Identity Provider" (Can also be taken from "Project > Project ID") - * DESCOPE_SECRET="" # Manage > Access Keys + * AUTH_DESCOPE_ID="" # Descope's Issuer can be found in "Authentication Methods > SSO > Identity Provider" (Can also be taken from "Project > Project ID") + * AUTH_DESCOPE_SECRET="" # Manage > Access Keys * ``` * * ### Resources From 14b6f4354184b76f699b678d05466b0b3f233bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Aug 2024 19:43:45 +0100 Subject: [PATCH 6/6] Update descope.ts --- packages/core/src/providers/descope.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/providers/descope.ts b/packages/core/src/providers/descope.ts index c19356493a..601c3f6fe3 100644 --- a/packages/core/src/providers/descope.ts +++ b/packages/core/src/providers/descope.ts @@ -101,6 +101,7 @@ export default function Descope( bg: "#1C1C23", text: "#ffffff", }, + checks: ["pkce", "state"], options: config, } }