n8n-nodes-auth-service

raw JSON →
0.4.6 verified Mon Apr 27 auth: no javascript

n8n community node package (v0.4.6, stable) integrating with Auth Service, a self-hosted token authentication and authorization microservice. Provides two nodes: an Auth Service action node for full API access (validate tokens, manage zones and tokens) and an Auth Webhook trigger node that automatically validates tokens before workflow execution, replacing a multi-node setup. Key differentiators: zone-based permissions with read/write/delete/all levels; Docker deployment with Redis + SQLite/PostgreSQL; MFA-protected admin dashboard. Ships TypeScript types, depends on n8n-workflow.

error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
cause Using CommonJS require() to import an ESM-only package.
fix
Change to import or use dynamic import: const mod = await import('n8n-nodes-auth-service');
error TypeError: Cannot read properties of undefined (reading 'credentials')
cause Missing or malformed authentication credentials object in node execution.
fix
Ensure credentials are provided with correct format: { authServiceApi: { baseUrl, apiKey } }
error 400 Bad Request: Invalid token format
cause Token parameter does not include 'Bearer ' prefix or is empty.
fix
Pass token as 'Bearer <actual_token>' or match the configured token source.
error n8n community node: Failed to load node 'Auth Service'
cause Incompatible n8n version or missing peer dependency n8n-workflow.
fix
Update n8n to latest version and ensure n8n-workflow is installed: npm install n8n-workflow@latest
gotcha The npm package name uses hyphens but the import path is also the package name; ensure correct casing.
fix Use exact package name 'n8n-nodes-auth-service' in npm install and imports.
breaking Package is ESM-only. Do not use require() in CommonJS contexts; will throw at runtime.
fix Use dynamic import() or switch to ESM environment.
gotcha Credentials with invalid API Key or Base URL may silently fail during testing; credential test calls GET /tokens/ping which may be disabled on some setups.
fix Ensure the Auth Service endpoint is reachable and /tokens/ping responds 200.
deprecated Operation 'Delete Token' is marked as permanent; no undo. Some deployments may lack token deletion support.
fix Test deletion in a non-production environment first.
gotcha Auth Webhook node requires the token to be passed in the Authorization header (Bearer) or custom header; missing header causes 403 without detailed error.
fix Ensure clients send token in the expected header.
npm install n8n-nodes-auth-service
yarn add n8n-nodes-auth-service
pnpm add n8n-nodes-auth-service

Shows how to use the Auth Service node programmatically to validate a token against a zone with read level.

// n8n workflow using Auth Service node via code (not UI)
import { Workflow, WorkflowDataProxy } from 'n8n-workflow';
import { AuthServiceV1 } from 'n8n-nodes-auth-service';

// Example: Validate token node
const node = new AuthServiceV1();
const result = await node.execute({
  credentials: {
    authServiceApi: {
      baseUrl: process.env.AUTH_SERVICE_BASE_URL ?? 'http://localhost:8080',
      apiKey: process.env.AUTH_SERVICE_API_KEY ?? ''
    }
  },
  parameters: {
    operation: 'validateToken',
    token: 'Bearer my-token',
    zone: 'orders',
    level: 'read'
  }
});
console.log('Validation result:', result);
// Output: { result: true }