@okta/okta-auth-js 5.9.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +16 -3
- package/cjs/AuthStateManager.js +2 -1
- package/cjs/AuthStateManager.js.map +1 -1
- package/cjs/OktaAuth.js +95 -78
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/OktaUserAgent.js.map +1 -1
- package/cjs/PromiseQueue.js +6 -1
- package/cjs/PromiseQueue.js.map +1 -1
- package/cjs/StorageManager.js +3 -1
- package/cjs/StorageManager.js.map +1 -1
- package/cjs/TokenManager.js +33 -5
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/TransactionManager.js +17 -4
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/browser/browserStorage.js +7 -5
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/browser/fingerprint.js +3 -1
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/builderUtil.js +3 -17
- package/cjs/builderUtil.js.map +1 -1
- package/cjs/crypto/oidcHash.js.map +1 -1
- package/cjs/features.js +9 -3
- package/cjs/features.js.map +1 -1
- package/cjs/fetch/fetchRequest.js +2 -1
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/request.js +2 -0
- package/cjs/http/request.js.map +1 -1
- package/cjs/idx/authenticate.js +8 -5
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +14 -0
- package/cjs/idx/authenticator/Authenticator.js.map +1 -0
- package/cjs/idx/authenticator/OktaPassword.js +31 -0
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js +17 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +50 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +32 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +34 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/getAuthenticator.js +41 -0
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/index.js +80 -0
- package/cjs/idx/authenticator/index.js.map +1 -0
- package/cjs/idx/cancel.js +5 -0
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/emailVerify.js +73 -0
- package/cjs/idx/emailVerify.js.map +1 -0
- package/cjs/idx/flow/AuthenticationFlow.js +4 -1
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js +16 -14
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js +3 -0
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js +0 -52
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/handleInteractionCodeRedirect.js +1 -0
- package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/cjs/idx/index.js +26 -0
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +47 -29
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +12 -14
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/poll.js +59 -0
- package/cjs/idx/poll.js.map +1 -0
- package/cjs/idx/proceed.js +4 -7
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/recoverPassword.js +1 -1
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js +16 -14
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +55 -92
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +11 -12
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +8 -9
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +48 -35
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +53 -20
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +20 -19
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +8 -28
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengePoll.js +26 -0
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -0
- package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +55 -0
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -0
- package/cjs/idx/remediators/EnrollProfile.js +4 -1
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +80 -0
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -0
- package/cjs/idx/remediators/Identify.js +2 -35
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -0
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +23 -2
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +74 -0
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -0
- package/cjs/idx/remediators/Skip.js +7 -0
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +52 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js +7 -2
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +110 -52
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js +4 -2
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/transactionMeta.js +82 -69
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +21 -4
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +2 -0
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/endpoints/token.js +1 -0
- package/cjs/oidc/endpoints/token.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js +3 -3
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/oidc/getToken.js +3 -1
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js +10 -37
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js +80 -86
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/parseFromUrl.js.map +1 -1
- package/cjs/oidc/renewToken.js.map +1 -1
- package/cjs/oidc/renewTokens.js +1 -1
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/revokeToken.js +28 -29
- package/cjs/oidc/revokeToken.js.map +1 -1
- package/cjs/oidc/util/index.js +14 -0
- package/cjs/oidc/util/index.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +6 -1
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/oauth.js.map +1 -1
- package/cjs/oidc/util/oauthMeta.js +36 -0
- package/cjs/oidc/util/oauthMeta.js.map +1 -0
- package/cjs/oidc/util/pkce.js.map +1 -1
- package/cjs/oidc/util/prepareTokenParams.js +57 -36
- package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js +2 -0
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/verifyToken.js +2 -1
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/options.js +6 -2
- package/cjs/options.js.map +1 -1
- package/cjs/server/serverStorage.js +1 -1
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/TokenService.js +3 -0
- package/cjs/services/TokenService.js.map +1 -1
- package/cjs/tx/AuthTransaction.js +3 -0
- package/cjs/tx/AuthTransaction.js.map +1 -1
- package/cjs/tx/TransactionState.js +0 -17
- package/cjs/tx/TransactionState.js.map +1 -1
- package/cjs/tx/api.js +3 -2
- package/cjs/tx/api.js.map +1 -1
- package/cjs/types/Token.js.map +1 -1
- package/cjs/types/Transaction.js.map +1 -1
- package/cjs/util/index.js +0 -13
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/url.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.umd.js +1 -1
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/index.js +2603 -1814
- package/esm/index.js.map +1 -1
- package/lib/AuthStateManager.d.ts +1 -2
- package/lib/OktaAuth.d.ts +4 -10
- package/lib/StorageManager.d.ts +1 -1
- package/lib/TokenManager.d.ts +4 -2
- package/lib/TransactionManager.d.ts +3 -2
- package/lib/browser/fingerprint.d.ts +1 -1
- package/lib/builderUtil.d.ts +1 -2
- package/lib/crypto/browser.d.ts +1 -1
- package/lib/features.d.ts +1 -1
- package/lib/idx/authenticate.d.ts +1 -1
- package/lib/idx/authenticator/Authenticator.d.ts +12 -0
- package/lib/idx/authenticator/OktaPassword.d.ts +11 -0
- package/lib/idx/authenticator/OktaVerifyTotp.d.ts +9 -0
- package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +28 -0
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +14 -0
- package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +10 -0
- package/lib/idx/authenticator/getAuthenticator.d.ts +3 -0
- package/lib/idx/authenticator/index.d.ts +6 -0
- package/lib/idx/cancel.d.ts +1 -1
- package/lib/{util → idx}/emailVerify.d.ts +10 -1
- package/lib/idx/flow/FlowSpecification.d.ts +1 -2
- package/lib/idx/flow/index.d.ts +0 -4
- package/lib/idx/index.d.ts +2 -0
- package/lib/idx/interact.d.ts +5 -11
- package/lib/idx/introspect.d.ts +3 -2
- package/lib/idx/{flow/AuthenticationFlowMonitor.d.ts → poll.d.ts} +3 -5
- package/lib/idx/proceed.d.ts +4 -1
- package/lib/idx/recoverPassword.d.ts +1 -1
- package/lib/idx/register.d.ts +1 -1
- package/lib/idx/remediate.d.ts +10 -4
- package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +12 -8
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +3 -4
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +13 -8
- package/lib/idx/remediators/Base/Remediator.d.ts +9 -6
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +9 -8
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +10 -5
- package/lib/idx/{flow/RegistrationFlowMonitor.d.ts → remediators/ChallengePoll.d.ts} +3 -3
- package/lib/idx/{flow/PasswordRecoveryFlowMonitor.d.ts → remediators/EnrollPoll.d.ts} +12 -4
- package/lib/idx/remediators/EnrollProfile.d.ts +1 -1
- package/lib/idx/remediators/EnrollmentChannelData.d.ts +53 -0
- package/lib/idx/remediators/Identify.d.ts +2 -5
- package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -2
- package/lib/idx/remediators/RedirectIdp.d.ts +3 -3
- package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +6 -2
- package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +39 -0
- package/lib/idx/remediators/Skip.d.ts +3 -0
- package/lib/idx/remediators/index.d.ts +4 -0
- package/lib/idx/remediators/util.d.ts +2 -2
- package/lib/idx/run.d.ts +4 -3
- package/lib/idx/startTransaction.d.ts +3 -2
- package/lib/idx/transactionMeta.d.ts +6 -27
- package/lib/idx/types/idx-js.d.ts +57 -2
- package/lib/idx/types/index.d.ts +25 -8
- package/lib/index.d.ts +1 -0
- package/lib/oidc/exchangeCodeForTokens.d.ts +12 -0
- package/lib/oidc/getWithRedirect.d.ts +1 -1
- package/lib/oidc/handleOAuthResponse.d.ts +1 -1
- package/lib/oidc/parseFromUrl.d.ts +1 -1
- package/lib/oidc/renewToken.d.ts +1 -1
- package/lib/oidc/renewTokens.d.ts +1 -1
- package/lib/oidc/util/browser.d.ts +1 -1
- package/lib/oidc/util/errors.d.ts +1 -1
- package/lib/oidc/util/index.d.ts +1 -0
- package/lib/oidc/util/oauth.d.ts +1 -8
- package/lib/oidc/util/oauthMeta.d.ts +2 -0
- package/lib/oidc/util/prepareTokenParams.d.ts +3 -0
- package/lib/server/serverStorage.d.ts +1 -1
- package/lib/services/TokenService.d.ts +2 -2
- package/lib/tx/AuthTransaction.d.ts +2 -2
- package/lib/tx/TransactionState.d.ts +11 -1
- package/lib/tx/api.d.ts +6 -6
- package/lib/types/OktaAuthOptions.d.ts +6 -6
- package/lib/types/Storage.d.ts +3 -3
- package/lib/types/Token.d.ts +1 -0
- package/lib/types/Transaction.d.ts +11 -0
- package/lib/types/UserClaims.d.ts +3 -3
- package/lib/types/api.d.ts +31 -17
- package/lib/util/console.d.ts +1 -1
- package/lib/util/index.d.ts +0 -1
- package/lib/util/types.d.ts +1 -1
- package/lib/util/url.d.ts +2 -2
- package/package.json +6 -8
- package/cjs/idx/flow/AuthenticationFlowMonitor.js +0 -45
- package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/FlowMonitor.js +0 -69
- package/cjs/idx/flow/FlowMonitor.js.map +0 -1
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js +0 -55
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/RegistrationFlowMonitor.js +0 -35
- package/cjs/idx/flow/RegistrationFlowMonitor.js.map +0 -1
- package/cjs/util/emailVerify.js +0 -28
- package/cjs/util/emailVerify.js.map +0 -1
- package/lib/idx/flow/FlowMonitor.d.ts +0 -23
|
@@ -42,7 +42,7 @@ export declare class AuthTransaction implements TransactionState, AuthTransactio
|
|
|
42
42
|
activate?: AuthTransactionFunction;
|
|
43
43
|
poll?: AuthTransactionFunction;
|
|
44
44
|
prev?: AuthTransactionFunction;
|
|
45
|
-
data
|
|
45
|
+
data?: TransactionState;
|
|
46
46
|
stateToken?: string;
|
|
47
47
|
sessionToken?: string;
|
|
48
48
|
status: string | IdxStatus;
|
|
@@ -53,6 +53,6 @@ export declare class AuthTransaction implements TransactionState, AuthTransactio
|
|
|
53
53
|
scopes?: Array<Record<string, any>>;
|
|
54
54
|
target?: Record<string, any>;
|
|
55
55
|
authentication?: Record<string, any>;
|
|
56
|
-
constructor(sdk: any, res?:
|
|
56
|
+
constructor(sdk: any, res?: TransactionState | null);
|
|
57
57
|
}
|
|
58
58
|
export {};
|
|
@@ -9,8 +9,17 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export interface TransactionLink {
|
|
13
|
+
name?: string;
|
|
14
|
+
type: string;
|
|
15
|
+
href: string;
|
|
16
|
+
hints?: {
|
|
17
|
+
allow?: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface TransactionState {
|
|
13
21
|
interactionHandle?: string;
|
|
22
|
+
status: string;
|
|
14
23
|
stateToken?: string;
|
|
15
24
|
type?: string;
|
|
16
25
|
expiresAt?: string;
|
|
@@ -24,4 +33,5 @@ export declare class TransactionState {
|
|
|
24
33
|
profile?: {
|
|
25
34
|
updatePhone?: boolean;
|
|
26
35
|
};
|
|
36
|
+
_links?: Record<string, TransactionLink>;
|
|
27
37
|
}
|
package/lib/tx/api.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
import { AuthTransaction } from './AuthTransaction';
|
|
14
|
-
declare function transactionStatus(sdk: any, args: any): Promise<any>;
|
|
15
|
-
declare function resumeTransaction(sdk: any, args: any): any;
|
|
16
|
-
declare function
|
|
17
|
-
declare function
|
|
18
|
-
declare function
|
|
19
|
-
export
|
|
14
|
+
export declare function transactionStatus(sdk: any, args: any): Promise<any>;
|
|
15
|
+
export declare function resumeTransaction(sdk: any, args: any): any;
|
|
16
|
+
export declare function introspectAuthn(sdk: any, args: any): Promise<AuthTransaction>;
|
|
17
|
+
export declare function transactionStep(sdk: any, args: any): Promise<any>;
|
|
18
|
+
export declare function transactionExists(sdk: any): boolean;
|
|
19
|
+
export declare function postToTransaction(sdk: any, url: any, args: any, options?: any): Promise<AuthTransaction>;
|
|
@@ -20,6 +20,7 @@ import OktaAuth from '../OktaAuth';
|
|
|
20
20
|
export interface TokenManagerOptions {
|
|
21
21
|
autoRenew?: boolean;
|
|
22
22
|
autoRemove?: boolean;
|
|
23
|
+
clearPendingRemoveTokens?: boolean;
|
|
23
24
|
secure?: boolean;
|
|
24
25
|
storage?: string | SimpleStorage;
|
|
25
26
|
storageKey?: string;
|
|
@@ -27,10 +28,6 @@ export interface TokenManagerOptions {
|
|
|
27
28
|
syncStorage?: boolean;
|
|
28
29
|
_storageEventDelay?: number;
|
|
29
30
|
}
|
|
30
|
-
export interface CustomUserAgent {
|
|
31
|
-
template?: string;
|
|
32
|
-
value?: string;
|
|
33
|
-
}
|
|
34
31
|
export interface CustomUrls {
|
|
35
32
|
issuer?: string;
|
|
36
33
|
authorizeUrl?: string;
|
|
@@ -55,16 +52,19 @@ export interface OktaAuthOptions extends CustomUrls {
|
|
|
55
52
|
storageUtil?: StorageUtil;
|
|
56
53
|
ajaxRequest?: object;
|
|
57
54
|
httpRequestClient?: HttpRequestClient;
|
|
58
|
-
userAgent?: CustomUserAgent;
|
|
59
55
|
cookies?: CookieOptions;
|
|
60
56
|
transformErrorXHR?: (xhr: object) => any;
|
|
61
57
|
headers?: object;
|
|
62
58
|
maxClockSkew?: number;
|
|
63
59
|
transformAuthState?: (oktaAuth: OktaAuth, authState: AuthState) => Promise<AuthState>;
|
|
64
|
-
restoreOriginalUri?: (oktaAuth: OktaAuth, originalUri
|
|
60
|
+
restoreOriginalUri?: (oktaAuth: OktaAuth, originalUri?: string) => Promise<void>;
|
|
65
61
|
devMode?: boolean;
|
|
66
62
|
storageManager?: StorageManagerOptions;
|
|
67
63
|
transactionManager?: TransactionManagerOptions;
|
|
68
64
|
flow?: FlowIdentifier;
|
|
65
|
+
codeChallenge?: string;
|
|
66
|
+
codeChallengeMethod?: string;
|
|
67
|
+
recoveryToken?: string;
|
|
68
|
+
activationToken?: string;
|
|
69
69
|
clientSecret?: string;
|
|
70
70
|
}
|
package/lib/types/Storage.d.ts
CHANGED
|
@@ -49,13 +49,13 @@ export interface StorageOptions extends CookieOptions {
|
|
|
49
49
|
storageTypes?: StorageType[];
|
|
50
50
|
storageProvider?: SimpleStorage;
|
|
51
51
|
storageKey?: string;
|
|
52
|
-
|
|
52
|
+
useSeparateCookies?: boolean;
|
|
53
53
|
}
|
|
54
54
|
export declare type StorageType = 'memory' | 'sessionStorage' | 'localStorage' | 'cookie' | 'custom' | 'auto';
|
|
55
55
|
export interface StorageUtil {
|
|
56
56
|
storage: TxStorage;
|
|
57
57
|
testStorageType(storageType: StorageType): boolean;
|
|
58
|
-
getStorageByType(storageType: StorageType, options
|
|
58
|
+
getStorageByType(storageType: StorageType, options?: StorageOptions): SimpleStorage;
|
|
59
59
|
findStorageType(types: StorageType[]): StorageType;
|
|
60
60
|
}
|
|
61
61
|
export interface BrowserStorageUtil extends StorageUtil {
|
|
@@ -79,7 +79,7 @@ export interface NodeStorageUtil extends StorageUtil {
|
|
|
79
79
|
getStorage(): SimpleStorage;
|
|
80
80
|
}
|
|
81
81
|
export interface CookieStorage extends SimpleStorage {
|
|
82
|
-
setItem(key: string, value: any, expiresAt?: string): void;
|
|
82
|
+
setItem(key: string, value: any, expiresAt?: string | null): void;
|
|
83
83
|
getItem(key?: string): any;
|
|
84
84
|
removeItem(key: string): any;
|
|
85
85
|
}
|
package/lib/types/Token.d.ts
CHANGED
|
@@ -19,12 +19,19 @@ export interface TransactionManagerOptions {
|
|
|
19
19
|
saveNonceCookie?: boolean;
|
|
20
20
|
saveStateCookie?: boolean;
|
|
21
21
|
saveParamsCookie?: boolean;
|
|
22
|
+
saveLastResponse?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export interface TransactionMetaOptions {
|
|
24
25
|
pkce?: boolean;
|
|
25
26
|
oauth?: boolean;
|
|
26
27
|
muteWarning?: boolean;
|
|
27
28
|
state?: string;
|
|
29
|
+
flow?: FlowIdentifier;
|
|
30
|
+
codeVerifier?: string;
|
|
31
|
+
codeChallenge?: string;
|
|
32
|
+
codeChallengeMethod?: string;
|
|
33
|
+
activationToken?: string;
|
|
34
|
+
recoveryToken?: string;
|
|
28
35
|
}
|
|
29
36
|
export interface OAuthTransactionMeta {
|
|
30
37
|
issuer: string;
|
|
@@ -32,6 +39,7 @@ export interface OAuthTransactionMeta {
|
|
|
32
39
|
state: string;
|
|
33
40
|
nonce: string;
|
|
34
41
|
responseType: string | string[];
|
|
42
|
+
responseMode?: string;
|
|
35
43
|
scopes: string[];
|
|
36
44
|
clientId: string;
|
|
37
45
|
urls: CustomUrls;
|
|
@@ -47,6 +55,9 @@ export interface IdxTransactionMeta extends PKCETransactionMeta {
|
|
|
47
55
|
interactionHandle?: string;
|
|
48
56
|
remediations?: string[];
|
|
49
57
|
flow?: FlowIdentifier;
|
|
58
|
+
withCredentials?: boolean;
|
|
59
|
+
activationToken?: string;
|
|
60
|
+
recoveryToken?: string;
|
|
50
61
|
}
|
|
51
62
|
export declare type CustomAuthTransactionMeta = Record<string, string | undefined>;
|
|
52
63
|
export declare type TransactionMeta = IdxTransactionMeta | PKCETransactionMeta | OAuthTransactionMeta | CustomAuthTransactionMeta;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ID Token or returned from the /userinfo response and depend on the
|
|
16
16
|
* response_type and scope parameters in the authorize request
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare type UserClaims<T = {}> = T & {
|
|
19
19
|
auth_time?: number;
|
|
20
20
|
aud?: string;
|
|
21
21
|
email?: string;
|
|
@@ -34,5 +34,5 @@ export interface UserClaims {
|
|
|
34
34
|
updated_at?: number;
|
|
35
35
|
ver?: number;
|
|
36
36
|
zoneinfo?: string;
|
|
37
|
-
|
|
38
|
-
}
|
|
37
|
+
at_hash?: string;
|
|
38
|
+
};
|
package/lib/types/api.d.ts
CHANGED
|
@@ -18,23 +18,23 @@ import StorageManager from '../StorageManager';
|
|
|
18
18
|
import TransactionManager from '../TransactionManager';
|
|
19
19
|
import { TokenManagerInterface } from './TokenManager';
|
|
20
20
|
import { OktaUserAgent } from '../OktaUserAgent';
|
|
21
|
-
import { FlowIdentifier } from '../idx/types';
|
|
22
|
-
import { AuthenticationOptions, RegistrationOptions as IdxRegistrationOptions, PasswordRecoveryOptions, ProceedOptions, CancelOptions, IdxOptions, IdxTransaction } from '../idx/types';
|
|
21
|
+
import { FlowIdentifier, IdxPollOptions } from '../idx/types';
|
|
22
|
+
import { AuthenticationOptions, RegistrationOptions as IdxRegistrationOptions, PasswordRecoveryOptions, ProceedOptions, CancelOptions, IdxOptions, IdxTransaction, IdxTransactionMeta, EmailVerifyCallbackResponse } from '../idx/types';
|
|
23
23
|
import { InteractOptions, InteractResponse } from '../idx/interact';
|
|
24
24
|
import { IntrospectOptions } from '../idx/introspect';
|
|
25
25
|
import { IdxResponse } from '../idx/types/idx-js';
|
|
26
|
+
import { TransactionMetaOptions } from './Transaction';
|
|
26
27
|
export interface OktaAuth {
|
|
27
28
|
options: OktaAuthOptions;
|
|
28
|
-
userAgent: string;
|
|
29
29
|
getIssuerOrigin(): string;
|
|
30
|
-
getOriginalUri(): string;
|
|
30
|
+
getOriginalUri(): string | undefined;
|
|
31
31
|
_oktaUserAgent: OktaUserAgent;
|
|
32
32
|
storageManager: StorageManager;
|
|
33
33
|
transactionManager: TransactionManager;
|
|
34
34
|
tokenManager: TokenManagerInterface;
|
|
35
35
|
idx: IdxAPI;
|
|
36
|
-
features
|
|
37
|
-
token
|
|
36
|
+
features: FeaturesAPI;
|
|
37
|
+
token: TokenAPI;
|
|
38
38
|
}
|
|
39
39
|
export interface APIError {
|
|
40
40
|
errorSummary: string;
|
|
@@ -83,11 +83,10 @@ export interface TokenParams extends CustomUrls {
|
|
|
83
83
|
scopes?: string[];
|
|
84
84
|
display?: string;
|
|
85
85
|
ignoreSignature?: boolean;
|
|
86
|
-
codeChallengeMethod?: string;
|
|
87
86
|
codeVerifier?: string;
|
|
88
87
|
authorizationCode?: string;
|
|
89
88
|
codeChallenge?: string;
|
|
90
|
-
|
|
89
|
+
codeChallengeMethod?: string;
|
|
91
90
|
interactionCode?: string;
|
|
92
91
|
idp?: string;
|
|
93
92
|
idpScope?: string | string[];
|
|
@@ -136,8 +135,8 @@ export interface TokenAPI extends BaseTokenAPI {
|
|
|
136
135
|
getWithoutPrompt(params?: TokenParams): Promise<TokenResponse>;
|
|
137
136
|
getWithPopup(params?: TokenParams): Promise<TokenResponse>;
|
|
138
137
|
revoke(token: RevocableToken): Promise<object>;
|
|
139
|
-
renew(token: Token): Promise<Token>;
|
|
140
|
-
renewTokens(): Promise<Tokens>;
|
|
138
|
+
renew(token: Token): Promise<Token | undefined>;
|
|
139
|
+
renewTokens(options?: TokenParams): Promise<Tokens>;
|
|
141
140
|
renewTokensWithRefresh(tokenParams: TokenParams, refreshTokenObject: RefreshToken): Promise<Tokens>;
|
|
142
141
|
verify(token: IDToken, params?: object): Promise<IDToken>;
|
|
143
142
|
isLoginRedirect(): boolean;
|
|
@@ -188,10 +187,11 @@ export interface SignoutRedirectUrlOptions {
|
|
|
188
187
|
state?: string;
|
|
189
188
|
}
|
|
190
189
|
export interface SignoutOptions extends SignoutRedirectUrlOptions {
|
|
191
|
-
accessToken?: AccessToken;
|
|
192
190
|
revokeAccessToken?: boolean;
|
|
193
191
|
revokeRefreshToken?: boolean;
|
|
192
|
+
accessToken?: AccessToken;
|
|
194
193
|
refreshToken?: RefreshToken;
|
|
194
|
+
clearTokensBeforeRedirect?: boolean;
|
|
195
195
|
}
|
|
196
196
|
export interface SignoutAPI {
|
|
197
197
|
signOut(opts: SignoutOptions): any;
|
|
@@ -214,14 +214,28 @@ export interface IdxAPI {
|
|
|
214
214
|
introspect: (options?: IntrospectOptions) => Promise<IdxResponse>;
|
|
215
215
|
authenticate: (options?: AuthenticationOptions) => Promise<IdxTransaction>;
|
|
216
216
|
register: (options?: IdxRegistrationOptions) => Promise<IdxTransaction>;
|
|
217
|
-
proceed: (options?: ProceedOptions) => Promise<IdxTransaction>;
|
|
218
|
-
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
219
|
-
startTransaction: (options?: IdxOptions) => Promise<IdxTransaction>;
|
|
220
217
|
recoverPassword: (options?: PasswordRecoveryOptions) => Promise<IdxTransaction>;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
setFlow(flow: FlowIdentifier): void;
|
|
218
|
+
poll: (options?: IdxPollOptions) => Promise<IdxTransaction>;
|
|
219
|
+
start: (options?: IdxOptions) => Promise<IdxTransaction>;
|
|
224
220
|
canProceed(options?: {
|
|
225
221
|
state?: string;
|
|
226
222
|
}): boolean;
|
|
223
|
+
proceed: (options?: ProceedOptions) => Promise<IdxTransaction>;
|
|
224
|
+
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
225
|
+
getFlow(): FlowIdentifier | undefined;
|
|
226
|
+
setFlow(flow: FlowIdentifier): void;
|
|
227
|
+
startTransaction: (options?: IdxOptions) => Promise<IdxTransaction>;
|
|
228
|
+
isInteractionRequired: (hashOrSearch?: string) => boolean;
|
|
229
|
+
isInteractionRequiredError: (error: Error) => boolean;
|
|
230
|
+
handleInteractionCodeRedirect: (url: string) => Promise<void>;
|
|
231
|
+
isEmailVerifyCallback: (search: string) => boolean;
|
|
232
|
+
parseEmailVerifyCallback: (search: string) => EmailVerifyCallbackResponse;
|
|
233
|
+
handleEmailVerifyCallback: (search: string) => Promise<IdxTransaction | undefined>;
|
|
234
|
+
isEmailVerifyCallbackError: (error: Error) => boolean;
|
|
235
|
+
getSavedTransactionMeta: (options?: TransactionMetaOptions) => IdxTransactionMeta | undefined;
|
|
236
|
+
createTransactionMeta: (options?: TransactionMetaOptions) => Promise<IdxTransactionMeta>;
|
|
237
|
+
getTransactionMeta: (options?: TransactionMetaOptions) => Promise<IdxTransactionMeta>;
|
|
238
|
+
saveTransactionMeta: (meta: unknown) => void;
|
|
239
|
+
clearTransactionMeta: () => void;
|
|
240
|
+
isTransactionMetaValid: (meta: unknown) => boolean;
|
|
227
241
|
}
|
package/lib/util/console.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
export declare function getNativeConsole(): Console;
|
|
12
|
+
export declare function getNativeConsole(): Console | undefined;
|
|
13
13
|
export declare function getConsole(): Console | {
|
|
14
14
|
log: () => void;
|
|
15
15
|
warn: () => void;
|
package/lib/util/index.d.ts
CHANGED
package/lib/util/types.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export declare function isString(obj: any): obj is string;
|
|
|
13
13
|
export declare function isObject(obj: any): obj is object;
|
|
14
14
|
export declare function isNumber(obj: any): obj is number;
|
|
15
15
|
export declare function isFunction(fn: any): fn is Function;
|
|
16
|
-
export declare function isPromise(obj: any):
|
|
16
|
+
export declare function isPromise(obj: any): any;
|
package/lib/util/url.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
export declare function isAbsoluteUrl(url: any): boolean;
|
|
13
|
-
export declare function toAbsoluteUrl(url: string, baseUrl: any): string;
|
|
14
|
-
export declare function toRelativeUrl(url: string, baseUrl: any): string;
|
|
13
|
+
export declare function toAbsoluteUrl(url: string | undefined, baseUrl: any): string;
|
|
14
|
+
export declare function toRelativeUrl(url: string | undefined, baseUrl: any): string;
|
|
15
15
|
export declare function toQueryString(obj: any): string;
|
|
16
16
|
export declare function removeTrailingSlash(path: any): any;
|
package/package.json
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@okta/okta-auth-js",
|
|
4
4
|
"description": "The Okta Auth SDK",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.0",
|
|
6
6
|
"homepage": "https://github.com/okta/okta-auth-js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "cjs/index.js",
|
|
9
9
|
"module": "esm/index.js",
|
|
10
|
-
"browser":
|
|
11
|
-
"cjs/index.js": "./dist/okta-auth-js.umd.js"
|
|
12
|
-
},
|
|
10
|
+
"browser": "dist/okta-auth-js.umd.js",
|
|
13
11
|
"types": "lib/index.d.ts",
|
|
14
12
|
"repository": {
|
|
15
13
|
"type": "git",
|
|
@@ -72,7 +70,7 @@
|
|
|
72
70
|
},
|
|
73
71
|
"dependencies": {
|
|
74
72
|
"@babel/runtime": "^7.12.5",
|
|
75
|
-
"@okta/okta-idx-js": "0.
|
|
73
|
+
"@okta/okta-idx-js": "0.24.0",
|
|
76
74
|
"@peculiar/webcrypto": "1.1.6",
|
|
77
75
|
"Base64": "1.1.0",
|
|
78
76
|
"atob": "^2.1.2",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
}
|
|
172
170
|
},
|
|
173
171
|
"okta": {
|
|
174
|
-
"commitSha": "
|
|
175
|
-
"fullVersion": "
|
|
176
|
-
"testedSha": "
|
|
172
|
+
"commitSha": "e9538b625a2a6be20f0f3dcdabb0f6858499b1df",
|
|
173
|
+
"fullVersion": "6.0.0-ge9538b6",
|
|
174
|
+
"testedSha": "f1b290b3b133a0bae4fe77b4d51e747949326777"
|
|
177
175
|
}
|
|
178
176
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.AuthenticationFlowMonitor = void 0;
|
|
4
|
-
|
|
5
|
-
var _FlowMonitor = require("./FlowMonitor");
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
-
*
|
|
11
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
class AuthenticationFlowMonitor extends _FlowMonitor.FlowMonitor {
|
|
19
|
-
isRemediatorCandidate(remediator, remediations, values) {
|
|
20
|
-
var _this$previousRemedia;
|
|
21
|
-
|
|
22
|
-
const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
|
|
23
|
-
const remediatorName = remediator.getName();
|
|
24
|
-
|
|
25
|
-
if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate'].includes(prevRemediatorName)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (remediatorName === 'select-authenticator-authenticate' && remediations.some(({
|
|
30
|
-
name
|
|
31
|
-
}) => name === 'challenge-authenticator')) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return super.isRemediatorCandidate(remediator, remediations, values);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.AuthenticationFlowMonitor = AuthenticationFlowMonitor;
|
|
45
|
-
//# sourceMappingURL=AuthenticationFlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flow/AuthenticationFlowMonitor.ts"],"names":["AuthenticationFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name"],"mappings":";;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAMA,yBAAN,SAAwCC,wBAAxC,CAAoD;AACzDC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AAEA,QAAIC,cAAc,KAAK,mCAAnB,IACC,CAAC,mCAAD,EAAsCC,QAAtC,CAA+CJ,kBAA/C,CADL,EACyE;AACvE,aAAO,KAAP;AACD;;AAED,QAAIG,cAAc,KAAK,mCAAnB,IACCL,YAAY,CAACO,IAAb,CAAkB,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,yBAAzC,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,QAAIH,cAAc,KAAK,6BAAnB,IACC,CACC,6BADD,EAEC,+BAFD,EAGCC,QAHD,CAGUJ,kBAHV,CADL,EAIoC;AAClC,aAAO,KAAP;AACD;;AAED,WAAO,MAAMJ,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAxBwD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { FlowMonitor } from './FlowMonitor';\n\nexport class AuthenticationFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n \n if (remediatorName === 'select-authenticator-authenticate' \n && ['select-authenticator-authenticate'].includes(prevRemediatorName)) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-authenticate' \n && remediations.some(({ name }) => name === 'challenge-authenticator')) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-enroll' \n && [\n 'select-authenticator-enroll', \n 'authenticator-enrollment-data'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n}\n"],"file":"AuthenticationFlowMonitor.js"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.FlowMonitor = void 0;
|
|
4
|
-
|
|
5
|
-
var _transactionMeta = require("../transactionMeta");
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
-
*
|
|
11
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
class FlowMonitor {
|
|
19
|
-
constructor(authClient) {
|
|
20
|
-
this.authClient = authClient;
|
|
21
|
-
} // detect in-memory loop
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
loopDetected(remediator) {
|
|
25
|
-
if (!this.previousRemediator) {
|
|
26
|
-
this.previousRemediator = remediator;
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (this.previousRemediator.getName() === remediator.getName()) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.previousRemediator = remediator;
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
isRemediatorCandidate( // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
39
|
-
remediator, remediations, values) {
|
|
40
|
-
const remediatorName = remediator.getName();
|
|
41
|
-
|
|
42
|
-
if (!values.skip && remediatorName === 'skip') {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (values.skip && remediatorName !== 'skip') {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async trackRemediations(name) {
|
|
54
|
-
let meta = await (0, _transactionMeta.getTransactionMeta)(this.authClient);
|
|
55
|
-
const remediations = meta.remediations || [];
|
|
56
|
-
meta = { ...meta,
|
|
57
|
-
remediations: [...remediations, name]
|
|
58
|
-
};
|
|
59
|
-
(0, _transactionMeta.saveTransactionMeta)(this.authClient, meta);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
isFinished() {
|
|
63
|
-
return Promise.resolve(true);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
exports.FlowMonitor = FlowMonitor;
|
|
69
|
-
//# sourceMappingURL=FlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flow/FlowMonitor.ts"],"names":["FlowMonitor","constructor","authClient","loopDetected","remediator","previousRemediator","getName","isRemediatorCandidate","remediations","values","remediatorName","skip","trackRemediations","name","meta","isFinished","Promise","resolve"],"mappings":";;;;AAeA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAMA,WAAN,CAAkB;AAIvBC,EAAAA,WAAW,CAACC,UAAD,EAAa;AACtB,SAAKA,UAAL,GAAkBA,UAAlB;AACD,GANsB,CAQvB;;;AACAC,EAAAA,YAAY,CAACC,UAAD,EAAkC;AAC5C,QAAI,CAAC,KAAKC,kBAAV,EAA8B;AAC5B,WAAKA,kBAAL,GAA0BD,UAA1B;AACA,aAAO,KAAP;AACD;;AAED,QAAI,KAAKC,kBAAL,CAAwBC,OAAxB,OAAsCF,UAAU,CAACE,OAAX,EAA1C,EAAgE;AAC9D,aAAO,IAAP;AACD;;AAED,SAAKD,kBAAL,GAA0BD,UAA1B;AACA,WAAO,KAAP;AACD;;AAEDG,EAAAA,qBAAqB,EACnB;AACAH,EAAAA,UAFmB,EAEKI,YAFL,EAEsCC,MAFtC,EAGV;AACT,UAAMC,cAAc,GAAGN,UAAU,CAACE,OAAX,EAAvB;;AACA,QAAI,CAACG,MAAM,CAACE,IAAR,IAAgBD,cAAc,KAAK,MAAvC,EAA+C;AAC7C,aAAO,KAAP;AACD;;AACD,QAAID,MAAM,CAACE,IAAP,IAAeD,cAAc,KAAK,MAAtC,EAA8C;AAC5C,aAAO,KAAP;AACD;;AACD,WAAO,IAAP;AACD;;AAEsB,QAAjBE,iBAAiB,CAACC,IAAD,EAAe;AACpC,QAAIC,IAAI,GAAG,MAAM,yCAAmB,KAAKZ,UAAxB,CAAjB;AACA,UAAMM,YAAY,GAAGM,IAAI,CAACN,YAAL,IAAqB,EAA1C;AACAM,IAAAA,IAAI,GAAG,EACL,GAAGA,IADE;AAELN,MAAAA,YAAY,EAAE,CAAC,GAAGA,YAAJ,EAAkBK,IAAlB;AAFT,KAAP;AAIA,8CAAoB,KAAKX,UAAzB,EAAqCY,IAArC;AACD;;AAEDC,EAAAA,UAAU,GAAqB;AAC7B,WAAOC,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;AACD;;AAjDsB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { OktaAuth } from '../../types';\nimport { Remediator, RemediationValues, SkipValues } from '../remediators';\nimport { getTransactionMeta, saveTransactionMeta } from '../transactionMeta';\nimport { IdxRemediation } from '../types/idx-js';\n\nexport class FlowMonitor {\n previousRemediator: Remediator;\n authClient: OktaAuth;\n\n constructor(authClient) {\n this.authClient = authClient;\n }\n\n // detect in-memory loop\n loopDetected(remediator: Remediator): boolean {\n if (!this.previousRemediator) {\n this.previousRemediator = remediator;\n return false;\n }\n\n if (this.previousRemediator.getName() === remediator.getName()) {\n return true;\n }\n\n this.previousRemediator = remediator;\n return false;\n }\n\n isRemediatorCandidate(\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n remediator: Remediator, remediations?: IdxRemediation[], values?: RemediationValues & SkipValues\n ): boolean {\n const remediatorName = remediator.getName();\n if (!values.skip && remediatorName === 'skip') {\n return false;\n }\n if (values.skip && remediatorName !== 'skip') {\n return false;\n }\n return true;\n }\n\n async trackRemediations(name: string) {\n let meta = await getTransactionMeta(this.authClient);\n const remediations = meta.remediations || [];\n meta = { \n ...meta, \n remediations: [...remediations, name]\n };\n saveTransactionMeta(this.authClient, meta);\n }\n\n isFinished(): Promise<boolean> {\n return Promise.resolve(true);\n }\n}\n"],"file":"FlowMonitor.js"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.PasswordRecoveryFlowMonitor = void 0;
|
|
4
|
-
|
|
5
|
-
var _FlowMonitor = require("./FlowMonitor");
|
|
6
|
-
|
|
7
|
-
var _transactionMeta = require("../transactionMeta");
|
|
8
|
-
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
11
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
12
|
-
*
|
|
13
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
16
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
*
|
|
18
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
class PasswordRecoveryFlowMonitor extends _FlowMonitor.FlowMonitor {
|
|
21
|
-
isRemediatorCandidate(remediator, remediations, values) {
|
|
22
|
-
var _this$previousRemedia;
|
|
23
|
-
|
|
24
|
-
const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
|
|
25
|
-
const remediatorName = remediator.getName();
|
|
26
|
-
|
|
27
|
-
if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate', 'reenroll-authenticator'].includes(prevRemediatorName)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (remediatorName === 'select-authenticator-authenticate' && remediations.some(({
|
|
32
|
-
name
|
|
33
|
-
}) => name === 'challenge-authenticator')) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return super.isRemediatorCandidate(remediator, remediations, values);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async isFinished() {
|
|
41
|
-
const {
|
|
42
|
-
remediations
|
|
43
|
-
} = await (0, _transactionMeta.getTransactionMeta)(this.authClient);
|
|
44
|
-
|
|
45
|
-
if (!remediations.includes('reset-authenticator')) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return await super.isFinished();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
exports.PasswordRecoveryFlowMonitor = PasswordRecoveryFlowMonitor;
|
|
55
|
-
//# sourceMappingURL=PasswordRecoveryFlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flow/PasswordRecoveryFlowMonitor.ts"],"names":["PasswordRecoveryFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name","isFinished","authClient"],"mappings":";;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAMA,2BAAN,SAA0CC,wBAA1C,CAAsD;AAC3DC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AAEA,QAAIC,cAAc,KAAK,mCAAnB,IACC,CACD,mCADC,EAED,wBAFC,EAGDC,QAHC,CAGQJ,kBAHR,CADL,EAIkC;AAChC,aAAO,KAAP;AACD;;AAED,QAAIG,cAAc,KAAK,mCAAnB,IACCL,YAAY,CAACO,IAAb,CAAkB,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,yBAAzC,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,WAAO,MAAMV,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAEe,QAAVQ,UAAU,GAAG;AACjB,UAAM;AAAET,MAAAA;AAAF,QAAoB,MAAM,yCAAmB,KAAKU,UAAxB,CAAhC;;AACA,QAAI,CAACV,YAAY,CAACM,QAAb,CAAsB,qBAAtB,CAAL,EAAmD;AACjD,aAAO,KAAP;AACD;;AAED,WAAO,MAAM,MAAMG,UAAN,EAAb;AACD;;AA5B0D","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { FlowMonitor } from './FlowMonitor';\nimport { getTransactionMeta } from '../transactionMeta';\n\nexport class PasswordRecoveryFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n \n if (remediatorName === 'select-authenticator-authenticate' \n && [\n 'select-authenticator-authenticate',\n 'reenroll-authenticator'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-authenticate' \n && remediations.some(({ name }) => name === 'challenge-authenticator')) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n\n async isFinished() {\n const { remediations } = await getTransactionMeta(this.authClient);\n if (!remediations.includes('reset-authenticator')) {\n return false;\n }\n\n return await super.isFinished();\n }\n}\n"],"file":"PasswordRecoveryFlowMonitor.js"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.RegistrationFlowMonitor = void 0;
|
|
4
|
-
|
|
5
|
-
var _FlowMonitor = require("./FlowMonitor");
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
-
*
|
|
11
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
class RegistrationFlowMonitor extends _FlowMonitor.FlowMonitor {
|
|
19
|
-
isRemediatorCandidate(remediator, remediations, values) {
|
|
20
|
-
var _this$previousRemedia;
|
|
21
|
-
|
|
22
|
-
const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
|
|
23
|
-
const remediatorName = remediator.getName();
|
|
24
|
-
|
|
25
|
-
if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return super.isRemediatorCandidate(remediator, remediations, values);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.RegistrationFlowMonitor = RegistrationFlowMonitor;
|
|
35
|
-
//# sourceMappingURL=RegistrationFlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flow/RegistrationFlowMonitor.ts"],"names":["RegistrationFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes"],"mappings":";;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;AACvDC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AACA,QAAIC,cAAc,KAAK,6BAAnB,IACC,CACC,6BADD,EAEC,+BAFD,EAGCC,QAHD,CAGUJ,kBAHV,CADL,EAIoC;AAClC,aAAO,KAAP;AACD;;AAED,WAAO,MAAMJ,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAbsD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { FlowMonitor } from './FlowMonitor';\n\nexport class RegistrationFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n if (remediatorName === 'select-authenticator-enroll' \n && [\n 'select-authenticator-enroll', \n 'authenticator-enrollment-data'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n}\n"],"file":"RegistrationFlowMonitor.js"}
|
package/cjs/util/emailVerify.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.isEmailVerifyCallback = isEmailVerifyCallback;
|
|
4
|
-
exports.parseEmailVerifyCallback = parseEmailVerifyCallback;
|
|
5
|
-
|
|
6
|
-
var _urlParams = require("../oidc/util/urlParams");
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
-
*
|
|
12
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
*
|
|
17
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
// Check if state && stateTokenExternalId have been passed back in the url
|
|
20
|
-
function isEmailVerifyCallback(urlPath) {
|
|
21
|
-
return /(stateTokenExternalId=)/i.test(urlPath) && /(state=)/i.test(urlPath);
|
|
22
|
-
} // Parse state and stateTokenExternalId from a urlPath (should be either a search or fragment from the URL)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function parseEmailVerifyCallback(urlPath) {
|
|
26
|
-
return (0, _urlParams.urlParamsToObject)(urlPath);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=emailVerify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/util/emailVerify.ts"],"names":["isEmailVerifyCallback","urlPath","test","parseEmailVerifyCallback"],"mappings":";;;;;AAaA;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACO,SAASA,qBAAT,CAAgCC,OAAhC,EAA0D;AAC/D,SAAO,2BAA2BC,IAA3B,CAAgCD,OAAhC,KAA4C,YAAYC,IAAZ,CAAiBD,OAAjB,CAAnD;AACD,C,CAED;;;AACO,SAASE,wBAAT,CAAkCF,OAAlC,EAAgF;AACrF,SAAO,kCAAkBA,OAAlB,CAAP;AACD","sourcesContent":["\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { urlParamsToObject } from '../oidc/util/urlParams';\n\nexport interface EmailVerifyCallbackResponse {\n state: string;\n stateTokenExternalId: string;\n}\n\n// Check if state && stateTokenExternalId have been passed back in the url\nexport function isEmailVerifyCallback (urlPath: string): boolean {\n return /(stateTokenExternalId=)/i.test(urlPath) && /(state=)/i.test(urlPath);\n}\n\n// Parse state and stateTokenExternalId from a urlPath (should be either a search or fragment from the URL)\nexport function parseEmailVerifyCallback(urlPath: string): EmailVerifyCallbackResponse {\n return urlParamsToObject(urlPath) as EmailVerifyCallbackResponse;\n}\n"],"file":"emailVerify.js"}
|