@theoptimalpartner/jwt-auth-validator
Version:
JWT token validation package with offline JWKS validation and Redis-based token revocation support
20 lines • 827 B
TypeScript
import jwt from 'jsonwebtoken';
import { JWKSConfig, JWKSStats } from './types.js';
export declare class JWKSService {
private keyCache;
private jwksClientInstance;
private config;
constructor();
initialize(config: JWKSConfig): void;
static createCognitoConfig(region: string, userPoolId: string, clientId?: string, clientSecret?: string): JWKSConfig;
getPublicKey(kid: string): Promise<string>;
validateTokenWithJWKS(token: string): Promise<jwt.JwtPayload | string>;
validateCognitoToken(token: string): Promise<jwt.JwtPayload | string>;
invalidateCache(): void;
getCacheStats(): JWKSStats;
getClientSecret(): string | undefined;
hasClientSecret(): boolean;
calculateSecretHash(identifier: string): string;
reset(): void;
}
//# sourceMappingURL=jwks-service.d.ts.map