ltijs
Version:
Easily turn your web application into a LTI 1.3 Learning Tool.
45 lines (44 loc) • 2.34 kB
TypeScript
import type { DatabaseManager } from '#services/database-manager/database-manager.types';
import type { Platform } from '#services/platform-manager/platform-manager.types';
import type { RequestHandler } from '#services/request-handler/request-handler.types';
import type { CacheManager } from '#services/cache-manager/cache-manager.types';
import type { Logger } from '#services/logger/logger.types';
import type { DecodedToken, TokenHeader } from '#utils/crypto/jwt.types';
import type { AuthenticationRequestParams, State, StorageTarget, TargetLinkUriState } from '#services/oidc/oidc.types';
export declare class OidcService {
private readonly LOG_COMPONENT;
private readonly STATE_TTL_SECONDS;
private readonly OIDC_RESPONSE_TYPE;
private readonly OIDC_RESPONSE_MODE;
private readonly OIDC_SCOPE;
private readonly OIDC_PROMPT;
private readonly JWKS_CACHE_TTL_MS;
private readonly JWKS_CACHE_KEY_PREFIX;
private readonly databaseManager;
private readonly requestHandler;
private readonly cacheManager;
private readonly logger;
private readonly tokenMaxAge;
constructor(databaseManager: DatabaseManager, requestHandler: RequestHandler, cacheManager: CacheManager, logger: Logger, tokenMaxAge: number | false);
validateIdToken(rawIdToken: string, header: TokenHeader, platform: Platform): Promise<DecodedToken>;
buildStateToken(platform: Platform, target?: TargetLinkUriState, storage?: StorageTarget, stateId?: string): string;
validateStateToken(token: string, platform: Platform): Promise<State>;
buildRecoveryToken(stateId: string, platform: Platform): string;
verifyRecoveryToken(token: string, platform: Platform): string;
verifyRecoveredState(recoveredToken: string, stateToken: string, platform: Platform): void;
buildAuthenticationRequestUrl(platform: Platform, request: AuthenticationRequestParams): Promise<string>;
private buildAuthenticationRequestQuery;
private buildRedirectUrl;
private claimValidation;
private resolveClaimSchema;
private resolveVerificationKey;
private resolveJwk;
private buildJwksCacheKey;
private resolveJwks;
private runAdditionalOidcValidation;
private validateAud;
private validateMaxAge;
private validateAlg;
private validateNonce;
}
export default OidcService;