Auth
Interface Auth Documentation
Overview
The Interface Auth provides a decorator-based framework for implementing authentication and authorization in TypeScript applications. It offers token signing, verification, and flexible parameter decorators for securing API endpoints.
This interface depends on the Interface API package, which provides the decorator infrastructure for parameter injection.
Core concepts
The authentication system is built around three main layers:
- Token handling - Sign and verify authentication tokens using
SignRaw,ValidateRaw, andSignServerResponse. - Authentication decorators - The
@Authenticationdecorator andCreateAuthDecoratorfunction inject verified user data into handler parameters. - Customizable pipeline - Configure custom sources, verifiers, and validators to adapt the authentication flow.
Installation
npm install @antelopejs/interface-auth
Documentation sections
- Authentication Basics - Authentication flow, sources, verifiers, and validators
- Token Handling - Token generation and validation functions
- Parameter Decoration - Authentication decorators and custom providers