@prove-identity/prove-auth 2.4.4 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/index.d.ts +3 -1
- package/build/lib/index.js +3 -1
- package/build/lib/proveauth/authenticator-builder.d.ts +13 -1
- package/build/lib/proveauth/authenticator-builder.js +123 -6
- package/build/lib/proveauth/device-context-options.d.ts +19 -0
- package/build/lib/proveauth/device-context-options.js +19 -0
- package/build/lib/proveauth/internal/auth-request.d.ts +12 -0
- package/build/lib/proveauth/internal/auth-response.d.ts +1 -0
- package/build/lib/proveauth/internal/auth-session.d.ts +15 -8
- package/build/lib/proveauth/internal/auth-session.js +106 -21
- package/build/lib/proveauth/internal/auth-status-actions.d.ts +5 -0
- package/build/lib/proveauth/internal/auth-status-actions.js +48 -0
- package/build/lib/proveauth/internal/auth-token-claims.d.ts +9 -0
- package/build/lib/proveauth/internal/device-auth.d.ts +4 -1
- package/build/lib/proveauth/internal/device-passive-register-step.js +10 -9
- package/build/lib/proveauth/internal/device-passive-silent-step.d.ts +7 -1
- package/build/lib/proveauth/internal/device-passive-silent-step.js +43 -14
- package/build/lib/proveauth/internal/device-passive-step.d.ts +2 -1
- package/build/lib/proveauth/internal/device-passive-step.js +4 -3
- package/build/lib/proveauth/internal/device-passive-verify-step.d.ts +2 -0
- package/build/lib/proveauth/internal/device-passive-verify-step.js +18 -0
- package/build/lib/proveauth/internal/device-universal-redirect-steps.d.ts +14 -0
- package/build/lib/proveauth/internal/device-universal-redirect-steps.js +55 -0
- package/build/lib/proveauth/internal/device-universal-step.d.ts +10 -0
- package/build/lib/proveauth/internal/device-universal-step.js +38 -0
- package/build/lib/proveauth/internal/{base-authenticator.d.ts → main-authenticator.d.ts} +8 -5
- package/build/lib/proveauth/internal/{base-authenticator.js → main-authenticator.js} +61 -17
- package/build/lib/proveauth/internal/mobile-instantlink-step.d.ts +2 -1
- package/build/lib/proveauth/internal/mobile-instantlink-step.js +9 -5
- package/build/lib/proveauth/internal/platform.d.ts +6 -1
- package/build/lib/proveauth/internal/report-error-step.d.ts +2 -2
- package/build/lib/proveauth/internal/report-error-step.js +11 -8
- package/build/lib/proveauth/internal/settings.d.ts +1 -0
- package/build/lib/proveauth/internal/settings.js +1 -0
- package/build/lib/proveauth/internal/web-device-auth.d.ts +4 -1
- package/build/lib/proveauth/internal/web-device-auth.js +6 -0
- package/build/lib/proveauth/internal/web-platform.d.ts +8 -1
- package/build/lib/proveauth/internal/web-platform.js +14 -2
- package/build/lib/proveauth/user-consent-step.d.ts +7 -0
- package/build/lib/proveauth/user-consent-step.js +2 -0
- package/build/lib/proveauth/version.d.ts +2 -2
- package/build/lib/proveauth/version.js +2 -2
- package/package.json +12 -3
- package/build/lib/proveauth/internal/primary-authenticator.d.ts +0 -14
- package/build/lib/proveauth/internal/primary-authenticator.js +0 -64
- package/build/lib/proveauth/internal/secondary-authenticator.d.ts +0 -10
- package/build/lib/proveauth/internal/secondary-authenticator.js +0 -65
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const logger_1 = require("../common/logger");
|
|
7
7
|
const auth_error_1 = __importDefault(require("./auth-error"));
|
|
8
|
-
const
|
|
8
|
+
const main_authenticator_1 = __importDefault(require("./main-authenticator"));
|
|
9
9
|
const device_passive_register_step_1 = __importDefault(require("./device-passive-register-step"));
|
|
10
10
|
const device_passive_silent_step_1 = __importDefault(require("./device-passive-silent-step"));
|
|
11
11
|
const device_passive_step_1 = __importDefault(require("./device-passive-step"));
|
|
@@ -14,6 +14,7 @@ const mobile_instant_step_1 = __importDefault(require("./mobile-instant-step"));
|
|
|
14
14
|
const mobile_instantlink_step_1 = __importDefault(require("./mobile-instantlink-step"));
|
|
15
15
|
const mobile_otp_step_1 = __importDefault(require("./mobile-otp-step"));
|
|
16
16
|
const user_present_step_1 = __importDefault(require("./user-present-step"));
|
|
17
|
+
const device_universal_redirect_steps_1 = require("./device-universal-redirect-steps");
|
|
17
18
|
class ReportErrorStep {
|
|
18
19
|
constructor(error) {
|
|
19
20
|
this.logger = logger_1.LoggerFactory.getLogger('report-error-step');
|
|
@@ -49,14 +50,14 @@ class ReportErrorStep {
|
|
|
49
50
|
logMessage = logMessage + ', message: ' + this._message;
|
|
50
51
|
}
|
|
51
52
|
this.logger.error(logMessage);
|
|
52
|
-
if (this.nextStep ===
|
|
53
|
-
return Promise.resolve(
|
|
53
|
+
if (this.nextStep === main_authenticator_1.default.AUTH_DONE) {
|
|
54
|
+
return Promise.resolve(main_authenticator_1.default.AUTH_DONE);
|
|
54
55
|
}
|
|
55
56
|
else if (!this.nextStep || this.reportable) {
|
|
56
57
|
return new Promise((resolve, reject) => {
|
|
57
|
-
const
|
|
58
|
+
const error = this.lookupError(session.lastStep);
|
|
58
59
|
session
|
|
59
|
-
.fetchFromBackend(`/v1/client/${
|
|
60
|
+
.fetchFromBackend(`/v1/client/${error}/error`, {
|
|
60
61
|
code: this._code ? this._code : undefined,
|
|
61
62
|
message: this._message,
|
|
62
63
|
})
|
|
@@ -70,12 +71,12 @@ class ReportErrorStep {
|
|
|
70
71
|
return Promise.resolve(this.nextStep);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
lookupError(last) {
|
|
74
75
|
const defaultKind = 'device/passive';
|
|
75
|
-
return last ? ReportErrorStep.
|
|
76
|
+
return last ? ReportErrorStep.errorMap.get(last) || defaultKind : defaultKind;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
ReportErrorStep.
|
|
79
|
+
ReportErrorStep.errorMap = new Map([
|
|
79
80
|
[device_passive_step_1.default.NAME, 'device/passive'],
|
|
80
81
|
[device_passive_silent_step_1.default.NAME, 'device/passive'],
|
|
81
82
|
[device_passive_register_step_1.default.NAME, 'device/fido2'],
|
|
@@ -84,5 +85,7 @@ ReportErrorStep.errorKinds = new Map([
|
|
|
84
85
|
[mobile_instantlink_step_1.default.NAME, 'mobile/instantlink'],
|
|
85
86
|
[mobile_otp_step_1.default.NAME, 'mobile/otp'],
|
|
86
87
|
[user_present_step_1.default.NAME, 'user/mobileactive'],
|
|
88
|
+
[device_universal_redirect_steps_1.DeviceUniversalRedirectExchangeStep.NAME, 'device/universal'],
|
|
89
|
+
[device_universal_redirect_steps_1.DeviceUniversalRedirectFinishStep.NAME, 'device/universal'],
|
|
87
90
|
]);
|
|
88
91
|
exports.default = ReportErrorStep;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { AuthRegistration } from './auth-request';
|
|
1
|
+
import { AuthRegistration, Signal, Signals } from './auth-request';
|
|
2
2
|
import DeviceAuth, { DeviceRegistration, DeviceRegistrationOptions } from './device-auth';
|
|
3
3
|
export declare class WebDeviceRegistration implements DeviceRegistration {
|
|
4
4
|
private keys?;
|
|
5
5
|
deviceId: string | null;
|
|
6
|
+
fingerprint?: Signal;
|
|
6
7
|
readonly namespace: string;
|
|
7
8
|
readonly keyId: string;
|
|
8
9
|
readonly algorithm: string;
|
|
9
10
|
readonly endpoint: string;
|
|
10
11
|
readonly createdAt: number;
|
|
11
12
|
constructor(options: DeviceRegistrationOptions | any);
|
|
13
|
+
setFpSignal(fingerprintSignal: Signal): void;
|
|
12
14
|
sign(data: string): Promise<string>;
|
|
13
15
|
getPublicKey(): Promise<string>;
|
|
14
16
|
getAuthRegistration(challenge: string): Promise<AuthRegistration>;
|
|
17
|
+
getSignals(): Signals | undefined;
|
|
15
18
|
private initialize;
|
|
16
19
|
private p1363ToDer;
|
|
17
20
|
private lenVal;
|
|
@@ -25,6 +25,9 @@ class WebDeviceRegistration {
|
|
|
25
25
|
this.createdAt = (0, platform_1.getUnixTime)();
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
setFpSignal(fingerprintSignal) {
|
|
29
|
+
this.fingerprint = fingerprintSignal;
|
|
30
|
+
}
|
|
28
31
|
sign(data) {
|
|
29
32
|
return new Promise((resolve, reject) => {
|
|
30
33
|
this.initialize()
|
|
@@ -80,6 +83,9 @@ class WebDeviceRegistration {
|
|
|
80
83
|
.catch(reject);
|
|
81
84
|
});
|
|
82
85
|
}
|
|
86
|
+
getSignals() {
|
|
87
|
+
return this.fingerprint ? { fingerprint: this.fingerprint } : undefined;
|
|
88
|
+
}
|
|
83
89
|
initialize() {
|
|
84
90
|
return new Promise((resolve, reject) => {
|
|
85
91
|
if (this.keys) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="webappsec-credential-management" />
|
|
1
2
|
import { AuthenticatorBuilder } from '@prove-identity/mobile-auth';
|
|
2
3
|
import Platform, { AuthSessionIntegration, MessageChannel, RequestSigner } from './platform';
|
|
3
4
|
import WebDeviceAuth from './web-device-auth';
|
|
5
|
+
import { Agent } from '@fingerprintjs/fingerprintjs-pro';
|
|
4
6
|
export declare class WebSocketMessageChannel implements MessageChannel {
|
|
5
7
|
private readonly webSocket;
|
|
6
8
|
constructor(endpointUrl: string);
|
|
@@ -9,6 +11,7 @@ export declare class WebSocketMessageChannel implements MessageChannel {
|
|
|
9
11
|
close(): void;
|
|
10
12
|
}
|
|
11
13
|
export declare class WebPlatform implements Platform {
|
|
14
|
+
private fpPromise;
|
|
12
15
|
readonly webauthn: {
|
|
13
16
|
getCredentials: (options?: CredentialRequestOptions) => Promise<CredentialType | null>;
|
|
14
17
|
createCredentials: (options: CredentialCreationOptions) => Promise<CredentialType | null>;
|
|
@@ -18,7 +21,7 @@ export declare class WebPlatform implements Platform {
|
|
|
18
21
|
getUserAgent(): string | null;
|
|
19
22
|
isFidoSupported(): boolean;
|
|
20
23
|
fetch(input: string, init?: RequestInit): Promise<Response>;
|
|
21
|
-
createMessageChannel(
|
|
24
|
+
createMessageChannel(input: string): MessageChannel;
|
|
22
25
|
createRequestSigner(session: AuthSessionIntegration): RequestSigner;
|
|
23
26
|
private getBrowserName;
|
|
24
27
|
private getBrowserVersion;
|
|
@@ -26,4 +29,8 @@ export declare class WebPlatform implements Platform {
|
|
|
26
29
|
getDeviceCapabilities(): string[];
|
|
27
30
|
getMobileAuthBuilder(): AuthenticatorBuilder<any>;
|
|
28
31
|
exit(code?: number): void;
|
|
32
|
+
urlRedirect(url: string): void;
|
|
33
|
+
getFpPromise(): Promise<Agent> | undefined;
|
|
34
|
+
setFpPromise(fpPromise: Promise<Agent>): void;
|
|
35
|
+
getOrigin(): string;
|
|
29
36
|
}
|
|
@@ -47,8 +47,8 @@ class WebPlatform {
|
|
|
47
47
|
fetch(input, init) {
|
|
48
48
|
return fetch(input, init);
|
|
49
49
|
}
|
|
50
|
-
createMessageChannel(
|
|
51
|
-
return new WebSocketMessageChannel(
|
|
50
|
+
createMessageChannel(input) {
|
|
51
|
+
return new WebSocketMessageChannel(input);
|
|
52
52
|
}
|
|
53
53
|
createRequestSigner(session) {
|
|
54
54
|
return new request_signer_v3_1.default(session);
|
|
@@ -156,5 +156,17 @@ class WebPlatform {
|
|
|
156
156
|
}
|
|
157
157
|
exit(code) {
|
|
158
158
|
}
|
|
159
|
+
urlRedirect(url) {
|
|
160
|
+
window.location.replace(url);
|
|
161
|
+
}
|
|
162
|
+
getFpPromise() {
|
|
163
|
+
return this.fpPromise;
|
|
164
|
+
}
|
|
165
|
+
setFpPromise(fpPromise) {
|
|
166
|
+
this.fpPromise = fpPromise;
|
|
167
|
+
}
|
|
168
|
+
getOrigin() {
|
|
169
|
+
return window.location.origin;
|
|
170
|
+
}
|
|
159
171
|
}
|
|
160
172
|
exports.WebPlatform = WebPlatform;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
2
|
-
export declare const API_CONTRACT_VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.7.0";
|
|
2
|
+
export declare const API_CONTRACT_VERSION = "2.8.0";
|
|
3
3
|
export declare const USER_AGENT_VERSIONS: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.USER_AGENT_VERSIONS = exports.API_CONTRACT_VERSION = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '2.
|
|
5
|
-
exports.API_CONTRACT_VERSION = '2.
|
|
4
|
+
exports.VERSION = '2.7.0';
|
|
5
|
+
exports.API_CONTRACT_VERSION = '2.8.0';
|
|
6
6
|
exports.USER_AGENT_VERSIONS = `ProveAuth/${exports.VERSION} Contract/${exports.API_CONTRACT_VERSION} WEB/1`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prove-identity/prove-auth",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Prove Auth SDK for Web",
|
|
5
5
|
"main": "build/lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"build/lib/index.d.ts",
|
|
12
12
|
"build/lib/proveauth/**/*.js",
|
|
13
13
|
"build/lib/proveauth/**/*.js.map",
|
|
14
|
-
"build/lib/proveauth/**/*.d.ts"
|
|
14
|
+
"build/lib/proveauth/**/*.d.ts",
|
|
15
|
+
"build/bundle/release/*.js"
|
|
15
16
|
],
|
|
16
17
|
"types": "build/lib/index.d.ts",
|
|
17
18
|
"scripts": {
|
|
@@ -67,5 +68,13 @@
|
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
70
|
"@prove-identity/mobile-auth": "^3.0.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@fingerprintjs/fingerprintjs-pro": "^3.11.0"
|
|
74
|
+
},
|
|
75
|
+
"peerDependenciesMeta": {
|
|
76
|
+
"@fingerprintjs/fingerprintjs-pro": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
70
79
|
}
|
|
71
|
-
}
|
|
80
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import AuthFinishStep from '../auth-finish-step';
|
|
2
|
-
import AuthStep from './auth-step';
|
|
3
|
-
import AuthSession from './auth-session';
|
|
4
|
-
import Platform from './platform';
|
|
5
|
-
import CancelablePromise from '../common/cancelable-promise';
|
|
6
|
-
import BaseAuthenticator from './base-authenticator';
|
|
7
|
-
export default class PrimaryAuthenticator extends BaseAuthenticator {
|
|
8
|
-
static readonly MAX_ATTEMPTS = 50;
|
|
9
|
-
private readonly steps;
|
|
10
|
-
constructor(platform?: Platform, storage?: Storage, finishStep?: AuthFinishStep, steps?: Array<AuthStep>);
|
|
11
|
-
process(session: AuthSession): CancelablePromise<void>;
|
|
12
|
-
private nextStep;
|
|
13
|
-
private getNextStep;
|
|
14
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const report_error_step_1 = __importDefault(require("./report-error-step"));
|
|
7
|
-
const logger_1 = require("../common/logger");
|
|
8
|
-
const cancelable_promise_1 = __importDefault(require("../common/cancelable-promise"));
|
|
9
|
-
const base_authenticator_1 = __importDefault(require("./base-authenticator"));
|
|
10
|
-
const auth_error_1 = __importDefault(require("./auth-error"));
|
|
11
|
-
const error_code_1 = __importDefault(require("./error-code"));
|
|
12
|
-
class PrimaryAuthenticator extends base_authenticator_1.default {
|
|
13
|
-
constructor(platform, storage, finishStep, steps) {
|
|
14
|
-
super(platform, storage, finishStep);
|
|
15
|
-
this.steps = new Map();
|
|
16
|
-
this.log = logger_1.LoggerFactory.getLogger('primary-authenticator');
|
|
17
|
-
if (steps) {
|
|
18
|
-
for (let step of steps) {
|
|
19
|
-
this.steps.set(step.name, step);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
process(session) {
|
|
24
|
-
return new cancelable_promise_1.default((resolve, reject, onCancel) => {
|
|
25
|
-
onCancel(() => {
|
|
26
|
-
this.log.info('Canceled');
|
|
27
|
-
resolve();
|
|
28
|
-
});
|
|
29
|
-
this.nextStep(session, session.next, 1).then(resolve).catch(reject);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
nextStep(session, step, attempt) {
|
|
33
|
-
this.log.debug(`Authentication attempt ${attempt}, next step: ${step}`);
|
|
34
|
-
session.lastStep = step;
|
|
35
|
-
return new Promise((resolve, reject) => {
|
|
36
|
-
if ([base_authenticator_1.default.AUTH_DONE, base_authenticator_1.default.AUTH_EMPTY].includes(step)) {
|
|
37
|
-
resolve();
|
|
38
|
-
}
|
|
39
|
-
else if (attempt > PrimaryAuthenticator.MAX_ATTEMPTS) {
|
|
40
|
-
reject(new auth_error_1.default('Too many authentication steps', error_code_1.default.ERROR_MAX_ATTEMPTS));
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.getNextStep(step)
|
|
44
|
-
.execute(session)
|
|
45
|
-
.then((next) => this.nextStep(session, next, attempt + 1))
|
|
46
|
-
.then(resolve)
|
|
47
|
-
.catch((e) => new report_error_step_1.default(e)
|
|
48
|
-
.execute(session)
|
|
49
|
-
.then((next) => this.nextStep(session, next, attempt + 1))
|
|
50
|
-
.then(resolve)
|
|
51
|
-
.catch(reject));
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
getNextStep(step) {
|
|
56
|
-
var nextStep = this.steps.get(step);
|
|
57
|
-
if (nextStep) {
|
|
58
|
-
return nextStep;
|
|
59
|
-
}
|
|
60
|
-
return new report_error_step_1.default('Unknown authentication step: ' + step);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
PrimaryAuthenticator.MAX_ATTEMPTS = 50;
|
|
64
|
-
exports.default = PrimaryAuthenticator;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import AuthFinishStep from '../auth-finish-step';
|
|
2
|
-
import AuthSession from './auth-session';
|
|
3
|
-
import Platform from './platform';
|
|
4
|
-
import CancelablePromise from '../common/cancelable-promise';
|
|
5
|
-
import AuthStep from './auth-step';
|
|
6
|
-
import PrimaryAuthenticator from './primary-authenticator';
|
|
7
|
-
export default class SecondaryAuthenticator extends PrimaryAuthenticator {
|
|
8
|
-
constructor(platform?: Platform, storage?: Storage, finishStep?: AuthFinishStep, steps?: Array<AuthStep>);
|
|
9
|
-
process(session: AuthSession): CancelablePromise<void>;
|
|
10
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const logger_1 = require("../common/logger");
|
|
7
|
-
const cancelable_promise_1 = __importDefault(require("../common/cancelable-promise"));
|
|
8
|
-
const auth_error_1 = __importDefault(require("./auth-error"));
|
|
9
|
-
const primary_authenticator_1 = __importDefault(require("./primary-authenticator"));
|
|
10
|
-
class SecondaryAuthenticator extends primary_authenticator_1.default {
|
|
11
|
-
constructor(platform, storage, finishStep, steps) {
|
|
12
|
-
super(platform, storage, finishStep, steps);
|
|
13
|
-
this.log = logger_1.LoggerFactory.getLogger('secondary-authenticator');
|
|
14
|
-
}
|
|
15
|
-
process(session) {
|
|
16
|
-
return new cancelable_promise_1.default((resolve, reject, onCancel) => {
|
|
17
|
-
var gotResponse = false;
|
|
18
|
-
var channel;
|
|
19
|
-
var runSteps = super.process(session);
|
|
20
|
-
runSteps
|
|
21
|
-
.then(() => {
|
|
22
|
-
channel = session.createMessageChannel('/v1/client/status', () => {
|
|
23
|
-
if (!gotResponse) {
|
|
24
|
-
reject(new auth_error_1.default('Failed to receive secondary authentication status, no response'));
|
|
25
|
-
}
|
|
26
|
-
}, (errorMessage) => {
|
|
27
|
-
gotResponse = true;
|
|
28
|
-
this.log.error('Failed: ' + errorMessage);
|
|
29
|
-
reject(new auth_error_1.default('Failed to receive secondary authentication status: ' + errorMessage));
|
|
30
|
-
}, (data) => {
|
|
31
|
-
gotResponse = true;
|
|
32
|
-
try {
|
|
33
|
-
this.log.debug(('Secondary authentication status: ' + data));
|
|
34
|
-
const response = JSON.parse(data);
|
|
35
|
-
if (response.error) {
|
|
36
|
-
reject(new auth_error_1.default(response.error.message, response.error.code, response.next));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
session.lastStep = response.next;
|
|
40
|
-
resolve();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
reject(e);
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
channel.close();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
.catch(reject);
|
|
52
|
-
onCancel(() => {
|
|
53
|
-
gotResponse = true;
|
|
54
|
-
if (runSteps) {
|
|
55
|
-
runSteps.cancel();
|
|
56
|
-
}
|
|
57
|
-
if (channel) {
|
|
58
|
-
channel.close();
|
|
59
|
-
}
|
|
60
|
-
resolve();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.default = SecondaryAuthenticator;
|