@sodefa/auth
v0.3.0
Published
Shared SODEFA Auth SDK for internal tools.
Keywords
Readme
@sodefa/auth
Shared SDK for SODEFA Auth consumers.
Install
npm install @sodefa/authCore Helpers
import {
buildRefreshUrl,
resolveAuthMode,
verifyAccessToken,
} from "@sodefa/auth";The root export contains shared constants, cookie names, redirect URL builders, host mode detection, cookie parsing, and JWT verification via the SODEFA Auth JWKS endpoint.
Next.js Helpers
import {
createSodefaAuthMiddleware,
createSodefaCallbackRoute,
getUser,
} from "@sodefa/auth/next";@sodefa/auth/next provides middleware and callback helpers for internal
Next.js tools:
- same-site SODEFA domains refresh through
auth.sodefa.de - off-domain previews use the Bounce authorization code flow
- Server Components and Route Handlers can read the verified SODEFA user
Required consumer env vars:
SODEFA_AUTH_BASE_URL=https://auth.sodefa.de
SODEFA_AUTH_CLIENT_ID=<client-id>
SODEFA_AUTH_CLIENT_SECRET=<client-secret>Publishing
Build before publishing:
bun run build
npm publish --access publicnpm publish also runs the package prepack script, so dist/* is rebuilt
before the tarball is created.
Use provenance for the later GitHub Actions release path, not for the first local publish. npm provenance requires a supported cloud CI/CD runner.
This package is intentionally marked UNLICENSED and is only meant for SODEFA
internal projects.
