{"_id":"@automatiseerjouwproces/identity-kit","_rev":"6-b31fad92bbe2ef7d5c1f1084620a8c5e","name":"@automatiseerjouwproces/identity-kit","dist-tags":{"latest":"0.2.3"},"versions":{"0.0.1":{"name":"@automatiseerjouwproces/identity-kit","version":"0.0.1","keywords":[],"author":{"url":"https://automatiseerjouwproces.nl","name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl"},"license":"ISC","_id":"@automatiseerjouwproces/identity-kit@0.0.1","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"dist":{"shasum":"2fe21f476f5e944c96f21cc34b9e7e9fcdd0f52f","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.0.1.tgz","fileCount":7,"integrity":"sha512-4A2V1YmbanpoWZW+QTOTAFHxFB7vYofN2jP+KgYiryG3IjEWGw8YyxmRVez5GtBR1HNHKQKeT1dPH5gn1fpBjw==","signatures":[{"sig":"MEYCIQCDmtM+B85TyG+3rdAgSafNKx8Vkth8wUWuc3Ybh0yiiQIhAIoNUbLLv8oXXfnVM/AP4vyZQm4mE3TG4RIsmOwOWe/7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1689},"main":"dist/index.js","type":"module","_from":"file:automatiseerjouwproces-identity-kit-0.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"_resolved":"/tmp/824b2786237796b5e25701e0e6a3bbee/automatiseerjouwproces-identity-kit-0.0.1.tgz","_integrity":"sha512-4A2V1YmbanpoWZW+QTOTAFHxFB7vYofN2jP+KgYiryG3IjEWGw8YyxmRVez5GtBR1HNHKQKeT1dPH5gn1fpBjw==","_npmVersion":"11.6.2","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/identity-kit_0.0.1_1764794031587_0.2449035358539975","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@automatiseerjouwproces/identity-kit","version":"0.1.1","keywords":[],"author":{"url":"https://automatiseerjouwproces.nl","name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl"},"license":"ISC","_id":"@automatiseerjouwproces/identity-kit@0.1.1","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"dist":{"shasum":"be71fd5e45de928239f784a43f6b15e769595ff0","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.1.1.tgz","fileCount":22,"integrity":"sha512-A81PciEhkU4bu+M+6eWo0dqXHKFqlEAY9dSC6SPMbuwLryTcmYziJhFT9klcdnmSACsXhxa0t5Bvz4fyyDGyWA==","signatures":[{"sig":"MEQCIAZlrmBx7Er//XF+sg5Cvtc0O5We49jwYWlf019z5pEBAiBi1gT+lzCSjcuCC6rfP66GL+y5xZ/6syZUqEm/tHmKCw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100140},"main":"dist/index.js","type":"module","_from":"file:automatiseerjouwproces-identity-kit-0.1.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"_resolved":"/tmp/205010e5b1068525cfe903c8280c3ec7/automatiseerjouwproces-identity-kit-0.1.1.tgz","_integrity":"sha512-A81PciEhkU4bu+M+6eWo0dqXHKFqlEAY9dSC6SPMbuwLryTcmYziJhFT9klcdnmSACsXhxa0t5Bvz4fyyDGyWA==","_npmVersion":"11.6.2","description":"@automatiseerjouwproces/identity-kit ===================================","directories":{},"_nodeVersion":"25.2.1","dependencies":{"jose":"^5.9.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^22.9.1","@types/react":"^18.3.11","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.4.0","react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-kit_0.1.1_1764796906430_0.4176507546926109","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@automatiseerjouwproces/identity-kit","version":"0.2.0","keywords":[],"author":{"url":"https://automatiseerjouwproces.nl","name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl"},"license":"ISC","_id":"@automatiseerjouwproces/identity-kit@0.2.0","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"dist":{"shasum":"4a6a12bc0d44af39fe52d1ff2358f100ecfba6ae","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.2.0.tgz","fileCount":22,"integrity":"sha512-9v4WExmpbGLzbOoS9mea9s1egkoFagbkspdm//DWEK2z+1bsBa42KEwHqw/bfNghqOAXl2A7pnqAy/NzOYYcDw==","signatures":[{"sig":"MEYCIQCcZ7XWuX+rWUnpFaDHw+3K2RokYo0d5QHe8PMduJcvMQIhAJgC82IYxuWR+rKUGp4Q/qfU37YICXNaaZd81CKNQb8r","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100320},"main":"dist/index.js","type":"module","_from":"file:automatiseerjouwproces-identity-kit-0.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"_resolved":"/tmp/45033991eb6ba4c42c1ed1a3e1f79533/automatiseerjouwproces-identity-kit-0.2.0.tgz","_integrity":"sha512-9v4WExmpbGLzbOoS9mea9s1egkoFagbkspdm//DWEK2z+1bsBa42KEwHqw/bfNghqOAXl2A7pnqAy/NzOYYcDw==","_npmVersion":"11.6.2","description":"@automatiseerjouwproces/identity-kit ===================================","directories":{},"_nodeVersion":"25.2.1","dependencies":{"jose":"^5.9.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^22.9.1","@types/react":"^18.3.11","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.4.0","react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-kit_0.2.0_1764797610192_0.08128122337824073","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@automatiseerjouwproces/identity-kit","version":"0.2.1","keywords":[],"author":{"url":"https://automatiseerjouwproces.nl","name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl"},"license":"ISC","_id":"@automatiseerjouwproces/identity-kit@0.2.1","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"dist":{"shasum":"bd6d0aff466c9db0dafa38771ff5d2fbb337e02d","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.2.1.tgz","fileCount":22,"integrity":"sha512-BGyQOn3rIRYH7SQKtxqoJmzszVoK77t6T9iTSMLRalwJn5K8HrhO57xficSKsQ1LH+M/v8Yp59yVIK4B2TJ3cg==","signatures":[{"sig":"MEUCICIQNBtiFat/DqF+SeaGlqnlywHrK0vIqIdAUrE4rkXGAiEAivK/HFG/7rsnAshDnLhBXsz+RGVPIsOaq5SB+XH1y8M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100320},"main":"dist/index.js","type":"module","_from":"file:automatiseerjouwproces-identity-kit-0.2.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"_resolved":"/tmp/1e3dca05b21a9e5e68213fe8cbccd385/automatiseerjouwproces-identity-kit-0.2.1.tgz","_integrity":"sha512-BGyQOn3rIRYH7SQKtxqoJmzszVoK77t6T9iTSMLRalwJn5K8HrhO57xficSKsQ1LH+M/v8Yp59yVIK4B2TJ3cg==","_npmVersion":"11.6.2","description":"@automatiseerjouwproces/identity-kit ===================================","directories":{},"_nodeVersion":"25.2.1","dependencies":{"jose":"^5.9.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^22.9.1","@types/react":"^18.3.11","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.4.0","react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-kit_0.2.1_1764798617489_0.8298835227646952","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@automatiseerjouwproces/identity-kit","version":"0.2.2","keywords":[],"author":{"url":"https://automatiseerjouwproces.nl","name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl"},"license":"ISC","_id":"@automatiseerjouwproces/identity-kit@0.2.2","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"dist":{"shasum":"7d51ea51a583a90e5f97c59a293f184e1a94ba54","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.2.2.tgz","fileCount":29,"integrity":"sha512-7wxxvdPo0xGj3J11QfVz0Ox+lN75cOxT5YhCqqnbyZNirCyHS4Sg7bZiAqwkW0rwJH5l110qavO49Iqecjmzmg==","signatures":[{"sig":"MEUCIQCRJuAorW50p2+5Fkk6I2q4GzfaWjr8O8lkn9ME5UOongIgTMONhxANfRCBO537oACVu/xhZlQeioAV1pXUs26X1aY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102104},"main":"dist/index.js","type":"module","_from":"file:automatiseerjouwproces-identity-kit-0.2.2.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react/index.js","default":"./dist/react/index.js","require":"./dist/react/index.cjs"}},"scripts":{"build":"tsup src/index.ts src/react/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"_resolved":"/tmp/cfff53bb1f8fc923d8a47fbc7ebb5245/automatiseerjouwproces-identity-kit-0.2.2.tgz","_integrity":"sha512-7wxxvdPo0xGj3J11QfVz0Ox+lN75cOxT5YhCqqnbyZNirCyHS4Sg7bZiAqwkW0rwJH5l110qavO49Iqecjmzmg==","_npmVersion":"11.6.2","description":"@automatiseerjouwproces/identity-kit ===================================","directories":{},"_nodeVersion":"25.2.1","dependencies":{"jose":"^5.9.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","@types/node":"^22.9.1","@types/react":"^18.3.11","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.4.0","react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/identity-kit_0.2.2_1764798931294_0.008751568610696037","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@automatiseerjouwproces/identity-kit","version":"0.2.3","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react/index.js","require":"./dist/react/index.cjs","default":"./dist/react/index.js"}},"publishConfig":{"access":"public"},"keywords":[],"author":{"name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl","url":"https://automatiseerjouwproces.nl"},"license":"ISC","dependencies":{"jose":"^5.9.3"},"peerDependencies":{"next":">=13.4.0","react":">=18.0.0","react-dom":">=18.0.0"},"devDependencies":{"@types/node":"^22.9.1","@types/react":"^18.3.11","@types/react-dom":"^18.3.0","tsup":"^8.5.1","typescript":"^5.9.3"},"scripts":{"build":"tsup src/index.ts src/react/index.ts --format cjs,esm --dts"},"_id":"@automatiseerjouwproces/identity-kit@0.2.3","description":"@automatiseerjouwproces/identity-kit ===================================","_integrity":"sha512-SdZgqQU6VQWTYz15x7Y+rOtNyoo0wm4SobJ3/8ZMDB7URcNnpmjDpz8eI7P4faO4mAGtx7RYa3ofUdZ6hol97A==","_resolved":"/tmp/3ecf02ef89d0727bf8d9e35751dbaab6/automatiseerjouwproces-identity-kit-0.2.3.tgz","_from":"file:automatiseerjouwproces-identity-kit-0.2.3.tgz","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-SdZgqQU6VQWTYz15x7Y+rOtNyoo0wm4SobJ3/8ZMDB7URcNnpmjDpz8eI7P4faO4mAGtx7RYa3ofUdZ6hol97A==","shasum":"a68f3b806d71f8d49115edea7845a3fb2ad6ad97","tarball":"https://registry.npmjs.org/@automatiseerjouwproces/identity-kit/-/identity-kit-0.2.3.tgz","fileCount":29,"unpackedSize":113948,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG2afgJHSXahKlBe8Eo2H2BLbeo/qXYi5yvKtDfxUH0UAiEAniaPRuW+5HpINwvNL9vTeejj+RSOwPdkfddnPAY+0U8="}]},"_npmUser":{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"},"directories":{},"maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/identity-kit_0.2.3_1764800650757_0.6794458851717935"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-03T20:33:51.484Z","modified":"2025-12-03T22:24:11.164Z","0.0.1":"2025-12-03T20:33:51.785Z","0.1.1":"2025-12-03T21:21:46.626Z","0.2.0":"2025-12-03T21:33:30.392Z","0.2.1":"2025-12-03T21:50:17.698Z","0.2.2":"2025-12-03T21:55:31.490Z","0.2.3":"2025-12-03T22:24:10.946Z"},"author":{"name":"Automatiseer Jouw Proces","email":"info@automatiseerjouwproces.nl","url":"https://automatiseerjouwproces.nl"},"license":"ISC","keywords":[],"description":"@automatiseerjouwproces/identity-kit ===================================","maintainers":[{"name":"johanvandeglind","email":"johan@i-coso.nl"},{"name":"stanajp","email":"stan@automatiseerjouwproces.nl"}],"readme":"@automatiseerjouwproces/identity-kit\n===================================\n\nEen compacte auth-kit voor Next.js App Router met een kant-en-klare Azure AD (Entra ID) loginflow, sessie-cookie en React-context.\n\nInstallatie\n-----------\n\n```\npnpm add @automatiseerjouwproces/identity-kit\n```\n\nConfiguratie (auth.config.ts)\n-----------------------------\n\n```ts\nimport { createAuthConfig } from \"@automatiseerjouwproces/identity-kit\";\n\nexport const authConfig = createAuthConfig({\n  provider: \"azure\",\n  postLoginRedirectPath: \"/\",\n  jwtSecret: process.env.AJP_IDENTITY_JWT_SECRET ?? \"\",\n  azure: {\n    tenantId: process.env.AZURE_TENANT_ID ?? \"\",\n    clientId: process.env.AZURE_CLIENT_ID ?? \"\",\n    clientSecret: process.env.AZURE_CLIENT_SECRET ?? \"\",\n    redirectUri: `${process.env.APP_ORIGIN}/api/auth/callback`,\n    scopes: [\"openid\", \"profile\", \"email\"],\n    // Optioneel: service principal (Enterprise App) object ID als je die elders nodig hebt\n    servicePrincipalId: process.env.AZURE_AD_SERVICE_PRINCIPAL_ID,\n    // Optioneel: map Azure app role IDs/names → app-roles, en group-namen → app-roles (fallback)\n    roleMapping: {\n      // \"00000000-0000-0000-0000-000000000000\": \"ADMIN\",\n    },\n    groupRoleMapping: {\n      // \"MyApp-Admin\": \"ADMIN\",\n    },\n    // Zet op false als je geen Graph calls voor appRoleAssignments wilt doen\n    fetchAppRolesFromGraph: true,\n  },\n});\n```\n\nAPI routes (App Router)\n-----------------------\n\n```ts\n// app/api/auth/login/route.ts\nimport { createAppRouterHandlers } from \"@automatiseerjouwproces/identity-kit\";\nimport { authConfig } from \"../../../auth.config\";\n\nconst handlers = createAppRouterHandlers(authConfig);\nexport const GET = handlers.loginHandler;\n\n// app/api/auth/callback/route.ts\nexport const GET = handlers.callbackHandler;\n\n// app/api/auth/logout/route.ts\nexport const GET = handlers.logoutHandler;\n\n// app/api/auth/session/route.ts (voor client-side status)\nexport const GET = handlers.sessionHandler;\n```\n\nServer utilities\n----------------\n\n```ts\n// app/protected/route.tsx\nimport { requireAuth } from \"@automatiseerjouwproces/identity-kit\";\nimport { authConfig } from \"../auth.config\";\n\nexport default async function ProtectedPage({ request }: { request: Request }) {\n  const userOrRedirect = await requireAuth(request, authConfig);\n  if (userOrRedirect instanceof Response) return userOrRedirect;\n\n  return <div>Welkom {userOrRedirect.name}</div>;\n}\n```\n\nReact integratie\n----------------\n\n```tsx\n// app/layout.tsx\nimport { IdentityProvider } from \"@automatiseerjouwproces/identity-kit/react\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  return (\n    <html lang=\"nl\">\n      <body>\n        <IdentityProvider>{children}</IdentityProvider>\n      </body>\n    </html>\n  );\n}\n```\n\n```tsx\n// app/login/page.tsx\nimport { LoginPage } from \"@automatiseerjouwproces/identity-kit/react\";\n\nexport default function Login() {\n  return <LoginPage />;\n}\n```\n\nMiddleware (optioneel)\n----------------------\n\n```ts\n// middleware.ts\nimport { createAuthMiddleware } from \"@automatiseerjouwproces/identity-kit\";\nimport { authConfig } from \"./auth.config\";\n\nconst authMiddleware = createAuthMiddleware(authConfig, {\n  protectedPaths: [\"/app/*\"],\n  redirectTo: \"/login\",\n});\n\nexport async function middleware(request: Request) {\n  return authMiddleware(request);\n}\n```\n\nBelangrijk\n----------\n\n- Gebruik altijd een sterk `AJP_IDENTITY_JWT_SECRET`.\n- De React-provider stuurt je naar `/api/auth/login` en `/api/auth/logout`; zorg dat deze routes bestaan.\n- De `sessionHandler` geeft `{ user }` terug voor de client-side status; voeg deze route toe.\n- Als je app-roles via Graph wilt lezen, zorg dat je scopes toegang geven (bijv. `Directory.Read.All`/`AppRoleAssignment.Read.All`) en vul `servicePrincipalId` + optionele mappings in.\n","readmeFilename":"README.md"}