API Reference
This section provides detailed documentation for the public classes, methods, and data schemas in the did-auth library. It's intended for developers who need to understand the library's components in-depth to build or customize DID authentication workflows.
The library's architecture is centered around two main classes: WalletAuthenticator for cryptographic operations and WalletHandlers for managing the HTTP-based authentication flow.
Core Component Interaction#
The following diagram illustrates how your application, did-auth components, and the DID Wallet interact during an authentication process.
Key Components#
This reference is divided into the following sections:
- WalletAuthenticator The
WalletAuthenticatorclass is the core engine for creating, signing, and verifying authentication messages. It handles the cryptographic operations and ensures the integrity of the data exchanged between your application and the user's wallet. It does not handle HTTP transport or session management. - WalletHandlers The
WalletHandlersclass provides a set of Express.js middleware to manage the entire DID authentication lifecycle. It automates the creation of API endpoints for token generation, status checking, and handling responses from the wallet, simplifying integration into your web application. - Schemas This section details the validation schemas for
appInfo,chainInfo, and all supported claim types. These schemas, built with Joi, ensure that the data structures passed to and from the wallet are correctly formatted. Use this reference to construct valid claim requests.
To see how these components are used in a practical scenario, you can proceed to the How-to Guides.