@okta/okta-auth-js 6.2.0 → 6.3.2
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 +35 -0
- package/cjs/AuthStateManager.js +9 -3
- package/cjs/AuthStateManager.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/PromiseQueue.js +9 -2
- package/cjs/PromiseQueue.js.map +1 -1
- package/cjs/ServiceManager.js +3 -3
- package/cjs/ServiceManager.js.map +1 -1
- package/cjs/TransactionManager.js +11 -5
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/browser/browserStorage.js +19 -18
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js.map +1 -1
- package/cjs/idx/authenticator/OktaPassword.js +12 -3
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
- package/cjs/idx/authenticator/OktaVerifyTotp.js +9 -1
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +14 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +9 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +13 -3
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnEnrollment.js +5 -0
- package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnVerification.js +5 -0
- package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
- package/cjs/idx/authenticator/util.js +64 -0
- package/cjs/idx/authenticator/util.js.map +1 -0
- package/cjs/idx/idx-js/index.js +0 -122
- package/cjs/idx/idx-js/index.js.map +1 -1
- package/cjs/idx/idx-js/introspect.js +10 -6
- package/cjs/idx/idx-js/introspect.js.map +1 -1
- package/cjs/idx/idx-js/v1/generateIdxAction.js +17 -23
- package/cjs/idx/idx-js/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idx-js/v1/makeIdxState.js +5 -4
- package/cjs/idx/idx-js/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/introspect.js +13 -3
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/proceed.js +14 -11
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/remediate.js +68 -77
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +6 -2
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +23 -19
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +22 -14
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +85 -85
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +24 -15
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +15 -4
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengePoll.js +8 -1
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +1 -1
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js +15 -9
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +0 -8
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/Identify.js +12 -5
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +9 -8
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +4 -3
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +0 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +1 -8
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +267 -198
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +37 -0
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/util.js +198 -0
- package/cjs/idx/util.js.map +1 -0
- package/cjs/options/browser.js +11 -6
- package/cjs/options/browser.js.map +1 -1
- package/cjs/options/index.js +1 -1
- package/cjs/options/index.js.map +1 -1
- package/cjs/options/node.js +5 -6
- package/cjs/options/node.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 +1060 -775
- package/esm/esm.browser.js.map +1 -1
- package/esm/esm.node.mjs +1057 -775
- package/esm/esm.node.mjs.map +1 -1
- package/lib/AuthStateManager.d.ts +2 -0
- package/lib/PromiseQueue.d.ts +6 -2
- package/lib/TransactionManager.d.ts +3 -4
- package/lib/idx/authenticator/Authenticator.d.ts +1 -1
- package/lib/idx/authenticator/OktaPassword.d.ts +2 -1
- package/lib/idx/authenticator/OktaVerifyTotp.d.ts +1 -1
- package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +3 -5
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +1 -1
- package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +2 -1
- package/lib/idx/authenticator/WebauthnEnrollment.d.ts +1 -1
- package/lib/idx/authenticator/WebauthnVerification.d.ts +1 -1
- package/lib/idx/authenticator/util.d.ts +4 -0
- package/lib/idx/idx-js/index.d.ts +1 -17
- package/lib/idx/idx-js/introspect.d.ts +2 -1
- package/lib/idx/idx-js/v1/generateIdxAction.d.ts +1 -1
- package/lib/idx/idx-js/v1/makeIdxState.d.ts +2 -2
- package/lib/idx/proceed.d.ts +1 -3
- package/lib/idx/remediate.d.ts +2 -2
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -0
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +0 -3
- package/lib/idx/remediators/Base/Remediator.d.ts +5 -4
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +7 -9
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -4
- package/lib/idx/remediators/ChallengePoll.d.ts +1 -0
- package/lib/idx/remediators/EnrollProfile.d.ts +0 -3
- package/lib/idx/remediators/EnrollmentChannelData.d.ts +0 -4
- package/lib/idx/remediators/Identify.d.ts +3 -5
- package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -5
- package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +2 -1
- package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +1 -2
- package/lib/idx/remediators/Skip.d.ts +0 -3
- package/lib/idx/types/idx-js.d.ts +5 -1
- package/lib/idx/types/index.d.ts +7 -3
- package/lib/idx/util.d.ts +11 -0
- package/lib/options/browser.d.ts +2 -2
- package/lib/options/node.d.ts +2 -2
- package/lib/types/Storage.d.ts +7 -5
- package/lib/types/api.d.ts +1 -3
- package/package.json +7 -6
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AuthState, AuthStateLogOptions } from './types';
|
|
13
13
|
import { OktaAuth } from '.';
|
|
14
|
+
import PromiseQueue from './PromiseQueue';
|
|
14
15
|
export declare const INITIAL_AUTH_STATE: null;
|
|
15
16
|
export declare class AuthStateManager {
|
|
16
17
|
_sdk: OktaAuth;
|
|
@@ -21,6 +22,7 @@ export declare class AuthStateManager {
|
|
|
21
22
|
_authState: AuthState | null;
|
|
22
23
|
_prevAuthState: AuthState | null;
|
|
23
24
|
_logOptions: AuthStateLogOptions;
|
|
25
|
+
_transformQueue: PromiseQueue;
|
|
24
26
|
constructor(sdk: OktaAuth);
|
|
25
27
|
_setLogOptions(options: any): void;
|
|
26
28
|
getAuthState(): AuthState | null;
|
package/lib/PromiseQueue.d.ts
CHANGED
|
@@ -16,11 +16,15 @@ interface QueueItem {
|
|
|
16
16
|
resolve: (value?: unknown) => void;
|
|
17
17
|
reject: (reason?: unknown) => void;
|
|
18
18
|
}
|
|
19
|
+
interface PromiseQueueOptions {
|
|
20
|
+
quiet?: boolean;
|
|
21
|
+
}
|
|
19
22
|
declare class PromiseQueue {
|
|
20
23
|
queue: QueueItem[];
|
|
21
24
|
running: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
options: PromiseQueueOptions;
|
|
26
|
+
constructor(options?: PromiseQueueOptions);
|
|
27
|
+
push(method: (...args: any) => any, thisObject: any, ...args: any[]): Promise<unknown>;
|
|
24
28
|
run(): void;
|
|
25
29
|
}
|
|
26
30
|
export default PromiseQueue;
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { StorageManager } from './StorageManager';
|
|
13
|
-
import { TransactionMeta, PKCETransactionMeta, OAuthTransactionMeta, TransactionMetaOptions, TransactionManagerOptions } from './types';
|
|
14
|
-
import { RawIdxResponse } from './idx/types/idx-js';
|
|
13
|
+
import { TransactionMeta, PKCETransactionMeta, OAuthTransactionMeta, TransactionMetaOptions, TransactionManagerOptions, SavedIdxResponse } from './types';
|
|
15
14
|
export interface ClearTransactionMetaOptions extends TransactionMetaOptions {
|
|
16
15
|
clearSharedStorage?: boolean;
|
|
17
16
|
}
|
|
@@ -33,7 +32,7 @@ export default class TransactionManager {
|
|
|
33
32
|
loadLegacyPKCE(): PKCETransactionMeta;
|
|
34
33
|
clearLegacyOAuthParams(): void;
|
|
35
34
|
loadLegacyOAuthParams(): OAuthTransactionMeta;
|
|
36
|
-
saveIdxResponse(
|
|
37
|
-
loadIdxResponse():
|
|
35
|
+
saveIdxResponse({ rawIdxResponse, requestDidSucceed }: SavedIdxResponse): void;
|
|
36
|
+
loadIdxResponse(): SavedIdxResponse | null;
|
|
38
37
|
clearIdxResponse(): void;
|
|
39
38
|
}
|
|
@@ -6,6 +6,6 @@ export declare abstract class Authenticator<Values> {
|
|
|
6
6
|
meta: IdxAuthenticator;
|
|
7
7
|
constructor(authenticator: IdxAuthenticator);
|
|
8
8
|
abstract canVerify(values: Values): boolean;
|
|
9
|
-
abstract mapCredentials(values: Values): Credentials;
|
|
9
|
+
abstract mapCredentials(values: Values): Credentials | undefined;
|
|
10
10
|
abstract getInputs(idxRemediationValue: IdxRemediationValue): any;
|
|
11
11
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Authenticator, Credentials } from './Authenticator';
|
|
2
2
|
export interface OktaPasswordInputValues {
|
|
3
3
|
password?: string;
|
|
4
|
+
credentials?: Credentials;
|
|
4
5
|
}
|
|
5
6
|
export declare class OktaPassword extends Authenticator<OktaPasswordInputValues> {
|
|
6
7
|
canVerify(values: OktaPasswordInputValues): boolean;
|
|
7
|
-
mapCredentials(values: OktaPasswordInputValues): Credentials;
|
|
8
|
+
mapCredentials(values: OktaPasswordInputValues): Credentials | undefined;
|
|
8
9
|
getInputs(idxRemediationValue: any): any;
|
|
9
10
|
}
|
|
@@ -4,6 +4,6 @@ interface TotpCredentials extends Credentials {
|
|
|
4
4
|
totp: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class OktaVerifyTotp extends VerificationCodeAuthenticator {
|
|
7
|
-
mapCredentials(values: any): TotpCredentials;
|
|
7
|
+
mapCredentials(values: any): TotpCredentials | undefined;
|
|
8
8
|
}
|
|
9
9
|
export {};
|
|
@@ -3,27 +3,25 @@ export interface SecurityQuestionEnrollValues {
|
|
|
3
3
|
questionKey?: string;
|
|
4
4
|
question?: string;
|
|
5
5
|
answer?: string;
|
|
6
|
+
credentials?: Credentials;
|
|
6
7
|
}
|
|
7
8
|
export declare class SecurityQuestionEnrollment extends Authenticator<SecurityQuestionEnrollValues> {
|
|
8
9
|
canVerify(values: SecurityQuestionEnrollValues): boolean;
|
|
9
|
-
mapCredentials(values: SecurityQuestionEnrollValues): Credentials;
|
|
10
|
+
mapCredentials(values: SecurityQuestionEnrollValues): Credentials | undefined;
|
|
10
11
|
getInputs(): ({
|
|
11
12
|
name: string;
|
|
12
13
|
type: string;
|
|
13
|
-
|
|
14
|
+
required: boolean;
|
|
14
15
|
label?: undefined;
|
|
15
|
-
required?: undefined;
|
|
16
16
|
} | {
|
|
17
17
|
name: string;
|
|
18
18
|
type: string;
|
|
19
19
|
label: string;
|
|
20
|
-
require?: undefined;
|
|
21
20
|
required?: undefined;
|
|
22
21
|
} | {
|
|
23
22
|
name: string;
|
|
24
23
|
type: string;
|
|
25
24
|
label: string;
|
|
26
25
|
required: boolean;
|
|
27
|
-
require?: undefined;
|
|
28
26
|
})[];
|
|
29
27
|
}
|
|
@@ -4,7 +4,7 @@ export interface SecurityQuestionVerificationValues {
|
|
|
4
4
|
}
|
|
5
5
|
export declare class SecurityQuestionVerification extends Authenticator<SecurityQuestionVerificationValues> {
|
|
6
6
|
canVerify(values: SecurityQuestionVerificationValues): boolean;
|
|
7
|
-
mapCredentials(values: SecurityQuestionVerificationValues): Credentials;
|
|
7
|
+
mapCredentials(values: SecurityQuestionVerificationValues): Credentials | undefined;
|
|
8
8
|
getInputs(): {
|
|
9
9
|
name: string;
|
|
10
10
|
type: string;
|
|
@@ -2,13 +2,14 @@ import { Authenticator, Credentials } from './Authenticator';
|
|
|
2
2
|
export interface VerificationCodeValues {
|
|
3
3
|
verificationCode?: string;
|
|
4
4
|
otp?: string;
|
|
5
|
+
credentials?: Credentials;
|
|
5
6
|
}
|
|
6
7
|
interface VerificationCodeCredentials extends Credentials {
|
|
7
8
|
passcode: string;
|
|
8
9
|
}
|
|
9
10
|
export declare class VerificationCodeAuthenticator extends Authenticator<VerificationCodeValues> {
|
|
10
11
|
canVerify(values: VerificationCodeValues): boolean;
|
|
11
|
-
mapCredentials(values: any): VerificationCodeCredentials | Credentials;
|
|
12
|
+
mapCredentials(values: any): VerificationCodeCredentials | Credentials | undefined;
|
|
12
13
|
getInputs(idxRemediationValue: any): any;
|
|
13
14
|
}
|
|
14
15
|
export {};
|
|
@@ -5,7 +5,7 @@ export interface WebauthnEnrollValues {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class WebauthnEnrollment extends Authenticator<WebauthnEnrollValues> {
|
|
7
7
|
canVerify(values: WebauthnEnrollValues): boolean;
|
|
8
|
-
mapCredentials(values: WebauthnEnrollValues): Credentials;
|
|
8
|
+
mapCredentials(values: WebauthnEnrollValues): Credentials | undefined;
|
|
9
9
|
getInputs(): {
|
|
10
10
|
name: string;
|
|
11
11
|
type: string;
|
|
@@ -6,7 +6,7 @@ export interface WebauthnVerificationValues {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class WebauthnVerification extends Authenticator<WebauthnVerificationValues> {
|
|
8
8
|
canVerify(values: WebauthnVerificationValues): boolean;
|
|
9
|
-
mapCredentials(values: WebauthnVerificationValues): Credentials;
|
|
9
|
+
mapCredentials(values: WebauthnVerificationValues): Credentials | undefined;
|
|
10
10
|
getInputs(): {
|
|
11
11
|
name: string;
|
|
12
12
|
type: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Authenticator } from '../types';
|
|
2
|
+
export declare function formatAuthenticator(incoming: unknown): Authenticator;
|
|
3
|
+
export declare function compareAuthenticators(auth1: any, auth2: any): boolean;
|
|
4
|
+
export declare function findMatchedOption(authenticators: any, options: any): any;
|
|
@@ -10,23 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
declare const _default: {
|
|
13
|
-
|
|
14
|
-
withCredentials: any;
|
|
15
|
-
clientId: any;
|
|
16
|
-
domain: any;
|
|
17
|
-
issuer: any;
|
|
18
|
-
stateHandle: any;
|
|
19
|
-
interactionHandle: any;
|
|
20
|
-
version: any;
|
|
21
|
-
redirectUri: any;
|
|
22
|
-
state: any;
|
|
23
|
-
scopes: any;
|
|
24
|
-
codeChallenge: any;
|
|
25
|
-
codeChallengeMethod: any;
|
|
26
|
-
activationToken: any;
|
|
27
|
-
recoveryToken: any;
|
|
28
|
-
}) => Promise<import("../types/idx-js").IdxResponse>;
|
|
29
|
-
introspect: ({ withCredentials, domain, interactionHandle, stateHandle, version, }: import("./introspect").IntrospectOptions) => Promise<any>;
|
|
13
|
+
introspect: ({ withCredentials, domain, interactionHandle, stateHandle, version, }: import("./introspect").IntrospectOptions) => Promise<import("../..").RawIdxResponse>;
|
|
30
14
|
interact: ({ withCredentials, clientId, baseUrl, scopes, redirectUri, codeChallenge, codeChallengeMethod, state, activationToken, recoveryToken, clientSecret, }: {
|
|
31
15
|
withCredentials: any;
|
|
32
16
|
clientId: any;
|
|
@@ -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 { RawIdxResponse } from '../types';
|
|
12
13
|
export interface IntrospectOptions {
|
|
13
14
|
domain: string;
|
|
14
15
|
withCredentials?: boolean;
|
|
@@ -16,5 +17,5 @@ export interface IntrospectOptions {
|
|
|
16
17
|
stateHandle?: string;
|
|
17
18
|
version?: string;
|
|
18
19
|
}
|
|
19
|
-
declare const introspect: ({ withCredentials, domain, interactionHandle, stateHandle, version, }: IntrospectOptions) => Promise<
|
|
20
|
+
declare const introspect: ({ withCredentials, domain, interactionHandle, stateHandle, version, }: IntrospectOptions) => Promise<RawIdxResponse>;
|
|
20
21
|
export default introspect;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
declare const generateIdxAction: (actionDefinition: any, toPersist: any) => (params: any) => Promise<import("
|
|
12
|
+
declare const generateIdxAction: (actionDefinition: any, toPersist: any) => (params: any) => Promise<import("../../..").IdxResponse>;
|
|
13
13
|
export default generateIdxAction;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { IdxResponse } from '../../types/idx-js';
|
|
13
|
-
export declare function makeIdxState(idxResponse:
|
|
12
|
+
import { IdxResponse, RawIdxResponse } from '../../types/idx-js';
|
|
13
|
+
export declare function makeIdxState(idxResponse: RawIdxResponse, toPersist: any, requestDidSucceed: boolean): IdxResponse;
|
package/lib/idx/proceed.d.ts
CHANGED
|
@@ -18,7 +18,5 @@ import { AccountUnlockOptions } from './unlockAccount';
|
|
|
18
18
|
export declare type ProceedOptions = AuthenticationOptions & RegistrationOptions & PasswordRecoveryOptions & AccountUnlockOptions & EnrollPollOptions & SelectEnrollmentChannelOptions & {
|
|
19
19
|
step?: string;
|
|
20
20
|
};
|
|
21
|
-
export declare function canProceed(authClient: OktaAuthInterface, options?:
|
|
22
|
-
state?: string;
|
|
23
|
-
}): boolean;
|
|
21
|
+
export declare function canProceed(authClient: OktaAuthInterface, options?: ProceedOptions): boolean;
|
|
24
22
|
export declare function proceed(authClient: OktaAuthInterface, options?: ProceedOptions): Promise<IdxTransaction>;
|
package/lib/idx/remediate.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { NextStep, IdxMessage, FlowIdentifier } from './types';
|
|
|
14
14
|
import { RemediationFlow } from './flow';
|
|
15
15
|
import { IdxResponse, IdxRemediation } from './types/idx-js';
|
|
16
16
|
interface RemediationResponse {
|
|
17
|
-
idxResponse
|
|
17
|
+
idxResponse: IdxResponse;
|
|
18
18
|
nextStep?: NextStep;
|
|
19
19
|
messages?: IdxMessage[];
|
|
20
20
|
terminal?: boolean;
|
|
@@ -26,6 +26,6 @@ export interface RemediateOptions {
|
|
|
26
26
|
flow?: FlowIdentifier;
|
|
27
27
|
step?: string;
|
|
28
28
|
}
|
|
29
|
-
export declare function getRemediator(idxRemediations: IdxRemediation[], values: RemediationValues, options: RemediateOptions): Remediator;
|
|
29
|
+
export declare function getRemediator(idxRemediations: IdxRemediation[], values: RemediationValues, options: RemediateOptions): Remediator | undefined;
|
|
30
30
|
export declare function remediate(idxResponse: IdxResponse, values: RemediationValues, options: RemediateOptions): Promise<RemediationResponse>;
|
|
31
31
|
export {};
|
|
@@ -15,9 +15,6 @@ export declare type AuthenticatorDataValues = RemediationValues & {
|
|
|
15
15
|
methodType?: string;
|
|
16
16
|
};
|
|
17
17
|
export declare class AuthenticatorData extends Remediator {
|
|
18
|
-
map: {
|
|
19
|
-
authenticator: never[];
|
|
20
|
-
};
|
|
21
18
|
values: AuthenticatorDataValues;
|
|
22
19
|
authenticator: IdxAuthenticator;
|
|
23
20
|
constructor(remediation: IdxRemediation, values?: AuthenticatorDataValues);
|
|
@@ -9,21 +9,22 @@
|
|
|
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, IdxOptions } from '../../types';
|
|
12
|
+
import { NextStep, IdxMessage, Authenticator, IdxOptions, RemediateOptions } from '../../types';
|
|
13
13
|
import { IdxAuthenticator, IdxRemediation, IdxContext } from '../../types/idx-js';
|
|
14
14
|
export declare type IdxToRemediationValueMap = Record<string, string[]>;
|
|
15
15
|
export interface RemediationValues extends IdxOptions {
|
|
16
16
|
stateHandle?: string;
|
|
17
|
-
authenticators?: Authenticator
|
|
18
|
-
authenticator?: string;
|
|
17
|
+
authenticators?: (Authenticator | string)[];
|
|
18
|
+
authenticator?: string | Authenticator;
|
|
19
19
|
authenticatorsData?: Authenticator[];
|
|
20
20
|
}
|
|
21
21
|
export declare class Remediator {
|
|
22
22
|
static remediationName: string;
|
|
23
23
|
remediation: IdxRemediation;
|
|
24
24
|
values: RemediationValues;
|
|
25
|
+
options: RemediateOptions;
|
|
25
26
|
map?: IdxToRemediationValueMap;
|
|
26
|
-
constructor(remediation: IdxRemediation, values?: RemediationValues);
|
|
27
|
+
constructor(remediation: IdxRemediation, values?: RemediationValues, options?: RemediateOptions);
|
|
27
28
|
private formatAuthenticators;
|
|
28
29
|
getName(): string;
|
|
29
30
|
canRemediate(): boolean;
|
|
@@ -10,17 +10,15 @@
|
|
|
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 { IdxRemediationValue } from '../../types/idx-js';
|
|
14
|
+
import { Authenticator } from '../../types';
|
|
14
15
|
export declare type SelectAuthenticatorValues = RemediationValues & {
|
|
15
|
-
authenticator?: string;
|
|
16
|
+
authenticator?: string | Authenticator;
|
|
16
17
|
};
|
|
17
18
|
export declare class SelectAuthenticator extends Remediator {
|
|
18
19
|
values: SelectAuthenticatorValues;
|
|
19
|
-
selectedAuthenticator?:
|
|
20
|
+
selectedAuthenticator?: Authenticator;
|
|
20
21
|
selectedOption?: any;
|
|
21
|
-
map: {
|
|
22
|
-
authenticator: never[];
|
|
23
|
-
};
|
|
24
22
|
findMatchedOption(authenticators: any, options: any): any;
|
|
25
23
|
canRemediate(): boolean;
|
|
26
24
|
getNextStep(): {
|
|
@@ -29,14 +27,14 @@ export declare class SelectAuthenticator extends Remediator {
|
|
|
29
27
|
value: string;
|
|
30
28
|
}[];
|
|
31
29
|
name: string;
|
|
32
|
-
authenticator?: IdxAuthenticator | undefined;
|
|
30
|
+
authenticator?: import("../../types").IdxAuthenticator | undefined;
|
|
33
31
|
canSkip?: boolean | undefined;
|
|
34
32
|
canResend?: boolean | undefined;
|
|
35
33
|
inputs?: import("../../types").Input[] | undefined;
|
|
36
34
|
poll?: import("../../types").IdxPollOptions | undefined;
|
|
37
|
-
authenticatorEnrollments?: IdxAuthenticator[] | undefined;
|
|
35
|
+
authenticatorEnrollments?: import("../../types").IdxAuthenticator[] | undefined;
|
|
38
36
|
};
|
|
39
|
-
mapAuthenticator(remediationValue: IdxRemediationValue): {
|
|
37
|
+
mapAuthenticator(remediationValue: IdxRemediationValue): Authenticator | {
|
|
40
38
|
id: any;
|
|
41
39
|
};
|
|
42
40
|
getInputAuthenticator(): {
|
|
@@ -17,12 +17,10 @@ export declare type VerifyAuthenticatorValues = AuthenticatorValues & Remediatio
|
|
|
17
17
|
export declare class VerifyAuthenticator extends Remediator {
|
|
18
18
|
authenticator: Authenticator<VerifyAuthenticatorValues>;
|
|
19
19
|
values: VerifyAuthenticatorValues;
|
|
20
|
-
map: {
|
|
21
|
-
credentials: never[];
|
|
22
|
-
};
|
|
23
20
|
constructor(remediation: IdxRemediation, values?: VerifyAuthenticatorValues);
|
|
24
21
|
getNextStep(context?: IdxContext): NextStep;
|
|
25
22
|
canRemediate(): boolean;
|
|
26
|
-
mapCredentials(): import("../../authenticator").Credentials;
|
|
23
|
+
mapCredentials(): import("../../authenticator").Credentials | undefined;
|
|
27
24
|
getInputCredentials(input: any): any;
|
|
25
|
+
getValuesAfterProceed(): VerifyAuthenticatorValues;
|
|
28
26
|
}
|
|
@@ -18,9 +18,6 @@ export interface EnrollProfileValues extends RemediationValues {
|
|
|
18
18
|
export declare class EnrollProfile extends Remediator {
|
|
19
19
|
static remediationName: string;
|
|
20
20
|
values: EnrollProfileValues;
|
|
21
|
-
map: {
|
|
22
|
-
userProfile: never[];
|
|
23
|
-
};
|
|
24
21
|
canRemediate(): boolean;
|
|
25
22
|
mapUserProfile({ form: { value: profileAttributes } }: {
|
|
26
23
|
form: {
|
|
@@ -18,10 +18,6 @@ export declare type EnrollmentChannelDataValues = RemediationValues & {
|
|
|
18
18
|
export declare class EnrollmentChannelData extends Remediator {
|
|
19
19
|
static remediationName: string;
|
|
20
20
|
values: EnrollmentChannelDataValues;
|
|
21
|
-
map: {
|
|
22
|
-
email: never[];
|
|
23
|
-
phoneNumber: never[];
|
|
24
|
-
};
|
|
25
21
|
getInputEmail(): {
|
|
26
22
|
name: string;
|
|
27
23
|
type: string;
|
|
@@ -9,22 +9,20 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
import { Credentials } from '../authenticator';
|
|
12
13
|
import { Remediator, RemediationValues } from './Base/Remediator';
|
|
13
14
|
export interface IdentifyValues extends RemediationValues {
|
|
14
15
|
username?: string;
|
|
15
16
|
password?: string;
|
|
17
|
+
credentials?: Credentials;
|
|
16
18
|
}
|
|
17
19
|
export declare class Identify extends Remediator {
|
|
18
20
|
static remediationName: string;
|
|
19
21
|
values: IdentifyValues;
|
|
20
22
|
map: {
|
|
21
23
|
identifier: string[];
|
|
22
|
-
credentials: never[];
|
|
23
|
-
rememberMe: string[];
|
|
24
24
|
};
|
|
25
25
|
canRemediate(): boolean;
|
|
26
|
-
mapCredentials():
|
|
27
|
-
passcode: string | undefined;
|
|
28
|
-
};
|
|
26
|
+
mapCredentials(): Credentials | undefined;
|
|
29
27
|
getInputCredentials(input: any): any;
|
|
30
28
|
}
|
|
@@ -16,11 +16,8 @@ export interface ReEnrollAuthenticatorValues extends RemediationValues {
|
|
|
16
16
|
export declare class ReEnrollAuthenticator extends Remediator {
|
|
17
17
|
static remediationName: string;
|
|
18
18
|
values: ReEnrollAuthenticatorValues;
|
|
19
|
-
map: {
|
|
20
|
-
credentials: never[];
|
|
21
|
-
};
|
|
22
19
|
mapCredentials(): {
|
|
23
|
-
passcode: string
|
|
24
|
-
};
|
|
20
|
+
passcode: string;
|
|
21
|
+
} | undefined;
|
|
25
22
|
getInputCredentials(input: any): any;
|
|
26
23
|
}
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';
|
|
13
13
|
import { IdxRemediation } from '../types/idx-js';
|
|
14
|
+
import { RemediateOptions } from '../types';
|
|
14
15
|
export declare type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {
|
|
15
16
|
password?: string;
|
|
16
17
|
};
|
|
17
18
|
export declare class SelectAuthenticatorAuthenticate extends SelectAuthenticator {
|
|
18
19
|
static remediationName: string;
|
|
19
20
|
values: SelectAuthenticatorAuthenticateValues;
|
|
20
|
-
constructor(remediation: IdxRemediation, values?: SelectAuthenticatorValues);
|
|
21
|
+
constructor(remediation: IdxRemediation, values?: SelectAuthenticatorValues, options?: RemediateOptions);
|
|
21
22
|
}
|
|
@@ -21,11 +21,10 @@ export declare class SelectAuthenticatorUnlockAccount extends SelectAuthenticato
|
|
|
21
21
|
values: SelectAuthenticatorUnlockAccountValues;
|
|
22
22
|
authenticator?: Authenticator;
|
|
23
23
|
map: {
|
|
24
|
-
authenticator: never[];
|
|
25
24
|
identifier: string[];
|
|
26
25
|
};
|
|
27
26
|
canRemediate(): boolean;
|
|
28
|
-
mapAuthenticator(remediationValue: IdxRemediationValue): {
|
|
27
|
+
mapAuthenticator(remediationValue: IdxRemediationValue): Authenticator | {
|
|
29
28
|
id: any;
|
|
30
29
|
} | {
|
|
31
30
|
methodType: string;
|
|
@@ -76,6 +76,7 @@ export interface IdxAuthenticator {
|
|
|
76
76
|
challengeData?: ChallengeData;
|
|
77
77
|
};
|
|
78
78
|
credentialId?: string;
|
|
79
|
+
enrollmentId?: string;
|
|
79
80
|
}
|
|
80
81
|
export interface IdxForm {
|
|
81
82
|
value: IdxRemediationValue[];
|
|
@@ -179,10 +180,12 @@ export interface RawIdxResponse {
|
|
|
179
180
|
value: IdxRemediation[];
|
|
180
181
|
};
|
|
181
182
|
messages?: IdxMessages;
|
|
183
|
+
success?: boolean;
|
|
184
|
+
successWithInteractionCode?: IdxRemediation;
|
|
182
185
|
}
|
|
183
186
|
export declare function isRawIdxResponse(obj: any): obj is RawIdxResponse;
|
|
184
187
|
export interface IdxActions {
|
|
185
|
-
[key: string]:
|
|
188
|
+
[key: string]: () => Promise<IdxResponse>;
|
|
186
189
|
}
|
|
187
190
|
export interface IdxResponse {
|
|
188
191
|
proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;
|
|
@@ -194,5 +197,6 @@ export interface IdxResponse {
|
|
|
194
197
|
interactionHandle?: string;
|
|
195
198
|
};
|
|
196
199
|
context?: IdxContext;
|
|
200
|
+
requestDidSucceed?: boolean;
|
|
197
201
|
}
|
|
198
202
|
export declare function isIdxResponse(obj: any): obj is IdxResponse;
|
package/lib/idx/types/index.d.ts
CHANGED
|
@@ -15,13 +15,14 @@ import { APIError, Tokens } from '../../types';
|
|
|
15
15
|
import { PKCETransactionMeta } from '../../types/Transaction';
|
|
16
16
|
import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse } from './idx-js';
|
|
17
17
|
import { FlowIdentifier } from './FlowIdentifier';
|
|
18
|
-
export { IdxMessage, ChallengeData, ActivationData } from './idx-js';
|
|
18
|
+
export { IdxMessage, IdxMessages, ChallengeData, ActivationData, IdxResponse, IdxContext, RawIdxResponse } from './idx-js';
|
|
19
19
|
export { AuthenticationOptions } from '../authenticate';
|
|
20
20
|
export { RegistrationOptions } from '../register';
|
|
21
21
|
export { PasswordRecoveryOptions } from '../recoverPassword';
|
|
22
22
|
export { AccountUnlockOptions } from '../unlockAccount';
|
|
23
23
|
export { ProceedOptions } from '../proceed';
|
|
24
24
|
export { CancelOptions } from '../cancel';
|
|
25
|
+
export { RemediateOptions } from '../remediate';
|
|
25
26
|
export { FlowIdentifier };
|
|
26
27
|
export { IdxAuthenticator };
|
|
27
28
|
export { EmailVerifyCallbackResponse } from '../emailVerify';
|
|
@@ -84,7 +85,7 @@ export interface IdxTransaction {
|
|
|
84
85
|
tokens?: Tokens;
|
|
85
86
|
nextStep?: NextStep;
|
|
86
87
|
messages?: IdxMessage[];
|
|
87
|
-
error?: APIError;
|
|
88
|
+
error?: APIError | IdxResponse;
|
|
88
89
|
meta?: IdxTransactionMeta;
|
|
89
90
|
enabledFeatures?: IdxFeature[];
|
|
90
91
|
availableSteps?: NextStep[];
|
|
@@ -99,13 +100,16 @@ export declare type IdxOptions = InteractOptions & IntrospectOptions & {
|
|
|
99
100
|
flow?: FlowIdentifier;
|
|
100
101
|
exchangeCodeForTokens?: boolean;
|
|
101
102
|
autoRemediate?: boolean;
|
|
103
|
+
step?: string;
|
|
102
104
|
};
|
|
103
105
|
export interface IdxPollOptions {
|
|
104
106
|
required?: boolean;
|
|
105
107
|
refresh?: number;
|
|
106
108
|
}
|
|
107
109
|
export declare type Authenticator = {
|
|
108
|
-
|
|
110
|
+
id?: string;
|
|
111
|
+
key?: string;
|
|
109
112
|
methodType?: string;
|
|
110
113
|
phoneNumber?: string;
|
|
111
114
|
};
|
|
115
|
+
export declare function isAuthenticator(obj: any): obj is Authenticator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RemediationValues } from './remediators';
|
|
2
|
+
import { IdxFeature, NextStep } from './types';
|
|
3
|
+
import { IdxMessage, IdxRemediationValue, IdxResponse } from './types/idx-js';
|
|
4
|
+
export declare function isTerminalResponse(idxResponse: IdxResponse): boolean;
|
|
5
|
+
export declare function canSkipFn(idxResponse: IdxResponse): boolean;
|
|
6
|
+
export declare function canResendFn(idxResponse: IdxResponse): boolean;
|
|
7
|
+
export declare function getMessagesFromIdxRemediationValue(value?: IdxRemediationValue[]): IdxMessage[] | undefined;
|
|
8
|
+
export declare function getMessagesFromResponse(idxResponse: IdxResponse): IdxMessage[];
|
|
9
|
+
export declare function getEnabledFeatures(idxResponse: IdxResponse): IdxFeature[];
|
|
10
|
+
export declare function getAvailableSteps(idxResponse: IdxResponse): NextStep[];
|
|
11
|
+
export declare function filterValuesForRemediation(idxResponse: IdxResponse, values: RemediationValues): RemediationValues;
|
package/lib/options/browser.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { StorageManagerOptions, OktaAuthOptions } from '../types';
|
|
13
|
-
export
|
|
12
|
+
import { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';
|
|
13
|
+
export declare function getStorage(): StorageUtil;
|
|
14
14
|
export declare const STORAGE_MANAGER_OPTIONS: StorageManagerOptions;
|
|
15
15
|
export declare const enableSharedStorage = true;
|
|
16
16
|
export declare function getCookieSettings(args: OktaAuthOptions | undefined, isHTTPS: boolean): import("../types").CookieOptions;
|
package/lib/options/node.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { StorageManagerOptions, OktaAuthOptions } from '../types';
|
|
13
|
-
export
|
|
12
|
+
import { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';
|
|
13
|
+
export declare function getStorage(): StorageUtil;
|
|
14
14
|
export declare const STORAGE_MANAGER_OPTIONS: StorageManagerOptions;
|
|
15
15
|
export declare const enableSharedStorage = false;
|
|
16
16
|
export declare function getCookieSettings(args?: OktaAuthOptions, isHTTPS?: boolean): import("../types").CookieOptions | undefined;
|
package/lib/types/Storage.d.ts
CHANGED
|
@@ -40,9 +40,13 @@ export interface TransactionStorage extends StorageProvider {
|
|
|
40
40
|
setStorage(obj: TransactionMeta): void;
|
|
41
41
|
getStorage(): TransactionMeta;
|
|
42
42
|
}
|
|
43
|
+
export interface SavedIdxResponse {
|
|
44
|
+
rawIdxResponse: RawIdxResponse;
|
|
45
|
+
requestDidSucceed?: boolean;
|
|
46
|
+
}
|
|
43
47
|
export interface IdxResponseStorage extends StorageProvider {
|
|
44
|
-
setStorage(obj:
|
|
45
|
-
getStorage():
|
|
48
|
+
setStorage(obj: SavedIdxResponse): void;
|
|
49
|
+
getStorage(): SavedIdxResponse;
|
|
46
50
|
}
|
|
47
51
|
export interface StorageOptions extends CookieOptions {
|
|
48
52
|
storageType?: StorageType;
|
|
@@ -68,9 +72,7 @@ export interface BrowserStorageUtil extends StorageUtil {
|
|
|
68
72
|
getCookieStorage(options?: StorageOptions): CookieStorage;
|
|
69
73
|
testStorage(storage: any): boolean;
|
|
70
74
|
storage: Cookies;
|
|
71
|
-
inMemoryStore:
|
|
72
|
-
string?: string;
|
|
73
|
-
};
|
|
75
|
+
inMemoryStore: Record<string, unknown>;
|
|
74
76
|
getHttpCache(options?: StorageOptions): StorageProvider;
|
|
75
77
|
getPKCEStorage(options?: StorageOptions): PKCEStorage;
|
|
76
78
|
}
|
package/lib/types/api.d.ts
CHANGED
|
@@ -232,9 +232,7 @@ export interface IdxAPI {
|
|
|
232
232
|
unlockAccount: (options?: AccountUnlockOptions) => Promise<IdxTransaction>;
|
|
233
233
|
poll: (options?: IdxPollOptions) => Promise<IdxTransaction>;
|
|
234
234
|
start: (options?: IdxOptions) => Promise<IdxTransaction>;
|
|
235
|
-
canProceed(options?:
|
|
236
|
-
state?: string;
|
|
237
|
-
}): boolean;
|
|
235
|
+
canProceed(options?: ProceedOptions): boolean;
|
|
238
236
|
proceed: (options?: ProceedOptions) => Promise<IdxTransaction>;
|
|
239
237
|
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
240
238
|
getFlow(): FlowIdentifier | undefined;
|