Auth SDK
The Engineering11 Auth SDK is a fully functional microservice SDK designed for seamless integration within the Engineering11 ecosystem. It provides a comprehensive authentication layer, handling user authentication, token management, event publishing, and claims management.
This SDK is built to support multi-tenant applications with customizable authentication workflows.
Key Features
Token Management
- Secure token handling through
AuthRestClient - Methods for fetching default product IDs and updating custom claims
Comparison with Alternatives
| Product | Comparison |
|---|---|
| Auth0 | Provides a comprehensive identity management solution, but the Engineering11 SDK offers a more tightly integrated experience within the Engineering11 ecosystem. |
| Firebase Authentication | While Firebase Authentication includes robust user management, this SDK enhances custom claims management and multi-tenant event handling. |
Detailed Functionality
Fetch Default Product IDs
fetchDefaultProductIds()inAuthRestClient- Retrieves default product IDs based on user type
Update Custom Claims
updateCustomClaims()inAuthJobsClient- Supports bulk updates to user claims, reducing API call overhead
Email Verification
EmailVerificationService- Sends secure verification emails to users
Event Publishing
EventService- Publishes user-related events for a reactive microservices architecture
API Endpoints
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /ENDPOINTS.INTERNAL.FETCH_DEFAULT_PRODUCTS | Fetch Default Product IDs |
| PUT | /password-reset | Reset password with a custom link |
| PUT | /verify-email | Verify user email |
| POST | /ENDPOINTS.INTERNAL.UPDATE_CUSTOM_CLAIMS | Bulk update custom claims |
Core Technologies
- Node.js
- Firebase Admin SDK
- NestJS
- TypeScript
- Jest (for testing)
- Lodash (for utility functions)
Usage Example
import { AuthRestClient } from "@engineering11/auth-rest";
const authClient = new AuthRestClient();
async function fetchProducts(userId) {
const productIds = await authClient.fetchDefaultProductIds(userId);
console.log("Default Products:", productIds);
}
The Engineering11 Auth SDK enables rapid development of scalable authentication services while ensuring security and maintainability.
Last updated on