
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
studio-ai-auth
Advanced tools
A reusable Next.js middleware package for authentication and token validation. This package helps enforce authentication across multiple micro-frontends without code duplication.
👉 JWT Token Decryption & Validation
👉 Automatic Redirection to Authentication if token is missing/invalid
👉 Configurable Public Routes (Define accessible routes without authentication)
👉 Reusable Across Micro-Frontends (Reduce redundant auth logic)
👉 Easy Integration with Next.js Middleware
Install the package using npm:
npm i studio-ai-auth
or using yarn:
yarn add studio-ai-auth
Ensure you have the required environment variables set in your .env.local file:
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANB...\n-----END PRIVATE KEY-----"
PRIVATE_KEY="-----BEGIN PUBLIC KEY-----\nMIIEvQIBADSZANB...\n-----END PUBLiC KEY-----"
KEYCLOAK_ISSUER="https://keycloak.example.com/auth/realms/my-realm"
KEYCLOAK_CLIENT_ID="my-client-id"
1️⃣ Extracts JWT from Cookies
2️⃣ Decrypts & Validates token (expiration, issuer, audience)
3️⃣ Allows or Redirects the request based on validation
4️⃣ Handles Public Routes (Allows users to access without authentication)
/my-nextjs-app
├── /app
│ ├── page.tsx
│ ├── dashboard -> page.tsx
│ ├── profile -> page.tsx
├── /middleware.ts ← (Integrate middleware here)
├── /env.local ← (Store private key & env variables)
├── /public
├── package.json
├── tsconfig.json
Cannot find module 'node-jose'Ensure you have the required dependencies installed:
npm i node-jose
403 Forbidden - You do not have permission to publishCheck if you're logged into npm:
npm whoami
If not logged in, run:
npm login
This project is licensed under the MIT License.
Want to improve this package? Open an issue or submit a PR! 😊
If you have any issues, feel free to open an issue.
FAQs
A Next.js middleware for handling authentication with Keycloak and JWT.
We found that studio-ai-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.