/** * State Parameter Utilities for CSRF Protection * * Provides cryptographically secure state parameter generation * and constant-time comparison for OAuth CSRF protection. */ /** * Generate a cryptographically secure state parameter * * Creates a 32-byte random state parameter for CSRF protection * in OAuth flows. This state is stored in the session and must * match when the OAuth provider redirects back. * * @returns Hex-encoded 32-byte random string (64 characters) */ export declare function generateState(): string; /** * Validate state parameter using constant-time comparison * * Compares the provided state with the stored state using a * constant-time algorithm to prevent timing attacks. * * @param provided - State parameter from OAuth provider callback * @param stored - State parameter stored in session * @returns true if states match, false otherwise */ export declare function validateState(provided: string, stored: string): boolean; /** * Generate a session ID for OAuth flow tracking * * Creates a unique session identifier for correlating OAuth * initiation with callback. * * @returns Hex-encoded random string */ export declare function generateSessionId(): string;