@okta/okta-auth-js 5.9.1 → 5.10.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/CHANGELOG.md +14 -0
- package/README.md +12 -2
- package/cjs/OktaAuth.js +25 -12
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/OktaUserAgent.js.map +1 -1
- package/cjs/TokenManager.js +24 -2
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +14 -0
- package/cjs/idx/authenticator/Authenticator.js.map +1 -0
- package/cjs/idx/authenticator/OktaPassword.js +31 -0
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js +17 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +50 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +31 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +34 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/getAuthenticator.js +42 -0
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/index.js +80 -0
- package/cjs/idx/authenticator/index.js.map +1 -0
- package/cjs/idx/cancel.js +5 -0
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +2 -0
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js +1 -11
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js +1 -0
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js +0 -52
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/index.js +13 -0
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +8 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/poll.js +59 -0
- package/cjs/idx/poll.js.map +1 -0
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/register.js +14 -3
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +37 -90
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +9 -12
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +6 -9
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +43 -32
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +51 -20
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +16 -16
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +8 -28
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/{lib/idx/flow/FlowMonitor.d.ts → cjs/idx/remediators/ChallengePoll.js} +16 -13
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -0
- package/cjs/idx/remediators/EnrollPoll.js +56 -0
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -0
- package/cjs/idx/remediators/Identify.js +2 -35
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +23 -2
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +7 -0
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +26 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/run.js +0 -8
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +2 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/types/Token.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.umd.js +1 -1
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/index.js +1409 -1197
- package/esm/index.js.map +1 -1
- package/lib/TokenManager.d.ts +2 -0
- package/lib/idx/authenticator/Authenticator.d.ts +12 -0
- package/lib/idx/authenticator/OktaPassword.d.ts +11 -0
- package/lib/idx/authenticator/OktaVerifyTotp.d.ts +9 -0
- package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +28 -0
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +14 -0
- package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +10 -0
- package/lib/idx/authenticator/getAuthenticator.d.ts +3 -0
- package/lib/idx/authenticator/index.d.ts +6 -0
- package/lib/idx/flow/FlowSpecification.d.ts +0 -2
- package/lib/idx/flow/index.d.ts +0 -4
- package/lib/idx/index.d.ts +1 -0
- package/lib/idx/interact.d.ts +1 -0
- package/lib/idx/{flow/AuthenticationFlowMonitor.d.ts → poll.d.ts} +3 -5
- package/lib/idx/proceed.d.ts +2 -1
- package/lib/idx/register.d.ts +1 -1
- package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +9 -5
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +0 -1
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +8 -3
- package/lib/idx/remediators/Base/Remediator.d.ts +9 -6
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +5 -4
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +8 -4
- package/lib/idx/{flow/RegistrationFlowMonitor.d.ts → remediators/ChallengePoll.d.ts} +3 -3
- package/lib/idx/{flow/PasswordRecoveryFlowMonitor.d.ts → remediators/EnrollPoll.d.ts} +12 -4
- package/lib/idx/remediators/Identify.d.ts +0 -3
- package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +6 -2
- package/lib/idx/remediators/Skip.d.ts +3 -0
- package/lib/idx/remediators/index.d.ts +2 -0
- package/lib/idx/run.d.ts +1 -2
- package/lib/idx/types/idx-js.d.ts +49 -1
- package/lib/idx/types/index.d.ts +8 -2
- package/lib/types/OktaAuthOptions.d.ts +1 -0
- package/lib/types/Token.d.ts +1 -0
- package/lib/types/api.d.ts +4 -2
- package/package.json +6 -8
- package/cjs/idx/flow/AuthenticationFlowMonitor.js +0 -45
- package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/FlowMonitor.js +0 -69
- package/cjs/idx/flow/FlowMonitor.js.map +0 -1
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js +0 -55
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/RegistrationFlowMonitor.js +0 -35
- package/cjs/idx/flow/RegistrationFlowMonitor.js.map +0 -1
package/lib/TokenManager.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export declare class TokenManager implements TokenManagerInterface {
|
|
|
44
44
|
validateToken(token: Token): void;
|
|
45
45
|
renew(key: any): Promise<Token>;
|
|
46
46
|
clear(): void;
|
|
47
|
+
clearPendingRemoveTokens(): void;
|
|
47
48
|
getTokensFromStorageValue(value: any): any;
|
|
48
49
|
updateRefreshToken(token: RefreshToken): void;
|
|
50
|
+
addPendingRemoveFlags(): void;
|
|
49
51
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RemediationValues } from '../remediators';
|
|
2
|
+
import { IdxAuthenticator, IdxRemediationValue } from '../types/idx-js';
|
|
3
|
+
export interface Credentials {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}
|
|
6
|
+
export declare abstract class Authenticator {
|
|
7
|
+
meta: IdxAuthenticator;
|
|
8
|
+
constructor(authenticator: IdxAuthenticator);
|
|
9
|
+
abstract canVerify(values: RemediationValues): boolean;
|
|
10
|
+
abstract mapCredentials(values: RemediationValues): Credentials;
|
|
11
|
+
abstract getInputs(idxRemediationValue: IdxRemediationValue): any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Authenticator } from './Authenticator';
|
|
2
|
+
export declare type OktaPasswordInputValues = {
|
|
3
|
+
password: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class OktaPassword extends Authenticator {
|
|
6
|
+
canVerify(values: any): boolean;
|
|
7
|
+
mapCredentials(values: any): {
|
|
8
|
+
passcode: any;
|
|
9
|
+
};
|
|
10
|
+
getInputs(idxRemediationValue: any): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Credentials } from './Authenticator';
|
|
2
|
+
import { VerificationCodeAuthenticator } from './VerificationCodeAuthenticator';
|
|
3
|
+
interface TotpCredentials extends Credentials {
|
|
4
|
+
totp: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class OktaVerifyTotp extends VerificationCodeAuthenticator {
|
|
7
|
+
mapCredentials(values: any): TotpCredentials;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Authenticator } from './Authenticator';
|
|
2
|
+
export declare class SecurityQuestionEnrollment extends Authenticator {
|
|
3
|
+
canVerify(values: any): any;
|
|
4
|
+
mapCredentials(values: any): {
|
|
5
|
+
questionKey: any;
|
|
6
|
+
question: any;
|
|
7
|
+
answer: any;
|
|
8
|
+
};
|
|
9
|
+
getInputs(): ({
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
require: boolean;
|
|
13
|
+
label?: undefined;
|
|
14
|
+
required?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
label: string;
|
|
19
|
+
require?: undefined;
|
|
20
|
+
required?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
label: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
require?: undefined;
|
|
27
|
+
})[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Authenticator } from './Authenticator';
|
|
2
|
+
export declare class SecurityQuestionVerification extends Authenticator {
|
|
3
|
+
canVerify(values: any): any;
|
|
4
|
+
mapCredentials(values: any): {
|
|
5
|
+
questionKey: string;
|
|
6
|
+
answer: any;
|
|
7
|
+
};
|
|
8
|
+
getInputs(): {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
label: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Authenticator, Credentials } from './Authenticator';
|
|
2
|
+
interface VerificationCodeCredentials extends Credentials {
|
|
3
|
+
passcode: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class VerificationCodeAuthenticator extends Authenticator {
|
|
6
|
+
canVerify(values: any): boolean;
|
|
7
|
+
mapCredentials(values: any): VerificationCodeCredentials | Credentials;
|
|
8
|
+
getInputs(idxRemediationValue: any): any;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { OktaAuth, FlowIdentifier } from '../../types';
|
|
2
|
-
import { FlowMonitor } from './FlowMonitor';
|
|
3
2
|
import { RemediationFlow } from './RemediationFlow';
|
|
4
3
|
export interface FlowSpecification {
|
|
5
4
|
flow: FlowIdentifier;
|
|
6
5
|
remediators: RemediationFlow;
|
|
7
|
-
flowMonitor: FlowMonitor;
|
|
8
6
|
actions?: string[];
|
|
9
7
|
}
|
|
10
8
|
export declare function getFlowSpecification(oktaAuth: OktaAuth, flow?: FlowIdentifier): FlowSpecification;
|
package/lib/idx/flow/index.d.ts
CHANGED
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
export * from './AuthenticationFlow';
|
|
13
|
-
export * from './AuthenticationFlowMonitor';
|
|
14
|
-
export * from './FlowMonitor';
|
|
15
13
|
export * from './FlowSpecification';
|
|
16
14
|
export * from './PasswordRecoveryFlow';
|
|
17
|
-
export * from './PasswordRecoveryFlowMonitor';
|
|
18
15
|
export * from './RegistrationFlow';
|
|
19
|
-
export * from './RegistrationFlowMonitor';
|
|
20
16
|
export * from './RemediationFlow';
|
package/lib/idx/index.d.ts
CHANGED
package/lib/idx/interact.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
3
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
4
|
*
|
|
5
5
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
@@ -9,7 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
export declare
|
|
14
|
-
isRemediatorCandidate(remediator: any, remediations?: any, values?: any): boolean;
|
|
15
|
-
}
|
|
12
|
+
import { IdxPollOptions, IdxTransaction, OktaAuth } from '../types';
|
|
13
|
+
export declare function poll(authClient: OktaAuth, options?: IdxPollOptions): Promise<IdxTransaction>;
|
package/lib/idx/proceed.d.ts
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { OktaAuth, IdxTransaction } from '../types';
|
|
13
13
|
import { AuthenticationOptions } from './authenticate';
|
|
14
|
+
import { EnrollPollValues as EnrollPollOptions } from './remediators';
|
|
14
15
|
import { RegistrationOptions } from './register';
|
|
15
16
|
import { PasswordRecoveryOptions } from './recoverPassword';
|
|
16
|
-
export declare type ProceedOptions = AuthenticationOptions & RegistrationOptions & PasswordRecoveryOptions;
|
|
17
|
+
export declare type ProceedOptions = AuthenticationOptions & RegistrationOptions & PasswordRecoveryOptions & EnrollPollOptions;
|
|
17
18
|
export declare function canProceed(authClient: OktaAuth, options?: {
|
|
18
19
|
state?: string;
|
|
19
20
|
}): boolean;
|
package/lib/idx/register.d.ts
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
import { EnrollProfileValues, SelectAuthenticatorEnrollValues, EnrollAuthenticatorValues, AuthenticatorEnrollmentDataValues, SkipValues } from './remediators';
|
|
13
13
|
import { IdxOptions, IdxTransaction, OktaAuth } from '../types';
|
|
14
14
|
export declare type RegistrationOptions = IdxOptions & EnrollProfileValues & SelectAuthenticatorEnrollValues & EnrollAuthenticatorValues & AuthenticatorEnrollmentDataValues & SkipValues;
|
|
15
|
-
export declare function register(authClient: OktaAuth, options
|
|
15
|
+
export declare function register(authClient: OktaAuth, options?: RegistrationOptions): Promise<IdxTransaction>;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { AuthenticatorData, AuthenticatorDataValues } from './Base/AuthenticatorData';
|
|
13
|
-
import { Authenticator } from '../types';
|
|
14
13
|
export declare type AuthenticatorEnrollmentDataValues = AuthenticatorDataValues & {
|
|
15
14
|
phoneNumber?: string;
|
|
16
15
|
resend?: boolean;
|
|
@@ -18,16 +17,21 @@ export declare type AuthenticatorEnrollmentDataValues = AuthenticatorDataValues
|
|
|
18
17
|
export declare class AuthenticatorEnrollmentData extends AuthenticatorData {
|
|
19
18
|
static remediationName: string;
|
|
20
19
|
values: AuthenticatorEnrollmentDataValues;
|
|
21
|
-
canRemediate(): boolean;
|
|
22
20
|
mapAuthenticator(): {
|
|
23
21
|
id: string;
|
|
24
22
|
methodType: string;
|
|
25
23
|
phoneNumber: string;
|
|
26
24
|
};
|
|
27
|
-
getInputAuthenticator(): {
|
|
25
|
+
getInputAuthenticator(): ({
|
|
28
26
|
name: string;
|
|
29
27
|
type: string;
|
|
30
28
|
required: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
label?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: string;
|
|
33
|
+
required: boolean;
|
|
34
|
+
label: string;
|
|
35
|
+
})[];
|
|
36
|
+
protected mapAuthenticatorDataFromValues(data?: any): any;
|
|
33
37
|
}
|
|
@@ -14,7 +14,6 @@ export declare type AuthenticatorVerificationDataValues = AuthenticatorDataValue
|
|
|
14
14
|
export declare class AuthenticatorVerificationData extends AuthenticatorData {
|
|
15
15
|
static remediationName: string;
|
|
16
16
|
values: AuthenticatorVerificationDataValues;
|
|
17
|
-
canRemediate(): boolean;
|
|
18
17
|
mapAuthenticator(): {
|
|
19
18
|
id: string;
|
|
20
19
|
enrollmentId: string;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Remediator';
|
|
13
|
-
import { Authenticator } from '../../types';
|
|
14
13
|
import { IdxRemediationValue, IdxOption, IdxRemediation } from '../../types/idx-js';
|
|
14
|
+
import { Authenticator } from '../../types';
|
|
15
15
|
export declare type AuthenticatorDataValues = RemediationValues & {
|
|
16
16
|
methodType?: string;
|
|
17
17
|
};
|
|
@@ -20,7 +20,11 @@ export declare class AuthenticatorData extends Remediator {
|
|
|
20
20
|
authenticator: any[];
|
|
21
21
|
};
|
|
22
22
|
values: AuthenticatorDataValues;
|
|
23
|
+
authenticator: Authenticator;
|
|
23
24
|
constructor(remediation: IdxRemediation, values?: AuthenticatorDataValues);
|
|
25
|
+
protected formatAuthenticatorData(): void;
|
|
26
|
+
protected getAuthenticatorData(): Authenticator;
|
|
27
|
+
canRemediate(): boolean;
|
|
24
28
|
getNextStep(): {
|
|
25
29
|
options: IdxOption[];
|
|
26
30
|
name: string;
|
|
@@ -28,9 +32,10 @@ export declare class AuthenticatorData extends Remediator {
|
|
|
28
32
|
canSkip?: boolean;
|
|
29
33
|
canResend?: boolean;
|
|
30
34
|
inputs?: import("../../types").Input[];
|
|
35
|
+
poll?: import("../../types").IdxPollOptions;
|
|
31
36
|
};
|
|
32
|
-
protected
|
|
33
|
-
protected mapAuthenticatorFromValues(authenticator?: Authenticator): Authenticator;
|
|
37
|
+
protected mapAuthenticatorDataFromValues(authenticatorData?: any): any;
|
|
34
38
|
protected getAuthenticatorFromRemediation(): IdxRemediationValue;
|
|
35
39
|
private getMethodTypes;
|
|
40
|
+
getValuesAfterProceed(): RemediationValues;
|
|
36
41
|
}
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { NextStep, IdxMessage, Authenticator } from '../../types';
|
|
13
|
-
import { IdxAuthenticator, IdxRemediation } from '../../types/idx-js';
|
|
12
|
+
import { NextStep, IdxMessage, Authenticator, IdxOptions } from '../../types';
|
|
13
|
+
import { IdxAuthenticator, IdxRemediation, IdxContext } from '../../types/idx-js';
|
|
14
14
|
export declare type IdxToRemediationValueMap = Record<string, string[]>;
|
|
15
|
-
export interface RemediationValues {
|
|
15
|
+
export interface RemediationValues extends IdxOptions {
|
|
16
16
|
stateHandle?: string;
|
|
17
17
|
authenticators?: Authenticator[] | string[];
|
|
18
|
+
authenticator?: string;
|
|
19
|
+
authenticatorsData?: Authenticator[];
|
|
18
20
|
}
|
|
19
21
|
export declare class Remediator {
|
|
20
22
|
static remediationName: string;
|
|
@@ -22,13 +24,14 @@ export declare class Remediator {
|
|
|
22
24
|
values: RemediationValues;
|
|
23
25
|
map?: IdxToRemediationValueMap;
|
|
24
26
|
constructor(remediation: IdxRemediation, values?: RemediationValues);
|
|
27
|
+
private formatAuthenticators;
|
|
25
28
|
getName(): string;
|
|
26
29
|
canRemediate(): boolean;
|
|
27
30
|
getData(key?: string): any;
|
|
28
31
|
hasData(key: string): boolean;
|
|
29
|
-
getNextStep(): NextStep;
|
|
32
|
+
getNextStep(_context?: IdxContext): NextStep;
|
|
30
33
|
private getInputs;
|
|
31
|
-
getMessages(): IdxMessage[] | undefined;
|
|
32
|
-
getValuesAfterProceed():
|
|
34
|
+
static getMessages(remediation: IdxRemediation): IdxMessage[] | undefined;
|
|
35
|
+
getValuesAfterProceed(): RemediationValues;
|
|
33
36
|
protected getAuthenticator(): IdxAuthenticator | undefined;
|
|
34
37
|
}
|
|
@@ -10,17 +10,16 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Remediator';
|
|
13
|
-
import {
|
|
13
|
+
import { IdxAuthenticator, IdxRemediationValue } from '../../types/idx-js';
|
|
14
14
|
export declare type SelectAuthenticatorValues = RemediationValues & {
|
|
15
15
|
authenticator?: string;
|
|
16
16
|
};
|
|
17
17
|
export declare class SelectAuthenticator extends Remediator {
|
|
18
18
|
values: SelectAuthenticatorValues;
|
|
19
|
-
|
|
19
|
+
selectedAuthenticator: IdxAuthenticator;
|
|
20
20
|
map: {
|
|
21
21
|
authenticator: any[];
|
|
22
22
|
};
|
|
23
|
-
constructor(remediation: IdxRemediation, values?: SelectAuthenticatorValues);
|
|
24
23
|
canRemediate(): boolean;
|
|
25
24
|
getNextStep(): {
|
|
26
25
|
options: {
|
|
@@ -28,10 +27,11 @@ export declare class SelectAuthenticator extends Remediator {
|
|
|
28
27
|
value: string;
|
|
29
28
|
}[];
|
|
30
29
|
name: string;
|
|
31
|
-
authenticator?:
|
|
30
|
+
authenticator?: IdxAuthenticator;
|
|
32
31
|
canSkip?: boolean;
|
|
33
32
|
canResend?: boolean;
|
|
34
33
|
inputs?: import("../../types").Input[];
|
|
34
|
+
poll?: import("../../types").IdxPollOptions;
|
|
35
35
|
};
|
|
36
36
|
mapAuthenticator(remediationValue: IdxRemediationValue): {
|
|
37
37
|
id: any;
|
|
@@ -40,4 +40,5 @@ export declare class SelectAuthenticator extends Remediator {
|
|
|
40
40
|
name: string;
|
|
41
41
|
key: string;
|
|
42
42
|
};
|
|
43
|
+
getValuesAfterProceed(): RemediationValues;
|
|
43
44
|
}
|
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Remediator';
|
|
13
|
+
import { Authenticator } from '../../authenticator';
|
|
14
|
+
import { IdxRemediation } from '../../types/idx-js';
|
|
13
15
|
export interface VerifyAuthenticatorValues extends RemediationValues {
|
|
14
16
|
verificationCode?: string;
|
|
15
17
|
password?: string;
|
|
18
|
+
questionKey?: string;
|
|
19
|
+
question?: string;
|
|
20
|
+
answer?: string;
|
|
16
21
|
}
|
|
17
22
|
export declare class VerifyAuthenticator extends Remediator {
|
|
23
|
+
authenticator: Authenticator;
|
|
18
24
|
values: VerifyAuthenticatorValues;
|
|
19
25
|
map: {
|
|
20
26
|
credentials: any[];
|
|
21
27
|
};
|
|
28
|
+
constructor(remediation: IdxRemediation, values?: RemediationValues);
|
|
22
29
|
canRemediate(): boolean;
|
|
23
|
-
mapCredentials():
|
|
24
|
-
passcode: string;
|
|
25
|
-
};
|
|
30
|
+
mapCredentials(): import("../../authenticator").Credentials;
|
|
26
31
|
getInputCredentials(input: any): any;
|
|
27
|
-
getValuesAfterProceed(): VerifyAuthenticatorValues;
|
|
28
32
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
export declare class
|
|
14
|
-
|
|
12
|
+
import { EnrollPoll } from './EnrollPoll';
|
|
13
|
+
export declare class ChallengePoll extends EnrollPoll {
|
|
14
|
+
static remediationName: string;
|
|
15
15
|
}
|
|
@@ -9,8 +9,16 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
import { Remediator, RemediationValues } from './Base/Remediator';
|
|
13
|
+
import { NextStep } from '../../types';
|
|
14
|
+
import { IdxContext } from '../types/idx-js';
|
|
15
|
+
export interface EnrollPollValues extends RemediationValues {
|
|
16
|
+
startPolling?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class EnrollPoll extends Remediator {
|
|
19
|
+
static remediationName: string;
|
|
20
|
+
values: EnrollPollValues;
|
|
21
|
+
canRemediate(): boolean;
|
|
22
|
+
getNextStep(context?: IdxContext): NextStep;
|
|
23
|
+
getValuesAfterProceed(): unknown;
|
|
16
24
|
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Base/Remediator';
|
|
13
|
-
import { IdxRemediation } from '../types/idx-js';
|
|
14
13
|
export interface IdentifyValues extends RemediationValues {
|
|
15
14
|
username?: string;
|
|
16
15
|
password?: string;
|
|
@@ -23,11 +22,9 @@ export declare class Identify extends Remediator {
|
|
|
23
22
|
credentials: any[];
|
|
24
23
|
rememberMe: string[];
|
|
25
24
|
};
|
|
26
|
-
constructor(remediation: IdxRemediation, values?: IdentifyValues);
|
|
27
25
|
canRemediate(): boolean;
|
|
28
26
|
mapCredentials(): {
|
|
29
27
|
passcode: string;
|
|
30
28
|
};
|
|
31
29
|
getInputCredentials(input: any): any;
|
|
32
|
-
getValuesAfterProceed(): unknown;
|
|
33
30
|
}
|
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { SelectAuthenticator, SelectAuthenticatorValues } from '
|
|
13
|
-
|
|
12
|
+
import { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';
|
|
13
|
+
import { IdxRemediation } from '../types/idx-js';
|
|
14
|
+
export declare type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {
|
|
15
|
+
password?: string;
|
|
16
|
+
};
|
|
14
17
|
export declare class SelectAuthenticatorAuthenticate extends SelectAuthenticator {
|
|
15
18
|
static remediationName: string;
|
|
16
19
|
values: SelectAuthenticatorAuthenticateValues;
|
|
20
|
+
constructor(remediation: IdxRemediation, values?: SelectAuthenticatorValues);
|
|
17
21
|
}
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export * from './Base/Remediator';
|
|
13
13
|
export * from './EnrollAuthenticator';
|
|
14
|
+
export * from './EnrollPoll';
|
|
14
15
|
export * from './ChallengeAuthenticator';
|
|
16
|
+
export * from './ChallengePoll';
|
|
15
17
|
export * from './ResetAuthenticator';
|
|
16
18
|
export * from './EnrollProfile';
|
|
17
19
|
export * from './Identify';
|
package/lib/idx/run.d.ts
CHANGED
|
@@ -9,13 +9,12 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { RemediationFlow } from './flow';
|
|
13
13
|
import { OktaAuth, IdxTransaction, FlowIdentifier } from '../types';
|
|
14
14
|
import { ProceedOptions } from './proceed';
|
|
15
15
|
export declare type RunOptions = ProceedOptions & {
|
|
16
16
|
flow?: FlowIdentifier;
|
|
17
17
|
remediators?: RemediationFlow;
|
|
18
|
-
flowMonitor?: FlowMonitor;
|
|
19
18
|
actions?: string[];
|
|
20
19
|
};
|
|
21
20
|
export declare function run(authClient: OktaAuth, options?: RunOptions): Promise<IdxTransaction>;
|
|
@@ -22,7 +22,23 @@ export interface IdxAuthenticator {
|
|
|
22
22
|
complexity?: unknown;
|
|
23
23
|
age?: unknown;
|
|
24
24
|
};
|
|
25
|
-
contextualData?:
|
|
25
|
+
contextualData?: {
|
|
26
|
+
enrolledQuestion?: {
|
|
27
|
+
question: string;
|
|
28
|
+
questionKey: string;
|
|
29
|
+
};
|
|
30
|
+
qrcode?: {
|
|
31
|
+
href: string;
|
|
32
|
+
method: string;
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
sharedSecret?: string;
|
|
36
|
+
questions?: {
|
|
37
|
+
questionKey: string;
|
|
38
|
+
question: string;
|
|
39
|
+
}[];
|
|
40
|
+
questionKeys?: string[];
|
|
41
|
+
};
|
|
26
42
|
}
|
|
27
43
|
export interface IdxForm {
|
|
28
44
|
value: IdxRemediationValue[];
|
|
@@ -66,6 +82,37 @@ export interface IdxRemediation {
|
|
|
66
82
|
method?: string;
|
|
67
83
|
type?: string;
|
|
68
84
|
accepts?: string;
|
|
85
|
+
refresh?: number;
|
|
86
|
+
}
|
|
87
|
+
export interface IdxContext {
|
|
88
|
+
version: string;
|
|
89
|
+
stateHandle: string;
|
|
90
|
+
expiresAt: string;
|
|
91
|
+
intent: string;
|
|
92
|
+
currentAuthenticator: {
|
|
93
|
+
type: string;
|
|
94
|
+
value: IdxAuthenticator;
|
|
95
|
+
};
|
|
96
|
+
authenticators: {
|
|
97
|
+
type: string;
|
|
98
|
+
value: IdxAuthenticator[];
|
|
99
|
+
};
|
|
100
|
+
authenticatorEnrollments: {
|
|
101
|
+
type: string;
|
|
102
|
+
value: IdxAuthenticator[];
|
|
103
|
+
};
|
|
104
|
+
enrollmentAuthenticator: {
|
|
105
|
+
type: string;
|
|
106
|
+
value: IdxAuthenticator;
|
|
107
|
+
};
|
|
108
|
+
user: {
|
|
109
|
+
type: string;
|
|
110
|
+
value: Record<string, unknown>;
|
|
111
|
+
};
|
|
112
|
+
app: {
|
|
113
|
+
type: string;
|
|
114
|
+
value: Record<string, unknown>;
|
|
115
|
+
};
|
|
69
116
|
}
|
|
70
117
|
export interface IdxMessage {
|
|
71
118
|
message: string;
|
|
@@ -103,5 +150,6 @@ export interface IdxResponse {
|
|
|
103
150
|
toPersist: {
|
|
104
151
|
interactionHandle?: string;
|
|
105
152
|
};
|
|
153
|
+
context?: IdxContext;
|
|
106
154
|
}
|
|
107
155
|
export declare function isIdxResponse(obj: any): obj is IdxResponse;
|
package/lib/idx/types/index.d.ts
CHANGED
|
@@ -32,9 +32,10 @@ export declare enum IdxStatus {
|
|
|
32
32
|
export declare enum AuthenticatorKey {
|
|
33
33
|
OKTA_PASSWORD = "okta_password",
|
|
34
34
|
OKTA_EMAIL = "okta_email",
|
|
35
|
-
OKTA_VERIFIER = "okta_verifier",
|
|
36
35
|
PHONE_NUMBER = "phone_number",
|
|
37
|
-
GOOGLE_AUTHENTICATOR = "google_otp"
|
|
36
|
+
GOOGLE_AUTHENTICATOR = "google_otp",
|
|
37
|
+
SECURITY_QUESTION = "security_question",
|
|
38
|
+
OKTA_VERIFY = "okta_verify"
|
|
38
39
|
}
|
|
39
40
|
export declare type Input = {
|
|
40
41
|
name: string;
|
|
@@ -51,6 +52,7 @@ export declare type NextStep = {
|
|
|
51
52
|
canResend?: boolean;
|
|
52
53
|
inputs?: Input[];
|
|
53
54
|
options?: IdxOption[];
|
|
55
|
+
poll?: IdxPollOptions;
|
|
54
56
|
};
|
|
55
57
|
export declare enum IdxFeature {
|
|
56
58
|
PASSWORD_RECOVERY = 0,
|
|
@@ -71,6 +73,10 @@ export interface IdxTransaction {
|
|
|
71
73
|
export declare type IdxOptions = InteractOptions & IntrospectOptions & {
|
|
72
74
|
flow?: FlowIdentifier;
|
|
73
75
|
};
|
|
76
|
+
export interface IdxPollOptions {
|
|
77
|
+
required?: boolean;
|
|
78
|
+
refresh?: number;
|
|
79
|
+
}
|
|
74
80
|
export declare type Authenticator = {
|
|
75
81
|
key: string;
|
|
76
82
|
methodType?: string;
|
package/lib/types/Token.d.ts
CHANGED
package/lib/types/api.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import StorageManager from '../StorageManager';
|
|
|
18
18
|
import TransactionManager from '../TransactionManager';
|
|
19
19
|
import { TokenManagerInterface } from './TokenManager';
|
|
20
20
|
import { OktaUserAgent } from '../OktaUserAgent';
|
|
21
|
-
import { FlowIdentifier } from '../idx/types';
|
|
21
|
+
import { FlowIdentifier, IdxPollOptions } from '../idx/types';
|
|
22
22
|
import { AuthenticationOptions, RegistrationOptions as IdxRegistrationOptions, PasswordRecoveryOptions, ProceedOptions, CancelOptions, IdxOptions, IdxTransaction } from '../idx/types';
|
|
23
23
|
import { InteractOptions, InteractResponse } from '../idx/interact';
|
|
24
24
|
import { IntrospectOptions } from '../idx/introspect';
|
|
@@ -188,10 +188,11 @@ export interface SignoutRedirectUrlOptions {
|
|
|
188
188
|
state?: string;
|
|
189
189
|
}
|
|
190
190
|
export interface SignoutOptions extends SignoutRedirectUrlOptions {
|
|
191
|
-
accessToken?: AccessToken;
|
|
192
191
|
revokeAccessToken?: boolean;
|
|
193
192
|
revokeRefreshToken?: boolean;
|
|
193
|
+
accessToken?: AccessToken;
|
|
194
194
|
refreshToken?: RefreshToken;
|
|
195
|
+
clearTokensAfterRedirect?: boolean;
|
|
195
196
|
}
|
|
196
197
|
export interface SignoutAPI {
|
|
197
198
|
signOut(opts: SignoutOptions): any;
|
|
@@ -214,6 +215,7 @@ export interface IdxAPI {
|
|
|
214
215
|
introspect: (options?: IntrospectOptions) => Promise<IdxResponse>;
|
|
215
216
|
authenticate: (options?: AuthenticationOptions) => Promise<IdxTransaction>;
|
|
216
217
|
register: (options?: IdxRegistrationOptions) => Promise<IdxTransaction>;
|
|
218
|
+
poll: (options?: IdxPollOptions) => Promise<IdxTransaction>;
|
|
217
219
|
proceed: (options?: ProceedOptions) => Promise<IdxTransaction>;
|
|
218
220
|
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
219
221
|
startTransaction: (options?: IdxOptions) => Promise<IdxTransaction>;
|