Skip to Content
Engineering11 SDKs doc 🔥
SdksAccess SDK

Access SDK

The Engineering11 Access SDK is a microservice-based access control solution that manages API keys and access tokens with a focus on security, scalability, and automation.

Designed for microservice ecosystems, this SDK ensures fine-grained token management, event-driven access control, and automated cleanup of expired credentials.

Key Features

  • Create, enable, disable, and delete access tokens securely.
  • Manages token lifecycle with fine-grained controls via TokenManagementService.

Comparison with Alternatives

ProductComparison
Auth0Provides identity management, but Access SDK focuses on API keys & token lifecycle.
OktaOkta offers broad authentication features, while Access SDK specializes in fine-grained token control.
Firebase AuthenticationFirebase is user-centric, while Access SDK provides system-level access management.

Core Functionality

Step 1: Creating Access Tokens

  • Uses AccessTokenService to create tokens with customizable attributes.
  • Example:
    await tokenManagement.createToken(ownerId, type, expiredDate, additionalInfo);

Step 2: Managing Token States

• Enable or disable tokens dynamically:

await tokenManagement.disableToken(token);

Step 3: Event-Driven Token Lifecycle

• Automatically publishes events for token actions:

sendToTopic(EVENTS.ACCESS_TOKEN_CREATED);

Step 4: Automated Token Cleanup

• Runs scheduled jobs to delete expired tokens:

cronExpression: '0 */12 * * *'; // Runs every 12 hours

API Endpoints

MethodEndpointDescription
PUT/token/:token/disableDisables a specified token.
PUT/token/:token/enableEnables a specified token.
DELETE/token/:tokenDeletes a specified token.

SDK File Structure

    • token.controller.ts
    • access-tasks.module.ts
    • index.ts
      • token-management.service.ts
      • authorization-token.service.ts
      • base-token.ts
      • api-key-record.ts

Technologies Used

Usage Example

import { TokenManagementService } from "@engineering11/access-server-api"; const tokenService = new TokenManagementService(); async function generateToken(userId) { const newToken = await tokenService.createToken(userId, "session", new Date()); console.log("Token Created:", newToken); }

The Access SDK enables developers to create and manage API keys and tokens efficiently, ensuring security and automation in their applications.

Last updated on