Checkpoint: Connexion Microsoft 365 (Azure AD OAuth2) : migration DB azureAdId, helpers backend, route callback, bouton Login, page AzureCallback, tests OK

This commit is contained in:
Manus
2026-07-07 10:29:03 -04:00
parent 2d0de2a30d
commit 465e33c3b8
16 changed files with 1529 additions and 5 deletions

21
server/azureAuth.test.ts Normal file
View File

@@ -0,0 +1,21 @@
import { describe, it, expect } from "vitest";
import { isAzureAdConfigured, getAzureAuthUrl } from "./azureAuth";
describe("Azure AD configuration", () => {
it("should detect Azure AD as configured when env vars are set", () => {
// Les variables sont injectées via webdev_request_secrets
const configured = isAzureAdConfigured();
expect(configured).toBe(true);
});
it("should generate a valid Azure AD auth URL", async () => {
if (!isAzureAdConfigured()) {
console.warn("Azure AD not configured, skipping URL test");
return;
}
const url = await getAzureAuthUrl();
expect(url).toContain("login.microsoftonline.com");
expect(url).toContain("oauth2/v2.0/authorize");
expect(url).toContain("f496da82-e18f-4567-bf05-8551ae6669b2"); // client_id
});
});