diff --git a/apps/backend/.env.development b/apps/backend/.env.development index a2ca03418..7ce918c51 100644 --- a/apps/backend/.env.development +++ b/apps/backend/.env.development @@ -42,4 +42,4 @@ STACK_ARTIFICIAL_DEVELOPMENT_DELAY_MS=50 STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING=yes -STACK_NEON_INTEGRATION_CLIENTS_CONFIG=[{"client_id": "neon-local", "client_secret": "neon-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize"]}] +STACK_NEON_INTEGRATION_CLIENTS_CONFIG=[{"client_id": "neon-local", "client_secret": "neon-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize", "http://localhost:30000/api/v2/auth/authorize"]}] diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts index b46c7c2d8..742981319 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts @@ -3,14 +3,14 @@ import { expect } from "vitest"; import { it, updateCookiesFromResponse } from "../../../../../../helpers"; import { ApiKey, Auth, Project, backendContext, niceBackendFetch } from "../../../../../backend-helpers"; -async function authorizePart1() { +async function authorizePart1(redirectUri: string = "http://localhost:30000/api/v2/auth/authorize") { let cookies = ""; const first = await niceBackendFetch("/api/v1/integrations/neon/oauth/authorize", { method: "GET", query: { response_type: "code", client_id: "neon-local", - redirect_uri: "http://localhost:30000/api/v2/identity/authorize", + redirect_uri: redirectUri, state: encodeBase64Url(new TextEncoder().encode(JSON.stringify({ details: { neon_project_name: 'neon-project' } }))), code_challenge: "xf6HY7PIgoaCf_eMniSt-45brYE2J_05C9BnfIbueik", code_challenge_method: "S256", @@ -135,9 +135,9 @@ async function authorize(projectId: string) { }, NiceResponse { "status": 303, - "body": "http://localhost:30000/api/v2/identity/authorize?code=%3Cstripped+query+param%3E&=", + "body": "http://localhost:30000/api/v2/auth/authorize?code=%3Cstripped+query+param%3E&=", "headers": Headers { - "location": "http://localhost:30000/api/v2/identity/authorize?code=%3Cstripped+query+param%3E&state=%3Cstripped+query+param%3E&iss=http%3A%2F%2Flocalhost%3A8102%2Fapi%2Fv1%2Fintegrations%2Fneon%2Foauth%2Fidp", + "location": "http://localhost:30000/api/v2/auth/authorize?code=%3Cstripped+query+param%3E&state=%3Cstripped+query+param%3E&iss=http%3A%2F%2Flocalhost%3A8102%2Fapi%2Fv1%2Fintegrations%2Fneon%2Foauth%2Fidp", "set-cookie": " to >, "set-cookie": " to >,