UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

25 lines 981 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthenticationMaterial = void 0; const AbstractAuthMaterial_1 = require("./AbstractAuthMaterial"); const token_1 = require("./token"); const AuthMethod_1 = require("./AuthMethod"); const configuration_1 = require("../../../configuration"); class AuthenticationMaterial extends AbstractAuthMaterial_1.AbstractAuthMaterial { constructor(user, password) { super(); this.userName = user; this.password = password; } getCredentials() { return new token_1.Credentials(this.userName, this.password); } getRawAuthHeader() { return AuthMethod_1.AuthMethods.BASIC_AUTHORIZATION.getKey() + " " + this.getToken(); } getToken() { return configuration_1.wsclientConfiguration.btoa(this.userName + ":" + this.password); } } exports.AuthenticationMaterial = AuthenticationMaterial; //# sourceMappingURL=AuthenticationMaterial.js.map