@okta/okta-auth-js 6.1.0 → 6.3.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 +55 -0
- package/README.md +53 -23
- package/cjs/AuthStateManager.js +14 -7
- package/cjs/AuthStateManager.js.map +1 -1
- package/cjs/OktaAuth.js +30 -14
- package/cjs/OktaAuth.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 +195 -0
- package/cjs/ServiceManager.js.map +1 -0
- package/cjs/TokenManager.js +6 -14
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/TransactionManager.js +11 -5
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/browser/browserStorage.js +31 -25
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/crypto/node.js +19 -13
- package/cjs/crypto/node.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 +56 -15
- 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 +270 -195
- 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 +86 -0
- package/cjs/options/browser.js.map +1 -0
- package/cjs/options/index.js +94 -0
- package/cjs/options/index.js.map +1 -0
- package/cjs/options/node.js +45 -0
- package/cjs/options/node.js.map +1 -0
- package/cjs/options.js +11 -1
- package/cjs/options.js.map +1 -1
- package/cjs/server/serverStorage.js +7 -4
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/AutoRenewService.js +94 -0
- package/cjs/services/AutoRenewService.js.map +1 -0
- package/cjs/services/SyncStorageService.js +93 -0
- package/cjs/services/SyncStorageService.js.map +1 -0
- package/cjs/services/index.js +30 -0
- package/cjs/services/index.js.map +1 -0
- package/cjs/types/Service.js +2 -0
- package/cjs/types/Service.js.map +1 -0
- package/cjs/types/index.js +13 -0
- package/cjs/types/index.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.LICENSE.txt +0 -8
- 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.LICENSE.txt +1 -7
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/{index.js → esm.browser.js} +2144 -2975
- package/esm/esm.browser.js.map +1 -0
- package/esm/esm.node.mjs +9595 -0
- package/esm/esm.node.mjs.map +1 -0
- package/lib/AuthStateManager.d.ts +3 -3
- package/lib/OktaAuth.d.ts +5 -4
- package/lib/PromiseQueue.d.ts +6 -2
- package/lib/ServiceManager.d.ts +38 -0
- package/lib/TokenManager.d.ts +0 -1
- 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 +6 -5
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +5 -9
- 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 +16 -0
- package/lib/options/index.d.ts +14 -0
- package/lib/options/node.d.ts +16 -0
- package/lib/services/AutoRenewService.d.ts +27 -0
- package/lib/services/{TokenService.d.ts → SyncStorageService.d.ts} +8 -5
- package/lib/services/index.d.ts +13 -0
- package/lib/types/OktaAuthOptions.d.ts +5 -0
- package/lib/types/Service.d.ts +23 -0
- package/lib/types/Storage.d.ts +7 -5
- package/lib/types/api.d.ts +6 -5
- package/lib/types/index.d.ts +1 -0
- package/package.json +26 -11
- package/cjs/services/TokenService.js +0 -111
- package/cjs/services/TokenService.js.map +0 -1
- package/esm/index.js.map +0 -1
|
@@ -11,17 +11,18 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AuthState, AuthStateLogOptions } from './types';
|
|
13
13
|
import { OktaAuth } from '.';
|
|
14
|
-
|
|
14
|
+
import PromiseQueue from './PromiseQueue';
|
|
15
15
|
export declare const INITIAL_AUTH_STATE: null;
|
|
16
16
|
export declare class AuthStateManager {
|
|
17
17
|
_sdk: OktaAuth;
|
|
18
18
|
_pending: {
|
|
19
|
-
updateAuthStatePromise:
|
|
19
|
+
updateAuthStatePromise: any;
|
|
20
20
|
canceledTimes: number;
|
|
21
21
|
};
|
|
22
22
|
_authState: AuthState | null;
|
|
23
23
|
_prevAuthState: AuthState | null;
|
|
24
24
|
_logOptions: AuthStateLogOptions;
|
|
25
|
+
_transformQueue: PromiseQueue;
|
|
25
26
|
constructor(sdk: OktaAuth);
|
|
26
27
|
_setLogOptions(options: any): void;
|
|
27
28
|
getAuthState(): AuthState | null;
|
|
@@ -30,4 +31,3 @@ export declare class AuthStateManager {
|
|
|
30
31
|
subscribe(handler: any): void;
|
|
31
32
|
unsubscribe(handler?: any): void;
|
|
32
33
|
}
|
|
33
|
-
export {};
|
package/lib/OktaAuth.d.ts
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { OktaAuthInterface, OktaAuthOptions, AccessToken, RefreshToken, TokenAPI, FeaturesAPI, CryptoAPI, WebauthnAPI, SignoutAPI, FingerprintAPI, UserClaims, SigninWithRedirectOptions, SigninWithCredentialsOptions, SignoutOptions, Tokens, ForgotPasswordOptions, VerifyRecoveryTokenOptions, TransactionAPI, SessionAPI, SigninAPI, PkceAPI, SigninOptions, IdxAPI, SignoutRedirectUrlOptions, HttpAPI, RequestOptions } from './types';
|
|
12
|
+
import { OktaAuthInterface, OktaAuthOptions, AccessToken, RefreshToken, TokenAPI, FeaturesAPI, CryptoAPI, WebauthnAPI, SignoutAPI, FingerprintAPI, UserClaims, SigninWithRedirectOptions, SigninWithCredentialsOptions, SignoutOptions, Tokens, ForgotPasswordOptions, VerifyRecoveryTokenOptions, TransactionAPI, SessionAPI, SigninAPI, PkceAPI, SigninOptions, IdxAPI, SignoutRedirectUrlOptions, HttpAPI, RequestOptions, IsAuthenticatedOptions } from './types';
|
|
13
13
|
import { AuthTransaction } from './tx';
|
|
14
14
|
import { TokenManager } from './TokenManager';
|
|
15
|
+
import { ServiceManager } from './ServiceManager';
|
|
15
16
|
import PromiseQueue from './PromiseQueue';
|
|
16
17
|
import { AuthStateManager } from './AuthStateManager';
|
|
17
18
|
import { StorageManager } from './StorageManager';
|
|
18
19
|
import TransactionManager from './TransactionManager';
|
|
19
20
|
import { OktaUserAgent } from './OktaUserAgent';
|
|
20
|
-
declare const Emitter: any;
|
|
21
21
|
declare class OktaAuth implements OktaAuthInterface, SigninAPI, SignoutAPI {
|
|
22
22
|
options: OktaAuthOptions;
|
|
23
23
|
storageManager: StorageManager;
|
|
@@ -32,9 +32,10 @@ declare class OktaAuth implements OktaAuthInterface, SigninAPI, SignoutAPI {
|
|
|
32
32
|
features: FeaturesAPI;
|
|
33
33
|
token: TokenAPI;
|
|
34
34
|
_tokenQueue: PromiseQueue;
|
|
35
|
-
emitter:
|
|
35
|
+
emitter: any;
|
|
36
36
|
tokenManager: TokenManager;
|
|
37
37
|
authStateManager: AuthStateManager;
|
|
38
|
+
serviceManager: ServiceManager;
|
|
38
39
|
http: HttpAPI;
|
|
39
40
|
fingerprint: FingerprintAPI;
|
|
40
41
|
_oktaUserAgent: OktaUserAgent;
|
|
@@ -54,7 +55,7 @@ declare class OktaAuth implements OktaAuthInterface, SigninAPI, SignoutAPI {
|
|
|
54
55
|
getSignOutRedirectUrl(options?: SignoutRedirectUrlOptions): string;
|
|
55
56
|
signOut(options?: SignoutOptions): Promise<void>;
|
|
56
57
|
webfinger(opts: any): Promise<object>;
|
|
57
|
-
isAuthenticated(): Promise<boolean>;
|
|
58
|
+
isAuthenticated(options?: IsAuthenticatedOptions): Promise<boolean>;
|
|
58
59
|
getUser(): Promise<UserClaims>;
|
|
59
60
|
getIdToken(): string | undefined;
|
|
60
61
|
getAccessToken(): string | undefined;
|
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;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { ServiceManagerInterface, ServiceInterface, ServiceManagerOptions } from './types';
|
|
13
|
+
import { OktaAuth } from '.';
|
|
14
|
+
export declare class ServiceManager implements ServiceManagerInterface {
|
|
15
|
+
private sdk;
|
|
16
|
+
private options;
|
|
17
|
+
private services;
|
|
18
|
+
private channel?;
|
|
19
|
+
private elector?;
|
|
20
|
+
private started;
|
|
21
|
+
private static knownServices;
|
|
22
|
+
private static defaultOptions;
|
|
23
|
+
constructor(sdk: OktaAuth, options?: ServiceManagerOptions);
|
|
24
|
+
static canUseLeaderElection(): boolean;
|
|
25
|
+
private onLeader;
|
|
26
|
+
private onLeaderDuplicate;
|
|
27
|
+
isLeader(): boolean;
|
|
28
|
+
hasLeader(): boolean | undefined;
|
|
29
|
+
isLeaderRequired(): boolean;
|
|
30
|
+
start(): void;
|
|
31
|
+
stop(): void;
|
|
32
|
+
getService(name: string): ServiceInterface | undefined;
|
|
33
|
+
private startServices;
|
|
34
|
+
private stopServices;
|
|
35
|
+
private startElector;
|
|
36
|
+
private stopElector;
|
|
37
|
+
private createService;
|
|
38
|
+
}
|
package/lib/TokenManager.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare class TokenManager implements TokenManagerInterface {
|
|
|
11
11
|
private storage;
|
|
12
12
|
private state;
|
|
13
13
|
private options;
|
|
14
|
-
private service;
|
|
15
14
|
on: (event: string, handler: TokenManagerErrorEventHandler | TokenManagerEventHandler, context?: object) => void;
|
|
16
15
|
off: (event: string, handler?: TokenManagerErrorEventHandler | TokenManagerEventHandler) => void;
|
|
17
16
|
constructor(sdk: OktaAuthInterface, options?: TokenManagerOptions);
|
|
@@ -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 {};
|
|
@@ -10,18 +10,19 @@
|
|
|
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 { IdxRemediation } from '../types/idx-js';
|
|
13
14
|
export declare type AuthenticatorVerificationDataValues = AuthenticatorDataValues;
|
|
14
15
|
export declare class AuthenticatorVerificationData extends AuthenticatorData {
|
|
15
16
|
static remediationName: string;
|
|
16
17
|
values: AuthenticatorVerificationDataValues;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
18
|
+
shouldProceedWithEmailAuthenticator: boolean;
|
|
19
|
+
constructor(remediation: IdxRemediation, values?: AuthenticatorDataValues);
|
|
20
|
+
canRemediate(): boolean;
|
|
21
|
+
mapAuthenticator(): {} | undefined;
|
|
22
22
|
getInputAuthenticator(): import("../types/idx-js").IdxRemediationValue[] | {
|
|
23
23
|
name: string;
|
|
24
24
|
type: string;
|
|
25
25
|
required: boolean;
|
|
26
26
|
};
|
|
27
|
+
getValuesAfterProceed(): AuthenticatorVerificationDataValues;
|
|
27
28
|
}
|
|
@@ -10,30 +10,26 @@
|
|
|
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 { IdxRemediationValue, IdxOption, IdxRemediation } from '../../types/idx-js';
|
|
14
|
-
import { Authenticator } from '../../types';
|
|
13
|
+
import { IdxRemediationValue, IdxOption, IdxRemediation, IdxAuthenticator } from '../../types/idx-js';
|
|
15
14
|
export declare type AuthenticatorDataValues = RemediationValues & {
|
|
16
15
|
methodType?: string;
|
|
17
16
|
};
|
|
18
17
|
export declare class AuthenticatorData extends Remediator {
|
|
19
|
-
map: {
|
|
20
|
-
authenticator: never[];
|
|
21
|
-
};
|
|
22
18
|
values: AuthenticatorDataValues;
|
|
23
|
-
authenticator:
|
|
19
|
+
authenticator: IdxAuthenticator;
|
|
24
20
|
constructor(remediation: IdxRemediation, values?: AuthenticatorDataValues);
|
|
25
21
|
protected formatAuthenticatorData(): void;
|
|
26
|
-
protected getAuthenticatorData(): Authenticator | undefined;
|
|
22
|
+
protected getAuthenticatorData(): import("../../types").Authenticator | undefined;
|
|
27
23
|
canRemediate(): boolean;
|
|
28
24
|
getNextStep(): {
|
|
29
25
|
options: IdxOption[];
|
|
30
26
|
name: string;
|
|
31
|
-
authenticator?:
|
|
27
|
+
authenticator?: IdxAuthenticator | undefined;
|
|
32
28
|
canSkip?: boolean | undefined;
|
|
33
29
|
canResend?: boolean | undefined;
|
|
34
30
|
inputs?: import("../../types").Input[] | undefined;
|
|
35
31
|
poll?: import("../../types").IdxPollOptions | undefined;
|
|
36
|
-
authenticatorEnrollments?:
|
|
32
|
+
authenticatorEnrollments?: IdxAuthenticator[] | undefined;
|
|
37
33
|
};
|
|
38
34
|
protected mapAuthenticatorDataFromValues(authenticatorData?: any): any;
|
|
39
35
|
protected getAuthenticatorFromRemediation(): IdxRemediationValue;
|
|
@@ -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;
|