@okta/okta-auth-js 6.4.4 → 6.5.1
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 +29 -0
- package/README.md +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +10 -5
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js +6 -0
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/interact.js +16 -16
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/remediate.js +9 -9
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +17 -8
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +2 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +4 -3
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +1 -1
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +20 -7
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +2 -2
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +2 -2
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +2 -2
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js +103 -0
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -0
- package/cjs/idx/remediators/GenericRemediator/index.js +17 -0
- package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -0
- package/cjs/idx/remediators/GenericRemediator/util.js +141 -0
- package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -0
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +3 -2
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/index.js +13 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/run.js +27 -14
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/transactionMeta.js +4 -2
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/util.js +70 -22
- package/cjs/idx/util.js.map +1 -1
- package/cjs/options/index.js +6 -0
- package/cjs/options/index.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/esm.browser.js +533 -257
- package/esm/esm.browser.js.map +1 -1
- package/esm/esm.node.mjs +533 -257
- package/esm/esm.node.mjs.map +1 -1
- package/lib/idx/interact.d.ts +1 -0
- package/lib/idx/remediate.d.ts +2 -1
- package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +1 -11
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -0
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +5 -1
- package/lib/idx/remediators/Base/Remediator.d.ts +4 -3
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +8 -3
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -1
- package/lib/idx/remediators/EnrollPoll.d.ts +2 -2
- package/lib/idx/remediators/EnrollmentChannelData.d.ts +7 -3
- package/lib/idx/remediators/GenericRemediator/GenericRemediator.d.ts +9 -0
- package/lib/idx/remediators/GenericRemediator/index.d.ts +1 -0
- package/lib/idx/remediators/GenericRemediator/util.d.ts +3 -0
- package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +1 -1
- package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +7 -3
- package/lib/idx/remediators/index.d.ts +1 -0
- package/lib/idx/types/api.d.ts +12 -2
- package/lib/idx/types/idx-js.d.ts +6 -2
- package/lib/idx/types/index.d.ts +1 -1
- package/lib/idx/types/options.d.ts +2 -0
- package/lib/idx/util.d.ts +4 -3
- package/lib/types/OktaAuthOptions.d.ts +1 -0
- package/package.json +5 -5
package/lib/idx/interact.d.ts
CHANGED
|
@@ -20,5 +20,6 @@ export interface InteractParams {
|
|
|
20
20
|
activation_token?: string;
|
|
21
21
|
recovery_token?: string;
|
|
22
22
|
client_secret?: string;
|
|
23
|
+
max_age?: string | number;
|
|
23
24
|
}
|
|
24
25
|
export declare function interact(authClient: OktaAuthInterface, options?: InteractOptions): Promise<InteractResponse>;
|
package/lib/idx/remediate.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
import { OktaAuthInterface } from '../types';
|
|
12
13
|
import { RemediationValues } from './remediators';
|
|
13
14
|
import { RemediateOptions, RemediationResponse } from './types';
|
|
14
15
|
import { IdxResponse, IdxActionParams } from './types/idx-js';
|
|
@@ -17,4 +18,4 @@ export interface RemediateActionWithOptionalParams {
|
|
|
17
18
|
params?: IdxActionParams;
|
|
18
19
|
}
|
|
19
20
|
export declare type RemediateAction = string | RemediateActionWithOptionalParams;
|
|
20
|
-
export declare function remediate(idxResponse: IdxResponse, values: RemediationValues, options: RemediateOptions): Promise<RemediationResponse>;
|
|
21
|
+
export declare function remediate(authClient: OktaAuthInterface, idxResponse: IdxResponse, values: RemediationValues, options: RemediateOptions): Promise<RemediationResponse>;
|
|
@@ -21,16 +21,6 @@ export declare class AuthenticatorEnrollmentData extends AuthenticatorData<Authe
|
|
|
21
21
|
methodType: string | undefined;
|
|
22
22
|
phoneNumber: string | undefined;
|
|
23
23
|
};
|
|
24
|
-
getInputAuthenticator():
|
|
25
|
-
name: string;
|
|
26
|
-
type: string;
|
|
27
|
-
required: boolean;
|
|
28
|
-
label?: undefined;
|
|
29
|
-
} | {
|
|
30
|
-
name: string;
|
|
31
|
-
type: string;
|
|
32
|
-
required: boolean;
|
|
33
|
-
label: string;
|
|
34
|
-
})[];
|
|
24
|
+
getInputAuthenticator(remediation: any): any[];
|
|
35
25
|
protected mapAuthenticatorDataFromValues(data?: any): any;
|
|
36
26
|
}
|
|
@@ -22,6 +22,7 @@ export declare class AuthenticatorVerificationData extends AuthenticatorData<Aut
|
|
|
22
22
|
name: string;
|
|
23
23
|
type: string;
|
|
24
24
|
required: boolean;
|
|
25
|
+
options: import("../types/idx-js").IdxOption[];
|
|
25
26
|
};
|
|
26
27
|
getValuesAfterProceed(): AuthenticatorVerificationDataValues;
|
|
27
28
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Remediator';
|
|
13
13
|
import { IdxRemediationValue, IdxOption, IdxRemediation, IdxAuthenticator } from '../../types/idx-js';
|
|
14
|
+
import { OktaAuthInterface } from '../../../types';
|
|
14
15
|
export declare type AuthenticatorDataValues = RemediationValues & {
|
|
15
16
|
methodType?: string;
|
|
16
17
|
};
|
|
@@ -20,7 +21,7 @@ export declare class AuthenticatorData<T extends AuthenticatorDataValues = Authe
|
|
|
20
21
|
protected formatAuthenticatorData(): void;
|
|
21
22
|
protected getAuthenticatorData(): import("../../types").Authenticator | undefined;
|
|
22
23
|
canRemediate(): boolean;
|
|
23
|
-
getNextStep(): {
|
|
24
|
+
getNextStep(authClient: OktaAuthInterface): {
|
|
24
25
|
options: IdxOption[];
|
|
25
26
|
name: string;
|
|
26
27
|
authenticator?: IdxAuthenticator | undefined;
|
|
@@ -29,6 +30,9 @@ export declare class AuthenticatorData<T extends AuthenticatorDataValues = Authe
|
|
|
29
30
|
inputs?: import("../../types").Input[] | undefined;
|
|
30
31
|
poll?: import("../../types").IdxPollOptions | undefined;
|
|
31
32
|
authenticatorEnrollments?: IdxAuthenticator[] | undefined;
|
|
33
|
+
action?: ((params?: import("../../types").IdxActionParams | undefined) => Promise<import("../../types").IdxTransaction>) | undefined;
|
|
34
|
+
idp?: import("../../types/idx-js").IdpConfig | undefined;
|
|
35
|
+
href?: string | undefined;
|
|
32
36
|
};
|
|
33
37
|
protected mapAuthenticatorDataFromValues(authenticatorData?: any): any;
|
|
34
38
|
protected getAuthenticatorFromRemediation(): IdxRemediationValue;
|
|
@@ -9,8 +9,9 @@
|
|
|
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, RemediateOptions } from '../../types';
|
|
12
|
+
import { NextStep, IdxMessage, Authenticator, Input, RemediateOptions } from '../../types';
|
|
13
13
|
import { IdxAuthenticator, IdxRemediation, IdxContext } from '../../types/idx-js';
|
|
14
|
+
import { OktaAuthInterface } from '../../../types';
|
|
14
15
|
export declare type IdxToRemediationValueMap = Record<string, string[]>;
|
|
15
16
|
export interface RemediationValues {
|
|
16
17
|
stateHandle?: string;
|
|
@@ -34,8 +35,8 @@ export declare class Remediator<T extends RemediationValues = RemediationValues>
|
|
|
34
35
|
canRemediate(): boolean;
|
|
35
36
|
getData(key?: string): any;
|
|
36
37
|
hasData(key: string): boolean;
|
|
37
|
-
getNextStep(_context?: IdxContext): NextStep;
|
|
38
|
-
|
|
38
|
+
getNextStep(_authClient: OktaAuthInterface, _context?: IdxContext): NextStep;
|
|
39
|
+
getInputs(): Input[];
|
|
39
40
|
static getMessages(remediation: IdxRemediation): IdxMessage[] | undefined;
|
|
40
41
|
getValuesAfterProceed(): T;
|
|
41
42
|
protected getAuthenticator(): IdxAuthenticator | undefined;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { Remediator, RemediationValues } from './Remediator';
|
|
13
13
|
import { IdxRemediationValue } from '../../types/idx-js';
|
|
14
14
|
import { Authenticator } from '../../types';
|
|
15
|
+
import { OktaAuthInterface } from '../../../types';
|
|
15
16
|
export declare type SelectAuthenticatorValues = RemediationValues & {
|
|
16
17
|
authenticator?: string | Authenticator;
|
|
17
18
|
};
|
|
@@ -20,7 +21,7 @@ export declare class SelectAuthenticator<T extends SelectAuthenticatorValues = S
|
|
|
20
21
|
selectedOption?: any;
|
|
21
22
|
findMatchedOption(authenticators: any, options: any): any;
|
|
22
23
|
canRemediate(): boolean;
|
|
23
|
-
getNextStep(): {
|
|
24
|
+
getNextStep(authClient: OktaAuthInterface): {
|
|
24
25
|
options: {
|
|
25
26
|
label: string;
|
|
26
27
|
value: string;
|
|
@@ -32,13 +33,17 @@ export declare class SelectAuthenticator<T extends SelectAuthenticatorValues = S
|
|
|
32
33
|
inputs?: import("../../types").Input[] | undefined;
|
|
33
34
|
poll?: import("../../types").IdxPollOptions | undefined;
|
|
34
35
|
authenticatorEnrollments?: import("../../types").IdxAuthenticator[] | undefined;
|
|
36
|
+
action?: ((params?: import("../../types").IdxActionParams | undefined) => Promise<import("../../types").IdxTransaction>) | undefined;
|
|
37
|
+
idp?: import("../../types/idx-js").IdpConfig | undefined;
|
|
38
|
+
href?: string | undefined;
|
|
35
39
|
};
|
|
36
40
|
mapAuthenticator(remediationValue: IdxRemediationValue): Authenticator | {
|
|
37
41
|
id: any;
|
|
38
42
|
};
|
|
39
|
-
getInputAuthenticator(): {
|
|
43
|
+
getInputAuthenticator(remediation: any): {
|
|
40
44
|
name: string;
|
|
41
|
-
|
|
45
|
+
type: string;
|
|
46
|
+
options: any;
|
|
42
47
|
};
|
|
43
48
|
getValuesAfterProceed(): T;
|
|
44
49
|
}
|
|
@@ -13,11 +13,12 @@ import { Remediator, RemediationValues } from './Remediator';
|
|
|
13
13
|
import { Authenticator, AuthenticatorValues } from '../../authenticator';
|
|
14
14
|
import { IdxRemediation, IdxContext } from '../../types/idx-js';
|
|
15
15
|
import { NextStep } from '../../types';
|
|
16
|
+
import { OktaAuthInterface } from '../../../types';
|
|
16
17
|
export declare type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;
|
|
17
18
|
export declare class VerifyAuthenticator<T extends VerifyAuthenticatorValues = VerifyAuthenticatorValues> extends Remediator<T> {
|
|
18
19
|
authenticator: Authenticator<VerifyAuthenticatorValues>;
|
|
19
20
|
constructor(remediation: IdxRemediation, values?: T);
|
|
20
|
-
getNextStep(context?: IdxContext): NextStep;
|
|
21
|
+
getNextStep(authClient: OktaAuthInterface, context?: IdxContext): NextStep;
|
|
21
22
|
canRemediate(): boolean;
|
|
22
23
|
mapCredentials(): import("../../authenticator").Credentials | undefined;
|
|
23
24
|
getInputCredentials(input: any): any;
|
|
@@ -10,7 +10,7 @@
|
|
|
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 { NextStep } from '../../types';
|
|
13
|
+
import { NextStep, OktaAuthInterface } from '../../types';
|
|
14
14
|
import { IdxContext } from '../types/idx-js';
|
|
15
15
|
export interface EnrollPollValues extends RemediationValues {
|
|
16
16
|
startPolling?: boolean;
|
|
@@ -18,6 +18,6 @@ export interface EnrollPollValues extends RemediationValues {
|
|
|
18
18
|
export declare class EnrollPoll extends Remediator<EnrollPollValues> {
|
|
19
19
|
static remediationName: string;
|
|
20
20
|
canRemediate(): boolean;
|
|
21
|
-
getNextStep(context?: IdxContext): NextStep;
|
|
21
|
+
getNextStep(authClient: OktaAuthInterface, context?: IdxContext): NextStep;
|
|
22
22
|
getValuesAfterProceed(): EnrollPollValues;
|
|
23
23
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Base/Remediator';
|
|
13
13
|
import { IdxContext } from '../types/idx-js';
|
|
14
|
+
import { OktaAuthInterface } from '../../types';
|
|
14
15
|
export declare type EnrollmentChannelDataValues = RemediationValues & {
|
|
15
16
|
email?: string;
|
|
16
17
|
phoneNumber?: string;
|
|
@@ -30,15 +31,18 @@ export declare class EnrollmentChannelData extends Remediator<EnrollmentChannelD
|
|
|
30
31
|
label: string;
|
|
31
32
|
}[];
|
|
32
33
|
canRemediate(): boolean;
|
|
33
|
-
getNextStep(context: IdxContext): {
|
|
34
|
+
getNextStep(authClient: OktaAuthInterface, context: IdxContext): {
|
|
34
35
|
authenticator: import("../types/idx-js").IdxAuthenticator;
|
|
35
36
|
name: string;
|
|
36
37
|
canSkip?: boolean | undefined;
|
|
37
38
|
canResend?: boolean | undefined;
|
|
38
|
-
inputs?: import("
|
|
39
|
+
inputs?: import("../types/api").Input[] | undefined;
|
|
39
40
|
options?: import("../types/idx-js").IdxOption[] | undefined;
|
|
40
|
-
poll?: import("
|
|
41
|
+
poll?: import("../types/api").IdxPollOptions | undefined;
|
|
41
42
|
authenticatorEnrollments?: import("../types/idx-js").IdxAuthenticator[] | undefined;
|
|
43
|
+
action?: ((params?: import("../types/idx-js").IdxActionParams | undefined) => Promise<import("../types/api").IdxTransaction>) | undefined;
|
|
44
|
+
idp?: import("../types/idx-js").IdpConfig | undefined;
|
|
45
|
+
href?: string | undefined;
|
|
42
46
|
};
|
|
43
47
|
getData(): {
|
|
44
48
|
stateHandle: string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IdxContext, NextStep, Input } from '../../types';
|
|
2
|
+
import { Remediator } from '../Base/Remediator';
|
|
3
|
+
import { OktaAuthInterface } from '../../../types';
|
|
4
|
+
export declare class GenericRemediator extends Remediator {
|
|
5
|
+
canRemediate(): boolean;
|
|
6
|
+
getData(): {};
|
|
7
|
+
getNextStep(authClient: OktaAuthInterface, _context?: IdxContext): NextStep;
|
|
8
|
+
getInputs(): Input[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GenericRemediator';
|
|
@@ -11,21 +11,25 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { Remediator, RemediationValues } from './Base/Remediator';
|
|
13
13
|
import { IdxRemediationValueForm, IdxOption, IdxContext } from '../types/idx-js';
|
|
14
|
+
import { OktaAuthInterface } from '../../types';
|
|
14
15
|
export declare type SelectEnrollmentChannelValues = RemediationValues & {
|
|
15
16
|
channel?: string;
|
|
16
17
|
};
|
|
17
18
|
export declare class SelectEnrollmentChannel extends Remediator<SelectEnrollmentChannelValues> {
|
|
18
19
|
static remediationName: string;
|
|
19
20
|
canRemediate(): boolean;
|
|
20
|
-
getNextStep(context: IdxContext): {
|
|
21
|
+
getNextStep(authClient: OktaAuthInterface, context: IdxContext): {
|
|
21
22
|
authenticator: import("../types/idx-js").IdxAuthenticator;
|
|
22
23
|
options?: IdxOption[] | undefined;
|
|
23
24
|
name: string;
|
|
24
25
|
canSkip?: boolean | undefined;
|
|
25
26
|
canResend?: boolean | undefined;
|
|
26
|
-
inputs?: import("
|
|
27
|
-
poll?: import("
|
|
27
|
+
inputs?: import("../types/api").Input[] | undefined;
|
|
28
|
+
poll?: import("../types/api").IdxPollOptions | undefined;
|
|
28
29
|
authenticatorEnrollments?: import("../types/idx-js").IdxAuthenticator[] | undefined;
|
|
30
|
+
action?: ((params?: import("../types/idx-js").IdxActionParams | undefined) => Promise<import("../types/api").IdxTransaction>) | undefined;
|
|
31
|
+
idp?: import("../types/idx-js").IdpConfig | undefined;
|
|
32
|
+
href?: string | undefined;
|
|
29
33
|
};
|
|
30
34
|
private getChannels;
|
|
31
35
|
getData(): {
|
package/lib/idx/types/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIError } from '../../types/api';
|
|
|
2
2
|
import { Tokens } from '../../types/Token';
|
|
3
3
|
import { PKCETransactionMeta } from '../../types/Transaction';
|
|
4
4
|
import { FlowIdentifier } from './FlowIdentifier';
|
|
5
|
-
import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse } from './idx-js';
|
|
5
|
+
import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse, IdxActionParams, IdpConfig } from './idx-js';
|
|
6
6
|
export declare enum IdxStatus {
|
|
7
7
|
SUCCESS = "SUCCESS",
|
|
8
8
|
PENDING = "PENDING",
|
|
@@ -26,11 +26,15 @@ export declare type Input = {
|
|
|
26
26
|
label?: string;
|
|
27
27
|
value?: string | {
|
|
28
28
|
form: IdxForm;
|
|
29
|
-
};
|
|
29
|
+
} | Input[];
|
|
30
30
|
minLength?: number;
|
|
31
31
|
maxLength?: number;
|
|
32
32
|
secret?: boolean;
|
|
33
33
|
required?: boolean;
|
|
34
|
+
options?: IdxOption[];
|
|
35
|
+
relatesTo?: IdxAuthenticator;
|
|
36
|
+
mutable?: boolean;
|
|
37
|
+
visible?: boolean;
|
|
34
38
|
};
|
|
35
39
|
export interface IdxPollOptions {
|
|
36
40
|
required?: boolean;
|
|
@@ -45,6 +49,9 @@ export declare type NextStep = {
|
|
|
45
49
|
options?: IdxOption[];
|
|
46
50
|
poll?: IdxPollOptions;
|
|
47
51
|
authenticatorEnrollments?: IdxAuthenticator[];
|
|
52
|
+
action?: (params?: IdxActionParams) => Promise<IdxTransaction>;
|
|
53
|
+
idp?: IdpConfig;
|
|
54
|
+
href?: string;
|
|
48
55
|
};
|
|
49
56
|
export declare enum IdxFeature {
|
|
50
57
|
PASSWORD_RECOVERY = "recover-password",
|
|
@@ -59,6 +66,8 @@ export interface IdxTransactionMeta extends PKCETransactionMeta {
|
|
|
59
66
|
withCredentials?: boolean;
|
|
60
67
|
activationToken?: string;
|
|
61
68
|
recoveryToken?: string;
|
|
69
|
+
maxAge?: string | number;
|
|
70
|
+
useGenericRemediator?: boolean;
|
|
62
71
|
}
|
|
63
72
|
export interface IdxTransaction {
|
|
64
73
|
status: IdxStatus;
|
|
@@ -70,6 +79,7 @@ export interface IdxTransaction {
|
|
|
70
79
|
enabledFeatures?: IdxFeature[];
|
|
71
80
|
availableSteps?: NextStep[];
|
|
72
81
|
requestDidSucceed?: boolean;
|
|
82
|
+
stepUp?: boolean;
|
|
73
83
|
proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;
|
|
74
84
|
neededToProceed: IdxRemediation[];
|
|
75
85
|
rawIdxState: RawIdxResponse;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
import { Input } from './api';
|
|
12
13
|
export interface ChallengeData {
|
|
13
14
|
challenge: string;
|
|
14
15
|
userVerification: string;
|
|
@@ -84,7 +85,7 @@ export interface IdxForm {
|
|
|
84
85
|
export interface IdxOption {
|
|
85
86
|
value: string | {
|
|
86
87
|
form: IdxForm;
|
|
87
|
-
};
|
|
88
|
+
} | Input[];
|
|
88
89
|
label: string;
|
|
89
90
|
relatesTo?: IdxAuthenticator;
|
|
90
91
|
}
|
|
@@ -123,7 +124,10 @@ export interface IdxRemediation {
|
|
|
123
124
|
method?: string;
|
|
124
125
|
type?: string;
|
|
125
126
|
accepts?: string;
|
|
127
|
+
produces?: string;
|
|
126
128
|
refresh?: number;
|
|
129
|
+
rel?: string[];
|
|
130
|
+
action?: (payload?: IdxActionParams) => Promise<IdxResponse>;
|
|
127
131
|
}
|
|
128
132
|
export interface IdxContext {
|
|
129
133
|
version: string;
|
|
@@ -185,7 +189,7 @@ export interface RawIdxResponse {
|
|
|
185
189
|
}
|
|
186
190
|
export declare function isRawIdxResponse(obj: any): obj is RawIdxResponse;
|
|
187
191
|
export interface IdxActionParams {
|
|
188
|
-
[key: string]: string | boolean | number;
|
|
192
|
+
[key: string]: string | boolean | number | object;
|
|
189
193
|
}
|
|
190
194
|
export interface IdxActions {
|
|
191
195
|
[key: string]: (params?: IdxActionParams) => Promise<IdxResponse>;
|
package/lib/idx/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export * from './api';
|
|
13
13
|
export * from './options';
|
|
14
|
-
export type { IdxMessage, IdxMessages, ChallengeData, ActivationData, IdxResponse, IdxContext, RawIdxResponse, IdxRemediation, IdxAuthenticator } from './idx-js';
|
|
14
|
+
export type { IdxMessage, IdxMessages, ChallengeData, ActivationData, IdxResponse, IdxContext, RawIdxResponse, IdxRemediation, IdxAuthenticator, IdxActionParams, } from './idx-js';
|
|
15
15
|
export type { FlowIdentifier } from './FlowIdentifier';
|
|
16
16
|
export type { EmailVerifyCallbackResponse } from '../emailVerify';
|
|
17
17
|
export type { WebauthnEnrollValues } from '../authenticator/WebauthnEnrollment';
|
|
@@ -17,6 +17,7 @@ export interface InteractOptions extends IdxOptions {
|
|
|
17
17
|
activationToken?: string;
|
|
18
18
|
recoveryToken?: string;
|
|
19
19
|
clientSecret?: string;
|
|
20
|
+
maxAge?: string | number;
|
|
20
21
|
}
|
|
21
22
|
export interface IntrospectOptions extends IdxOptions {
|
|
22
23
|
interactionHandle?: string;
|
|
@@ -27,6 +28,7 @@ export interface RemediateOptions extends IdxOptions {
|
|
|
27
28
|
remediators?: RemediationFlow;
|
|
28
29
|
actions?: RemediateAction[];
|
|
29
30
|
shouldProceedWithEmailAuthenticator?: boolean;
|
|
31
|
+
useGenericRemediator?: boolean;
|
|
30
32
|
}
|
|
31
33
|
export interface RunOptions extends RemediateOptions, InteractOptions, IntrospectOptions {
|
|
32
34
|
}
|
package/lib/idx/util.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { RemediationValues, Remediator } from './remediators';
|
|
2
2
|
import { IdxFeature, NextStep, RemediateOptions, RemediationResponse } from './types';
|
|
3
3
|
import { IdxMessage, IdxRemediation, IdxRemediationValue, IdxResponse } from './types/idx-js';
|
|
4
|
+
import { OktaAuthInterface } from '../types';
|
|
4
5
|
export declare function isTerminalResponse(idxResponse: IdxResponse): boolean;
|
|
5
6
|
export declare function canSkipFn(idxResponse: IdxResponse): boolean;
|
|
6
7
|
export declare function canResendFn(idxResponse: IdxResponse): boolean;
|
|
7
8
|
export declare function getMessagesFromIdxRemediationValue(value?: IdxRemediationValue[]): IdxMessage[] | undefined;
|
|
8
9
|
export declare function getMessagesFromResponse(idxResponse: IdxResponse): IdxMessage[];
|
|
9
10
|
export declare function getEnabledFeatures(idxResponse: IdxResponse): IdxFeature[];
|
|
10
|
-
export declare function getAvailableSteps(idxResponse: IdxResponse): NextStep[];
|
|
11
|
+
export declare function getAvailableSteps(authClient: OktaAuthInterface, idxResponse: IdxResponse, useGenericRemediator?: boolean): NextStep[];
|
|
11
12
|
export declare function filterValuesForRemediation(idxResponse: IdxResponse, remediationName: string, values: RemediationValues): RemediationValues;
|
|
12
13
|
export declare function getRemediator(idxRemediations: IdxRemediation[], values: RemediationValues, options: RemediateOptions): Remediator | undefined;
|
|
13
|
-
export declare function getNextStep(remediator: Remediator, idxResponse: IdxResponse): NextStep;
|
|
14
|
-
export declare function handleIdxError(e: any, remediator?: any): RemediationResponse;
|
|
14
|
+
export declare function getNextStep(authClient: OktaAuthInterface, remediator: Remediator, idxResponse: IdxResponse): NextStep;
|
|
15
|
+
export declare function handleIdxError(authClient: OktaAuthInterface, e: any, remediator?: any): RemediationResponse;
|
|
@@ -86,5 +86,6 @@ export interface OktaAuthOptions extends CustomUrls, Pick<TokenParams, 'issuer'
|
|
|
86
86
|
storageManager?: StorageManagerOptions;
|
|
87
87
|
services?: ServiceManagerOptions;
|
|
88
88
|
transactionManager?: TransactionManagerOptions;
|
|
89
|
+
idx?: Pick<IdxTransactionMeta, 'useGenericRemediator'>;
|
|
89
90
|
clientSecret?: string;
|
|
90
91
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@okta/okta-auth-js",
|
|
4
4
|
"description": "The Okta Auth SDK",
|
|
5
|
-
"version": "6.
|
|
5
|
+
"version": "6.5.1",
|
|
6
6
|
"homepage": "https://github.com/okta/okta-auth-js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "cjs/index.js",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"dev:samples": "yarn workspace @okta/samples dev",
|
|
62
62
|
"prepare": "",
|
|
63
63
|
"start": "yarn workspace @okta/test.app start --open",
|
|
64
|
-
"stop": "kill -s TERM $(lsof -t -i:8080 -sTCP:LISTEN) || true"
|
|
64
|
+
"stop": "kill -s TERM $(lsof -t -i:8080 -sTCP:LISTEN) || true",
|
|
65
|
+
"verify:package": "node scripts/verify-package.js"
|
|
65
66
|
},
|
|
66
67
|
"author": "Okta",
|
|
67
68
|
"keywords": [
|
|
@@ -187,8 +188,7 @@
|
|
|
187
188
|
}
|
|
188
189
|
},
|
|
189
190
|
"okta": {
|
|
190
|
-
"commitSha": "
|
|
191
|
-
"fullVersion": "6.
|
|
192
|
-
"testedSha": "8bcbbdb385828760bb2be241298a7aeb5d88ac5d"
|
|
191
|
+
"commitSha": "003673db2d33b88fae1dce7ea7b9092bc6a0b4e1",
|
|
192
|
+
"fullVersion": "6.5.1-g003673d"
|
|
193
193
|
}
|
|
194
194
|
}
|