@okta/okta-auth-js 6.6.2 → 6.7.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 +10 -0
- package/README.md +20 -5
- package/cjs/AuthStateManager.js +6 -6
- package/cjs/AuthStateManager.js.map +1 -1
- package/cjs/OktaAuth.js +17 -7
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/OktaUserAgent.js.map +1 -1
- package/cjs/PromiseQueue.js.map +1 -1
- package/cjs/SavedObject.js +6 -0
- package/cjs/SavedObject.js.map +1 -1
- package/cjs/ServiceManager.js +44 -68
- package/cjs/ServiceManager.js.map +1 -1
- package/cjs/StorageManager.js.map +1 -1
- package/cjs/TokenManager.js +63 -65
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/browser/browserStorage.js +13 -3
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/builderUtil.js.map +1 -1
- package/cjs/cdnEntry.js +52 -0
- package/cjs/cdnEntry.js.map +1 -0
- package/cjs/clock.js.map +1 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/crypto/base64.js.map +1 -1
- package/cjs/crypto/browser.js.map +1 -1
- package/cjs/crypto/index.js.map +1 -1
- package/cjs/crypto/node.js.map +1 -1
- package/cjs/crypto/oidcHash.js.map +1 -1
- package/cjs/crypto/verifyToken.js.map +1 -1
- package/cjs/crypto/webauthn.js.map +1 -1
- package/cjs/crypto/webcrypto.js.map +1 -1
- package/cjs/errors/AuthApiError.js +5 -1
- package/cjs/errors/AuthApiError.js.map +1 -1
- package/cjs/errors/AuthPollStopError.js.map +1 -1
- package/cjs/errors/AuthSdkError.js.map +1 -1
- package/cjs/errors/CustomError.js.map +1 -1
- package/cjs/errors/OAuthError.js.map +1 -1
- package/cjs/errors/index.js.map +1 -1
- package/cjs/features.js.map +1 -1
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/headers.js.map +1 -1
- package/cjs/http/index.js.map +1 -1
- package/cjs/http/request.js +14 -1
- package/cjs/http/request.js.map +1 -1
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js.map +1 -1
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/index.js.map +1 -1
- package/cjs/idx/authenticator/util.js.map +1 -1
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/emailVerify.js.map +1 -1
- package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/RemediationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/cjs/idx/idxState/index.js.map +1 -1
- package/cjs/idx/idxState/v1/actionParser.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/idxState/v1/parsers.js.map +1 -1
- package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/poll.js.map +1 -1
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- 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.map +1 -1
- package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -1
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/RedirectIdp.js.map +1 -1
- package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/FlowIdentifier.js.map +1 -1
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/types/options.js.map +1 -1
- package/cjs/idx/unlockAccount.js.map +1 -1
- package/cjs/idx/util.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/myaccount/api.js +43 -0
- package/cjs/myaccount/api.js.map +1 -0
- package/cjs/myaccount/emailApi.js +144 -0
- package/cjs/myaccount/emailApi.js.map +1 -0
- package/cjs/myaccount/index.js +30 -0
- package/cjs/myaccount/index.js.map +1 -0
- package/cjs/myaccount/phoneApi.js +123 -0
- package/cjs/myaccount/phoneApi.js.map +1 -0
- package/cjs/myaccount/profileApi.js +58 -0
- package/cjs/myaccount/profileApi.js.map +1 -0
- package/cjs/myaccount/request.js +168 -0
- package/cjs/myaccount/request.js.map +1 -0
- package/cjs/myaccount/transactions/Base.js +38 -0
- package/cjs/myaccount/transactions/Base.js.map +1 -0
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js +58 -0
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/EmailStatusTransaction.js +32 -0
- package/cjs/myaccount/transactions/EmailStatusTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/EmailTransaction.js +94 -0
- package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/PhoneTransaction.js +78 -0
- package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js +19 -0
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/ProfileTransaction.js +26 -0
- package/cjs/myaccount/transactions/ProfileTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/index.js +61 -0
- package/cjs/myaccount/transactions/index.js.map +1 -0
- package/cjs/myaccount/types.js +64 -0
- package/cjs/myaccount/types.js.map +1 -0
- package/cjs/oidc/decodeToken.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/endpoints/index.js.map +1 -1
- package/cjs/oidc/endpoints/token.js.map +1 -1
- package/cjs/oidc/endpoints/well-known.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getUserInfo.js.map +1 -1
- package/cjs/oidc/getWithPopup.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/getWithoutPrompt.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/index.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.map +1 -1
- package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
- package/cjs/oidc/revokeToken.js.map +1 -1
- package/cjs/oidc/util/browser.js.map +1 -1
- package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
- package/cjs/oidc/util/errors.js.map +1 -1
- package/cjs/oidc/util/index.js.map +1 -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.map +1 -1
- package/cjs/oidc/util/pkce.js.map +1 -1
- package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
- package/cjs/oidc/util/refreshToken.js.map +1 -1
- package/cjs/oidc/util/urlParams.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/util/validateToken.js.map +1 -1
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/options/browser.js.map +1 -1
- package/cjs/options/index.js +3 -1
- package/cjs/options/index.js.map +1 -1
- package/cjs/options/node.js.map +1 -1
- package/cjs/server/serverStorage.js +2 -1
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/AutoRenewService.js +7 -7
- package/cjs/services/AutoRenewService.js.map +1 -1
- package/cjs/services/LeaderElectionService.js +103 -0
- package/cjs/services/LeaderElectionService.js.map +1 -0
- package/cjs/services/SyncStorageService.js +121 -39
- package/cjs/services/SyncStorageService.js.map +1 -1
- package/cjs/services/index.js +13 -0
- package/cjs/services/index.js.map +1 -1
- package/cjs/session.js.map +1 -1
- package/cjs/tx/AuthTransaction.js.map +1 -1
- package/cjs/tx/TransactionState.js.map +1 -1
- package/cjs/tx/api.js.map +1 -1
- package/cjs/tx/index.js.map +1 -1
- package/cjs/tx/poll.js.map +1 -1
- package/cjs/tx/util.js.map +1 -1
- package/cjs/types/AuthState.js.map +1 -1
- package/cjs/types/Cookies.js.map +1 -1
- package/cjs/types/EventEmitter.js.map +1 -1
- package/cjs/types/JWT.js.map +1 -1
- package/cjs/types/OAuth.js.map +1 -1
- package/cjs/types/OktaAuthOptions.js.map +1 -1
- package/cjs/types/Service.js.map +1 -1
- package/cjs/types/Storage.js.map +1 -1
- package/cjs/types/Token.js.map +1 -1
- package/cjs/types/TokenManager.js +16 -0
- package/cjs/types/TokenManager.js.map +1 -1
- package/cjs/types/Transaction.js.map +1 -1
- package/cjs/types/UserClaims.js.map +1 -1
- package/cjs/types/api.js.map +1 -1
- package/cjs/types/http.js.map +1 -1
- package/cjs/types/index.js +13 -0
- package/cjs/types/index.js.map +1 -1
- package/cjs/util/console.js +2 -1
- package/cjs/util/console.js.map +1 -1
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/misc.js.map +1 -1
- package/cjs/util/object.js.map +1 -1
- package/cjs/util/sharedStorage.js.map +1 -1
- package/cjs/util/types.js.map +1 -1
- package/cjs/util/url.js.map +1 -1
- package/dist/myaccount.umd.js +3 -0
- package/dist/myaccount.umd.js.LICENSE.txt +12 -0
- package/dist/myaccount.umd.js.map +1 -0
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.polyfill.js +1 -1
- package/dist/okta-auth-js.polyfill.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/browser/AuthStateManager.js +161 -0
- package/esm/browser/AuthStateManager.js.map +1 -0
- package/esm/browser/OktaAuth.js +560 -0
- package/esm/browser/OktaAuth.js.map +1 -0
- package/esm/browser/OktaUserAgent.js +39 -0
- package/esm/browser/OktaUserAgent.js.map +1 -0
- package/esm/browser/PromiseQueue.js +65 -0
- package/esm/browser/PromiseQueue.js.map +1 -0
- package/esm/browser/SavedObject.js +81 -0
- package/esm/browser/SavedObject.js.map +1 -0
- package/esm/browser/ServiceManager.js +115 -0
- package/esm/browser/ServiceManager.js.map +1 -0
- package/esm/browser/StorageManager.js +148 -0
- package/esm/browser/StorageManager.js.map +1 -0
- package/esm/browser/TokenManager.js +386 -0
- package/esm/browser/TokenManager.js.map +1 -0
- package/esm/browser/TransactionManager.js +244 -0
- package/esm/browser/TransactionManager.js.map +1 -0
- package/esm/browser/_virtual/_tslib.js +41 -0
- package/esm/browser/_virtual/_tslib.js.map +1 -0
- package/esm/browser/browser/browserStorage.js +216 -0
- package/esm/browser/browser/browserStorage.js.map +1 -0
- package/esm/browser/browser/fingerprint.js +69 -0
- package/esm/browser/browser/fingerprint.js.map +1 -0
- package/esm/browser/builderUtil.js +39 -0
- package/esm/browser/builderUtil.js.map +1 -0
- package/esm/browser/clock.js +28 -0
- package/esm/browser/clock.js.map +1 -0
- package/esm/browser/constants.js +37 -0
- package/esm/browser/constants.js.map +1 -0
- package/esm/browser/crypto/base64.js +66 -0
- package/esm/browser/crypto/base64.js.map +1 -0
- package/esm/browser/crypto/browser.js +18 -0
- package/esm/browser/crypto/browser.js.map +1 -0
- package/esm/browser/crypto/index.js +17 -0
- package/esm/browser/crypto/index.js.map +1 -0
- package/esm/browser/crypto/oidcHash.js +28 -0
- package/esm/browser/crypto/oidcHash.js.map +1 -0
- package/esm/browser/crypto/verifyToken.js +38 -0
- package/esm/browser/crypto/verifyToken.js.map +1 -0
- package/esm/browser/crypto/webauthn.js +79 -0
- package/esm/browser/crypto/webauthn.js.map +1 -0
- package/esm/browser/errors/AuthApiError.js +35 -0
- package/esm/browser/errors/AuthApiError.js.map +1 -0
- package/esm/browser/errors/AuthPollStopError.js +23 -0
- package/esm/browser/errors/AuthPollStopError.js.map +1 -0
- package/esm/browser/errors/AuthSdkError.js +31 -0
- package/esm/browser/errors/AuthSdkError.js.map +1 -0
- package/esm/browser/errors/CustomError.js +21 -0
- package/esm/browser/errors/CustomError.js.map +1 -0
- package/esm/browser/errors/OAuthError.js +27 -0
- package/esm/browser/errors/OAuthError.js.map +1 -0
- package/esm/browser/errors/index.js +26 -0
- package/esm/browser/errors/index.js.map +1 -0
- package/esm/browser/features.js +67 -0
- package/esm/browser/features.js.map +1 -0
- package/esm/browser/fetch/fetchRequest.js +90 -0
- package/esm/browser/fetch/fetchRequest.js.map +1 -0
- package/esm/browser/http/headers.js +19 -0
- package/esm/browser/http/headers.js.map +1 -0
- package/esm/browser/http/request.js +133 -0
- package/esm/browser/http/request.js.map +1 -0
- package/esm/browser/idx/authenticate.js +25 -0
- package/esm/browser/idx/authenticate.js.map +1 -0
- package/esm/browser/idx/authenticator/Authenticator.js +20 -0
- package/esm/browser/idx/authenticator/Authenticator.js.map +1 -0
- package/esm/browser/idx/authenticator/OktaPassword.js +33 -0
- package/esm/browser/idx/authenticator/OktaPassword.js.map +1 -0
- package/esm/browser/idx/authenticator/OktaVerifyTotp.js +26 -0
- package/esm/browser/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/esm/browser/idx/authenticator/SecurityQuestionEnrollment.js +45 -0
- package/esm/browser/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/esm/browser/idx/authenticator/SecurityQuestionVerification.js +42 -0
- package/esm/browser/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/esm/browser/idx/authenticator/VerificationCodeAuthenticator.js +33 -0
- package/esm/browser/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/esm/browser/idx/authenticator/WebauthnEnrollment.js +41 -0
- package/esm/browser/idx/authenticator/WebauthnEnrollment.js.map +1 -0
- package/esm/browser/idx/authenticator/WebauthnVerification.js +43 -0
- package/esm/browser/idx/authenticator/WebauthnVerification.js.map +1 -0
- package/esm/browser/idx/authenticator/getAuthenticator.js +51 -0
- package/esm/browser/idx/authenticator/getAuthenticator.js.map +1 -0
- package/esm/browser/idx/authenticator/util.js +55 -0
- package/esm/browser/idx/authenticator/util.js.map +1 -0
- package/esm/browser/idx/cancel.js +42 -0
- package/esm/browser/idx/cancel.js.map +1 -0
- package/esm/browser/idx/emailVerify.js +46 -0
- package/esm/browser/idx/emailVerify.js.map +1 -0
- package/esm/browser/idx/flow/AccountUnlockFlow.js +43 -0
- package/esm/browser/idx/flow/AccountUnlockFlow.js.map +1 -0
- package/esm/browser/idx/flow/AuthenticationFlow.js +49 -0
- package/esm/browser/idx/flow/AuthenticationFlow.js.map +1 -0
- package/esm/browser/idx/flow/FlowSpecification.js +56 -0
- package/esm/browser/idx/flow/FlowSpecification.js.map +1 -0
- package/esm/browser/idx/flow/PasswordRecoveryFlow.js +47 -0
- package/esm/browser/idx/flow/PasswordRecoveryFlow.js.map +1 -0
- package/esm/browser/idx/flow/RegistrationFlow.js +46 -0
- package/esm/browser/idx/flow/RegistrationFlow.js.map +1 -0
- package/esm/browser/idx/handleInteractionCodeRedirect.js +41 -0
- package/esm/browser/idx/handleInteractionCodeRedirect.js.map +1 -0
- package/esm/browser/idx/idxState/index.js +46 -0
- package/esm/browser/idx/idxState/index.js.map +1 -0
- package/esm/browser/idx/idxState/v1/actionParser.js +53 -0
- package/esm/browser/idx/idxState/v1/actionParser.js.map +1 -0
- package/esm/browser/idx/idxState/v1/generateIdxAction.js +65 -0
- package/esm/browser/idx/idxState/v1/generateIdxAction.js.map +1 -0
- package/esm/browser/idx/idxState/v1/idxResponseParser.js +95 -0
- package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -0
- package/esm/browser/idx/idxState/v1/makeIdxState.js +46 -0
- package/esm/browser/idx/idxState/v1/makeIdxState.js.map +1 -0
- package/esm/browser/idx/idxState/v1/parsers.js +20 -0
- package/esm/browser/idx/idxState/v1/parsers.js.map +1 -0
- package/esm/browser/idx/idxState/v1/remediationParser.js +25 -0
- package/esm/browser/idx/idxState/v1/remediationParser.js.map +1 -0
- package/esm/browser/idx/interact.js +62 -0
- package/esm/browser/idx/interact.js.map +1 -0
- package/esm/browser/idx/introspect.js +68 -0
- package/esm/browser/idx/introspect.js.map +1 -0
- package/esm/browser/idx/poll.js +52 -0
- package/esm/browser/idx/poll.js.map +1 -0
- package/esm/browser/idx/proceed.js +34 -0
- package/esm/browser/idx/proceed.js.map +1 -0
- package/esm/browser/idx/recoverPassword.js +41 -0
- package/esm/browser/idx/recoverPassword.js.map +1 -0
- package/esm/browser/idx/register.js +36 -0
- package/esm/browser/idx/register.js.map +1 -0
- package/esm/browser/idx/remediate.js +134 -0
- package/esm/browser/idx/remediate.js.map +1 -0
- package/esm/browser/idx/remediators/AuthenticatorEnrollmentData.js +48 -0
- package/esm/browser/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -0
- package/esm/browser/idx/remediators/AuthenticatorVerificationData.js +71 -0
- package/esm/browser/idx/remediators/AuthenticatorVerificationData.js.map +1 -0
- package/esm/browser/idx/remediators/Base/AuthenticatorData.js +82 -0
- package/esm/browser/idx/remediators/Base/AuthenticatorData.js.map +1 -0
- package/esm/browser/idx/remediators/Base/Remediator.js +177 -0
- package/esm/browser/idx/remediators/Base/Remediator.js.map +1 -0
- package/esm/browser/idx/remediators/Base/SelectAuthenticator.js +90 -0
- package/esm/browser/idx/remediators/Base/SelectAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/Base/VerifyAuthenticator.js +44 -0
- package/esm/browser/idx/remediators/Base/VerifyAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/ChallengeAuthenticator.js +20 -0
- package/esm/browser/idx/remediators/ChallengeAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/ChallengePoll.js +23 -0
- package/esm/browser/idx/remediators/ChallengePoll.js.map +1 -0
- package/esm/browser/idx/remediators/EnrollAuthenticator.js +20 -0
- package/esm/browser/idx/remediators/EnrollAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/EnrollPoll.js +38 -0
- package/esm/browser/idx/remediators/EnrollPoll.js.map +1 -0
- package/esm/browser/idx/remediators/EnrollProfile.js +52 -0
- package/esm/browser/idx/remediators/EnrollProfile.js.map +1 -0
- package/esm/browser/idx/remediators/EnrollmentChannelData.js +49 -0
- package/esm/browser/idx/remediators/EnrollmentChannelData.js.map +1 -0
- package/esm/browser/idx/remediators/GenericRemediator/GenericRemediator.js +61 -0
- package/esm/browser/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -0
- package/esm/browser/idx/remediators/GenericRemediator/util.js +92 -0
- package/esm/browser/idx/remediators/GenericRemediator/util.js.map +1 -0
- package/esm/browser/idx/remediators/Identify.js +40 -0
- package/esm/browser/idx/remediators/Identify.js.map +1 -0
- package/esm/browser/idx/remediators/ReEnrollAuthenticator.js +34 -0
- package/esm/browser/idx/remediators/ReEnrollAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/RedirectIdp.js +32 -0
- package/esm/browser/idx/remediators/RedirectIdp.js.map +1 -0
- package/esm/browser/idx/remediators/ResetAuthenticator.js +20 -0
- package/esm/browser/idx/remediators/ResetAuthenticator.js.map +1 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorAuthenticate.js +35 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorEnroll.js +20 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorUnlockAccount.js +44 -0
- package/esm/browser/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -0
- package/esm/browser/idx/remediators/SelectEnrollProfile.js +23 -0
- package/esm/browser/idx/remediators/SelectEnrollProfile.js.map +1 -0
- package/esm/browser/idx/remediators/SelectEnrollmentChannel.js +50 -0
- package/esm/browser/idx/remediators/SelectEnrollmentChannel.js.map +1 -0
- package/esm/browser/idx/remediators/Skip.js +23 -0
- package/esm/browser/idx/remediators/Skip.js.map +1 -0
- package/esm/browser/idx/remediators/index.js +33 -0
- package/esm/browser/idx/remediators/index.js.map +1 -0
- package/esm/browser/idx/remediators/util.js +34 -0
- package/esm/browser/idx/remediators/util.js.map +1 -0
- package/esm/browser/idx/run.js +245 -0
- package/esm/browser/idx/run.js.map +1 -0
- package/esm/browser/idx/startTransaction.js +21 -0
- package/esm/browser/idx/startTransaction.js.map +1 -0
- package/esm/browser/idx/transactionMeta.js +110 -0
- package/esm/browser/idx/transactionMeta.js.map +1 -0
- package/esm/browser/idx/types/api.js +43 -0
- package/esm/browser/idx/types/api.js.map +1 -0
- package/esm/browser/idx/types/idx-js.js +21 -0
- package/esm/browser/idx/types/idx-js.js.map +1 -0
- package/esm/browser/idx/unlockAccount.js +32 -0
- package/esm/browser/idx/unlockAccount.js.map +1 -0
- package/esm/browser/idx/util.js +212 -0
- package/esm/browser/idx/util.js.map +1 -0
- package/esm/browser/index.js +91 -0
- package/esm/browser/index.js.map +1 -0
- package/esm/browser/myaccount/emailApi.js +86 -0
- package/esm/browser/myaccount/emailApi.js.map +1 -0
- package/esm/browser/myaccount/myaccount/index.js +24 -0
- package/esm/browser/myaccount/myaccount/index.js.map +1 -0
- package/esm/browser/myaccount/phoneApi.js +76 -0
- package/esm/browser/myaccount/phoneApi.js.map +1 -0
- package/esm/browser/myaccount/profileApi.js +46 -0
- package/esm/browser/myaccount/profileApi.js.map +1 -0
- package/esm/browser/myaccount/request.js +121 -0
- package/esm/browser/myaccount/request.js.map +1 -0
- package/esm/browser/myaccount/transactions/Base.js +32 -0
- package/esm/browser/myaccount/transactions/Base.js.map +1 -0
- package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js +48 -0
- package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js.map +1 -0
- package/esm/browser/myaccount/transactions/EmailStatusTransaction.js +28 -0
- package/esm/browser/myaccount/transactions/EmailStatusTransaction.js.map +1 -0
- package/esm/browser/myaccount/transactions/EmailTransaction.js +81 -0
- package/esm/browser/myaccount/transactions/EmailTransaction.js.map +1 -0
- package/esm/browser/myaccount/transactions/PhoneTransaction.js +67 -0
- package/esm/browser/myaccount/transactions/PhoneTransaction.js.map +1 -0
- package/esm/browser/myaccount/transactions/ProfileSchemaTransaction.js +23 -0
- package/esm/browser/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -0
- package/esm/browser/myaccount/transactions/ProfileTransaction.js +26 -0
- package/esm/browser/myaccount/transactions/ProfileTransaction.js.map +1 -0
- package/esm/browser/myaccount/types.js +25 -0
- package/esm/browser/myaccount/types.js.map +1 -0
- package/esm/browser/oidc/decodeToken.js +33 -0
- package/esm/browser/oidc/decodeToken.js.map +1 -0
- package/esm/browser/oidc/endpoints/authorize.js +63 -0
- package/esm/browser/oidc/endpoints/authorize.js.map +1 -0
- package/esm/browser/oidc/endpoints/token.js +83 -0
- package/esm/browser/oidc/endpoints/token.js.map +1 -0
- package/esm/browser/oidc/endpoints/well-known.js +55 -0
- package/esm/browser/oidc/endpoints/well-known.js.map +1 -0
- package/esm/browser/oidc/exchangeCodeForTokens.js +58 -0
- package/esm/browser/oidc/exchangeCodeForTokens.js.map +1 -0
- package/esm/browser/oidc/getToken.js +117 -0
- package/esm/browser/oidc/getToken.js.map +1 -0
- package/esm/browser/oidc/getUserInfo.js +69 -0
- package/esm/browser/oidc/getUserInfo.js.map +1 -0
- package/esm/browser/oidc/getWithPopup.js +35 -0
- package/esm/browser/oidc/getWithPopup.js.map +1 -0
- package/esm/browser/oidc/getWithRedirect.js +34 -0
- package/esm/browser/oidc/getWithRedirect.js.map +1 -0
- package/esm/browser/oidc/getWithoutPrompt.js +31 -0
- package/esm/browser/oidc/getWithoutPrompt.js.map +1 -0
- package/esm/browser/oidc/handleOAuthResponse.js +119 -0
- package/esm/browser/oidc/handleOAuthResponse.js.map +1 -0
- package/esm/browser/oidc/parseFromUrl.js +116 -0
- package/esm/browser/oidc/parseFromUrl.js.map +1 -0
- package/esm/browser/oidc/renewToken.js +67 -0
- package/esm/browser/oidc/renewToken.js.map +1 -0
- package/esm/browser/oidc/renewTokens.js +58 -0
- package/esm/browser/oidc/renewTokens.js.map +1 -0
- package/esm/browser/oidc/renewTokensWithRefresh.js +47 -0
- package/esm/browser/oidc/renewTokensWithRefresh.js.map +1 -0
- package/esm/browser/oidc/revokeToken.js +49 -0
- package/esm/browser/oidc/revokeToken.js.map +1 -0
- package/esm/browser/oidc/util/browser.js +69 -0
- package/esm/browser/oidc/util/browser.js.map +1 -0
- package/esm/browser/oidc/util/defaultTokenParams.js +34 -0
- package/esm/browser/oidc/util/defaultTokenParams.js.map +1 -0
- package/esm/browser/oidc/util/errors.js +38 -0
- package/esm/browser/oidc/util/errors.js.map +1 -0
- package/esm/browser/oidc/util/loginRedirect.js +66 -0
- package/esm/browser/oidc/util/loginRedirect.js.map +1 -0
- package/esm/browser/oidc/util/oauth.js +65 -0
- package/esm/browser/oidc/util/oauth.js.map +1 -0
- package/esm/browser/oidc/util/oauthMeta.js +38 -0
- package/esm/browser/oidc/util/oauthMeta.js.map +1 -0
- package/esm/browser/oidc/util/pkce.js +48 -0
- package/esm/browser/oidc/util/pkce.js.map +1 -0
- package/esm/browser/oidc/util/prepareTokenParams.js +65 -0
- package/esm/browser/oidc/util/prepareTokenParams.js.map +1 -0
- package/esm/browser/oidc/util/refreshToken.js +33 -0
- package/esm/browser/oidc/util/refreshToken.js.map +1 -0
- package/esm/browser/oidc/util/urlParams.js +43 -0
- package/esm/browser/oidc/util/urlParams.js.map +1 -0
- package/esm/browser/oidc/util/validateClaims.js +48 -0
- package/esm/browser/oidc/util/validateClaims.js.map +1 -0
- package/esm/browser/oidc/util/validateToken.js +34 -0
- package/esm/browser/oidc/util/validateToken.js.map +1 -0
- package/esm/browser/oidc/verifyToken.js +54 -0
- package/esm/browser/oidc/verifyToken.js.map +1 -0
- package/esm/browser/options/browser.js +77 -0
- package/esm/browser/options/browser.js.map +1 -0
- package/esm/browser/options/index.js +85 -0
- package/esm/browser/options/index.js.map +1 -0
- package/esm/browser/services/AutoRenewService.js +77 -0
- package/esm/browser/services/AutoRenewService.js.map +1 -0
- package/esm/browser/services/LeaderElectionService.js +74 -0
- package/esm/browser/services/LeaderElectionService.js.map +1 -0
- package/esm/browser/services/SyncStorageService.js +130 -0
- package/esm/browser/services/SyncStorageService.js.map +1 -0
- package/esm/browser/session.js +66 -0
- package/esm/browser/session.js.map +1 -0
- package/esm/browser/tx/AuthTransaction.js +174 -0
- package/esm/browser/tx/AuthTransaction.js.map +1 -0
- package/esm/browser/tx/api.js +72 -0
- package/esm/browser/tx/api.js.map +1 -0
- package/esm/browser/tx/poll.js +117 -0
- package/esm/browser/tx/poll.js.map +1 -0
- package/esm/browser/tx/util.js +26 -0
- package/esm/browser/tx/util.js.map +1 -0
- package/esm/browser/types/Token.js +32 -0
- package/esm/browser/types/Token.js.map +1 -0
- package/esm/browser/types/TokenManager.js +21 -0
- package/esm/browser/types/TokenManager.js.map +1 -0
- package/esm/browser/types/Transaction.js +52 -0
- package/esm/browser/types/Transaction.js.map +1 -0
- package/esm/browser/util/console.js +50 -0
- package/esm/browser/util/console.js.map +1 -0
- package/esm/browser/util/misc.js +32 -0
- package/esm/browser/util/misc.js.map +1 -0
- package/esm/browser/util/object.js +98 -0
- package/esm/browser/util/object.js.map +1 -0
- package/esm/browser/util/sharedStorage.js +56 -0
- package/esm/browser/util/sharedStorage.js.map +1 -0
- package/esm/browser/util/types.js +30 -0
- package/esm/browser/util/types.js.map +1 -0
- package/esm/browser/util/url.js +57 -0
- package/esm/browser/util/url.js.map +1 -0
- package/esm/node/AuthStateManager.js +161 -0
- package/esm/node/AuthStateManager.js.map +1 -0
- package/esm/node/OktaAuth.js +560 -0
- package/esm/node/OktaAuth.js.map +1 -0
- package/esm/node/OktaUserAgent.js +39 -0
- package/esm/node/OktaUserAgent.js.map +1 -0
- package/esm/node/PromiseQueue.js +65 -0
- package/esm/node/PromiseQueue.js.map +1 -0
- package/esm/node/SavedObject.js +81 -0
- package/esm/node/SavedObject.js.map +1 -0
- package/esm/node/ServiceManager.js +115 -0
- package/esm/node/ServiceManager.js.map +1 -0
- package/esm/node/StorageManager.js +148 -0
- package/esm/node/StorageManager.js.map +1 -0
- package/esm/node/TokenManager.js +387 -0
- package/esm/node/TokenManager.js.map +1 -0
- package/esm/node/TransactionManager.js +244 -0
- package/esm/node/TransactionManager.js.map +1 -0
- package/esm/node/_virtual/_tslib.js +41 -0
- package/esm/node/_virtual/_tslib.js.map +1 -0
- package/esm/node/browser/browserStorage.js +216 -0
- package/esm/node/browser/browserStorage.js.map +1 -0
- package/esm/node/browser/fingerprint.js +70 -0
- package/esm/node/browser/fingerprint.js.map +1 -0
- package/esm/node/builderUtil.js +39 -0
- package/esm/node/builderUtil.js.map +1 -0
- package/esm/node/clock.js +28 -0
- package/esm/node/clock.js.map +1 -0
- package/esm/node/constants.js +37 -0
- package/esm/node/constants.js.map +1 -0
- package/esm/node/crypto/base64.js +66 -0
- package/esm/node/crypto/base64.js.map +1 -0
- package/esm/node/crypto/index.js +17 -0
- package/esm/node/crypto/index.js.map +1 -0
- package/esm/node/crypto/node.js +48 -0
- package/esm/node/crypto/node.js.map +1 -0
- package/esm/node/crypto/oidcHash.js +28 -0
- package/esm/node/crypto/oidcHash.js.map +1 -0
- package/esm/node/crypto/verifyToken.js +38 -0
- package/esm/node/crypto/verifyToken.js.map +1 -0
- package/esm/node/crypto/webauthn.js +79 -0
- package/esm/node/crypto/webauthn.js.map +1 -0
- package/esm/node/errors/AuthApiError.js +35 -0
- package/esm/node/errors/AuthApiError.js.map +1 -0
- package/esm/node/errors/AuthPollStopError.js +23 -0
- package/esm/node/errors/AuthPollStopError.js.map +1 -0
- package/esm/node/errors/AuthSdkError.js +31 -0
- package/esm/node/errors/AuthSdkError.js.map +1 -0
- package/esm/node/errors/CustomError.js +21 -0
- package/esm/node/errors/CustomError.js.map +1 -0
- package/esm/node/errors/OAuthError.js +27 -0
- package/esm/node/errors/OAuthError.js.map +1 -0
- package/esm/node/errors/index.js +26 -0
- package/esm/node/errors/index.js.map +1 -0
- package/esm/node/features.js +67 -0
- package/esm/node/features.js.map +1 -0
- package/esm/node/fetch/fetchRequest.js +90 -0
- package/esm/node/fetch/fetchRequest.js.map +1 -0
- package/esm/node/http/headers.js +19 -0
- package/esm/node/http/headers.js.map +1 -0
- package/esm/node/http/request.js +133 -0
- package/esm/node/http/request.js.map +1 -0
- package/esm/node/idx/authenticate.js +25 -0
- package/esm/node/idx/authenticate.js.map +1 -0
- package/esm/node/idx/authenticator/Authenticator.js +20 -0
- package/esm/node/idx/authenticator/Authenticator.js.map +1 -0
- package/esm/node/idx/authenticator/OktaPassword.js +33 -0
- package/esm/node/idx/authenticator/OktaPassword.js.map +1 -0
- package/esm/node/idx/authenticator/OktaVerifyTotp.js +26 -0
- package/esm/node/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/esm/node/idx/authenticator/SecurityQuestionEnrollment.js +45 -0
- package/esm/node/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/esm/node/idx/authenticator/SecurityQuestionVerification.js +42 -0
- package/esm/node/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/esm/node/idx/authenticator/VerificationCodeAuthenticator.js +33 -0
- package/esm/node/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/esm/node/idx/authenticator/WebauthnEnrollment.js +41 -0
- package/esm/node/idx/authenticator/WebauthnEnrollment.js.map +1 -0
- package/esm/node/idx/authenticator/WebauthnVerification.js +43 -0
- package/esm/node/idx/authenticator/WebauthnVerification.js.map +1 -0
- package/esm/node/idx/authenticator/getAuthenticator.js +51 -0
- package/esm/node/idx/authenticator/getAuthenticator.js.map +1 -0
- package/esm/node/idx/authenticator/util.js +55 -0
- package/esm/node/idx/authenticator/util.js.map +1 -0
- package/esm/node/idx/cancel.js +42 -0
- package/esm/node/idx/cancel.js.map +1 -0
- package/esm/node/idx/emailVerify.js +46 -0
- package/esm/node/idx/emailVerify.js.map +1 -0
- package/esm/node/idx/flow/AccountUnlockFlow.js +43 -0
- package/esm/node/idx/flow/AccountUnlockFlow.js.map +1 -0
- package/esm/node/idx/flow/AuthenticationFlow.js +49 -0
- package/esm/node/idx/flow/AuthenticationFlow.js.map +1 -0
- package/esm/node/idx/flow/FlowSpecification.js +56 -0
- package/esm/node/idx/flow/FlowSpecification.js.map +1 -0
- package/esm/node/idx/flow/PasswordRecoveryFlow.js +47 -0
- package/esm/node/idx/flow/PasswordRecoveryFlow.js.map +1 -0
- package/esm/node/idx/flow/RegistrationFlow.js +46 -0
- package/esm/node/idx/flow/RegistrationFlow.js.map +1 -0
- package/esm/node/idx/handleInteractionCodeRedirect.js +41 -0
- package/esm/node/idx/handleInteractionCodeRedirect.js.map +1 -0
- package/esm/node/idx/idxState/index.js +46 -0
- package/esm/node/idx/idxState/index.js.map +1 -0
- package/esm/node/idx/idxState/v1/actionParser.js +53 -0
- package/esm/node/idx/idxState/v1/actionParser.js.map +1 -0
- package/esm/node/idx/idxState/v1/generateIdxAction.js +65 -0
- package/esm/node/idx/idxState/v1/generateIdxAction.js.map +1 -0
- package/esm/node/idx/idxState/v1/idxResponseParser.js +95 -0
- package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -0
- package/esm/node/idx/idxState/v1/makeIdxState.js +46 -0
- package/esm/node/idx/idxState/v1/makeIdxState.js.map +1 -0
- package/esm/node/idx/idxState/v1/parsers.js +20 -0
- package/esm/node/idx/idxState/v1/parsers.js.map +1 -0
- package/esm/node/idx/idxState/v1/remediationParser.js +25 -0
- package/esm/node/idx/idxState/v1/remediationParser.js.map +1 -0
- package/esm/node/idx/interact.js +63 -0
- package/esm/node/idx/interact.js.map +1 -0
- package/esm/node/idx/introspect.js +69 -0
- package/esm/node/idx/introspect.js.map +1 -0
- package/esm/node/idx/poll.js +52 -0
- package/esm/node/idx/poll.js.map +1 -0
- package/esm/node/idx/proceed.js +34 -0
- package/esm/node/idx/proceed.js.map +1 -0
- package/esm/node/idx/recoverPassword.js +41 -0
- package/esm/node/idx/recoverPassword.js.map +1 -0
- package/esm/node/idx/register.js +36 -0
- package/esm/node/idx/register.js.map +1 -0
- package/esm/node/idx/remediate.js +134 -0
- package/esm/node/idx/remediate.js.map +1 -0
- package/esm/node/idx/remediators/AuthenticatorEnrollmentData.js +48 -0
- package/esm/node/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -0
- package/esm/node/idx/remediators/AuthenticatorVerificationData.js +71 -0
- package/esm/node/idx/remediators/AuthenticatorVerificationData.js.map +1 -0
- package/esm/node/idx/remediators/Base/AuthenticatorData.js +82 -0
- package/esm/node/idx/remediators/Base/AuthenticatorData.js.map +1 -0
- package/esm/node/idx/remediators/Base/Remediator.js +177 -0
- package/esm/node/idx/remediators/Base/Remediator.js.map +1 -0
- package/esm/node/idx/remediators/Base/SelectAuthenticator.js +90 -0
- package/esm/node/idx/remediators/Base/SelectAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/Base/VerifyAuthenticator.js +44 -0
- package/esm/node/idx/remediators/Base/VerifyAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/ChallengeAuthenticator.js +20 -0
- package/esm/node/idx/remediators/ChallengeAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/ChallengePoll.js +23 -0
- package/esm/node/idx/remediators/ChallengePoll.js.map +1 -0
- package/esm/node/idx/remediators/EnrollAuthenticator.js +20 -0
- package/esm/node/idx/remediators/EnrollAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/EnrollPoll.js +38 -0
- package/esm/node/idx/remediators/EnrollPoll.js.map +1 -0
- package/esm/node/idx/remediators/EnrollProfile.js +52 -0
- package/esm/node/idx/remediators/EnrollProfile.js.map +1 -0
- package/esm/node/idx/remediators/EnrollmentChannelData.js +49 -0
- package/esm/node/idx/remediators/EnrollmentChannelData.js.map +1 -0
- package/esm/node/idx/remediators/GenericRemediator/GenericRemediator.js +61 -0
- package/esm/node/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -0
- package/esm/node/idx/remediators/GenericRemediator/util.js +92 -0
- package/esm/node/idx/remediators/GenericRemediator/util.js.map +1 -0
- package/esm/node/idx/remediators/Identify.js +40 -0
- package/esm/node/idx/remediators/Identify.js.map +1 -0
- package/esm/node/idx/remediators/ReEnrollAuthenticator.js +34 -0
- package/esm/node/idx/remediators/ReEnrollAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/RedirectIdp.js +32 -0
- package/esm/node/idx/remediators/RedirectIdp.js.map +1 -0
- package/esm/node/idx/remediators/ResetAuthenticator.js +20 -0
- package/esm/node/idx/remediators/ResetAuthenticator.js.map +1 -0
- package/esm/node/idx/remediators/SelectAuthenticatorAuthenticate.js +35 -0
- package/esm/node/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -0
- package/esm/node/idx/remediators/SelectAuthenticatorEnroll.js +20 -0
- package/esm/node/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -0
- package/esm/node/idx/remediators/SelectAuthenticatorUnlockAccount.js +44 -0
- package/esm/node/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -0
- package/esm/node/idx/remediators/SelectEnrollProfile.js +23 -0
- package/esm/node/idx/remediators/SelectEnrollProfile.js.map +1 -0
- package/esm/node/idx/remediators/SelectEnrollmentChannel.js +50 -0
- package/esm/node/idx/remediators/SelectEnrollmentChannel.js.map +1 -0
- package/esm/node/idx/remediators/Skip.js +23 -0
- package/esm/node/idx/remediators/Skip.js.map +1 -0
- package/esm/node/idx/remediators/index.js +33 -0
- package/esm/node/idx/remediators/index.js.map +1 -0
- package/esm/node/idx/remediators/util.js +34 -0
- package/esm/node/idx/remediators/util.js.map +1 -0
- package/esm/node/idx/run.js +245 -0
- package/esm/node/idx/run.js.map +1 -0
- package/esm/node/idx/startTransaction.js +21 -0
- package/esm/node/idx/startTransaction.js.map +1 -0
- package/esm/node/idx/transactionMeta.js +111 -0
- package/esm/node/idx/transactionMeta.js.map +1 -0
- package/esm/node/idx/types/api.js +43 -0
- package/esm/node/idx/types/api.js.map +1 -0
- package/esm/node/idx/types/idx-js.js +21 -0
- package/esm/node/idx/types/idx-js.js.map +1 -0
- package/esm/node/idx/unlockAccount.js +32 -0
- package/esm/node/idx/unlockAccount.js.map +1 -0
- package/esm/node/idx/util.js +212 -0
- package/esm/node/idx/util.js.map +1 -0
- package/esm/node/index.js +91 -0
- package/esm/node/index.js.map +1 -0
- package/esm/node/myaccount/emailApi.js +86 -0
- package/esm/node/myaccount/emailApi.js.map +1 -0
- package/esm/node/myaccount/myaccount/index.js +24 -0
- package/esm/node/myaccount/myaccount/index.js.map +1 -0
- package/esm/node/myaccount/phoneApi.js +76 -0
- package/esm/node/myaccount/phoneApi.js.map +1 -0
- package/esm/node/myaccount/profileApi.js +46 -0
- package/esm/node/myaccount/profileApi.js.map +1 -0
- package/esm/node/myaccount/request.js +121 -0
- package/esm/node/myaccount/request.js.map +1 -0
- package/esm/node/myaccount/transactions/Base.js +32 -0
- package/esm/node/myaccount/transactions/Base.js.map +1 -0
- package/esm/node/myaccount/transactions/EmailChallengeTransaction.js +48 -0
- package/esm/node/myaccount/transactions/EmailChallengeTransaction.js.map +1 -0
- package/esm/node/myaccount/transactions/EmailStatusTransaction.js +28 -0
- package/esm/node/myaccount/transactions/EmailStatusTransaction.js.map +1 -0
- package/esm/node/myaccount/transactions/EmailTransaction.js +81 -0
- package/esm/node/myaccount/transactions/EmailTransaction.js.map +1 -0
- package/esm/node/myaccount/transactions/PhoneTransaction.js +67 -0
- package/esm/node/myaccount/transactions/PhoneTransaction.js.map +1 -0
- package/esm/node/myaccount/transactions/ProfileSchemaTransaction.js +23 -0
- package/esm/node/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -0
- package/esm/node/myaccount/transactions/ProfileTransaction.js +26 -0
- package/esm/node/myaccount/transactions/ProfileTransaction.js.map +1 -0
- package/esm/node/myaccount/types.js +25 -0
- package/esm/node/myaccount/types.js.map +1 -0
- package/esm/node/oidc/decodeToken.js +34 -0
- package/esm/node/oidc/decodeToken.js.map +1 -0
- package/esm/node/oidc/endpoints/authorize.js +63 -0
- package/esm/node/oidc/endpoints/authorize.js.map +1 -0
- package/esm/node/oidc/endpoints/token.js +83 -0
- package/esm/node/oidc/endpoints/token.js.map +1 -0
- package/esm/node/oidc/endpoints/well-known.js +55 -0
- package/esm/node/oidc/endpoints/well-known.js.map +1 -0
- package/esm/node/oidc/exchangeCodeForTokens.js +59 -0
- package/esm/node/oidc/exchangeCodeForTokens.js.map +1 -0
- package/esm/node/oidc/getToken.js +118 -0
- package/esm/node/oidc/getToken.js.map +1 -0
- package/esm/node/oidc/getUserInfo.js +69 -0
- package/esm/node/oidc/getUserInfo.js.map +1 -0
- package/esm/node/oidc/getWithPopup.js +36 -0
- package/esm/node/oidc/getWithPopup.js.map +1 -0
- package/esm/node/oidc/getWithRedirect.js +35 -0
- package/esm/node/oidc/getWithRedirect.js.map +1 -0
- package/esm/node/oidc/getWithoutPrompt.js +31 -0
- package/esm/node/oidc/getWithoutPrompt.js.map +1 -0
- package/esm/node/oidc/handleOAuthResponse.js +120 -0
- package/esm/node/oidc/handleOAuthResponse.js.map +1 -0
- package/esm/node/oidc/parseFromUrl.js +117 -0
- package/esm/node/oidc/parseFromUrl.js.map +1 -0
- package/esm/node/oidc/renewToken.js +67 -0
- package/esm/node/oidc/renewToken.js.map +1 -0
- package/esm/node/oidc/renewTokens.js +59 -0
- package/esm/node/oidc/renewTokens.js.map +1 -0
- package/esm/node/oidc/renewTokensWithRefresh.js +47 -0
- package/esm/node/oidc/renewTokensWithRefresh.js.map +1 -0
- package/esm/node/oidc/revokeToken.js +49 -0
- package/esm/node/oidc/revokeToken.js.map +1 -0
- package/esm/node/oidc/util/browser.js +69 -0
- package/esm/node/oidc/util/browser.js.map +1 -0
- package/esm/node/oidc/util/defaultTokenParams.js +34 -0
- package/esm/node/oidc/util/defaultTokenParams.js.map +1 -0
- package/esm/node/oidc/util/errors.js +38 -0
- package/esm/node/oidc/util/errors.js.map +1 -0
- package/esm/node/oidc/util/loginRedirect.js +66 -0
- package/esm/node/oidc/util/loginRedirect.js.map +1 -0
- package/esm/node/oidc/util/oauth.js +65 -0
- package/esm/node/oidc/util/oauth.js.map +1 -0
- package/esm/node/oidc/util/oauthMeta.js +38 -0
- package/esm/node/oidc/util/oauthMeta.js.map +1 -0
- package/esm/node/oidc/util/pkce.js +48 -0
- package/esm/node/oidc/util/pkce.js.map +1 -0
- package/esm/node/oidc/util/prepareTokenParams.js +65 -0
- package/esm/node/oidc/util/prepareTokenParams.js.map +1 -0
- package/esm/node/oidc/util/refreshToken.js +33 -0
- package/esm/node/oidc/util/refreshToken.js.map +1 -0
- package/esm/node/oidc/util/urlParams.js +43 -0
- package/esm/node/oidc/util/urlParams.js.map +1 -0
- package/esm/node/oidc/util/validateClaims.js +48 -0
- package/esm/node/oidc/util/validateClaims.js.map +1 -0
- package/esm/node/oidc/util/validateToken.js +34 -0
- package/esm/node/oidc/util/validateToken.js.map +1 -0
- package/esm/node/oidc/verifyToken.js +55 -0
- package/esm/node/oidc/verifyToken.js.map +1 -0
- package/esm/node/options/index.js +85 -0
- package/esm/node/options/index.js.map +1 -0
- package/esm/node/options/node.js +41 -0
- package/esm/node/options/node.js.map +1 -0
- package/esm/node/server/serverStorage.js +82 -0
- package/esm/node/server/serverStorage.js.map +1 -0
- package/esm/node/services/AutoRenewService.js +77 -0
- package/esm/node/services/AutoRenewService.js.map +1 -0
- package/esm/node/services/LeaderElectionService.js +74 -0
- package/esm/node/services/LeaderElectionService.js.map +1 -0
- package/esm/node/services/SyncStorageService.js +130 -0
- package/esm/node/services/SyncStorageService.js.map +1 -0
- package/esm/node/session.js +66 -0
- package/esm/node/session.js.map +1 -0
- package/esm/node/tx/AuthTransaction.js +174 -0
- package/esm/node/tx/AuthTransaction.js.map +1 -0
- package/esm/node/tx/api.js +72 -0
- package/esm/node/tx/api.js.map +1 -0
- package/esm/node/tx/poll.js +117 -0
- package/esm/node/tx/poll.js.map +1 -0
- package/esm/node/tx/util.js +26 -0
- package/esm/node/tx/util.js.map +1 -0
- package/esm/node/types/Token.js +32 -0
- package/esm/node/types/Token.js.map +1 -0
- package/esm/node/types/TokenManager.js +21 -0
- package/esm/node/types/TokenManager.js.map +1 -0
- package/esm/node/types/Transaction.js +52 -0
- package/esm/node/types/Transaction.js.map +1 -0
- package/esm/node/util/console.js +50 -0
- package/esm/node/util/console.js.map +1 -0
- package/esm/node/util/misc.js +32 -0
- package/esm/node/util/misc.js.map +1 -0
- package/esm/node/util/object.js +98 -0
- package/esm/node/util/object.js.map +1 -0
- package/esm/node/util/sharedStorage.js +56 -0
- package/esm/node/util/sharedStorage.js.map +1 -0
- package/esm/node/util/types.js +30 -0
- package/esm/node/util/types.js.map +1 -0
- package/esm/node/util/url.js +57 -0
- package/esm/node/util/url.js.map +1 -0
- package/esm/package.json +3 -0
- package/lib/SavedObject.d.ts +1 -0
- package/lib/ServiceManager.d.ts +1 -7
- package/lib/TokenManager.d.ts +12 -10
- package/lib/cdnEntry.d.ts +18 -0
- package/lib/errors/AuthApiError.d.ts +2 -1
- package/lib/idx/idxState/v1/idxResponseParser.d.ts +2 -2
- package/lib/myaccount/api.d.ts +14 -0
- package/lib/myaccount/emailApi.d.ts +29 -0
- package/lib/myaccount/index.d.ts +13 -0
- package/lib/myaccount/phoneApi.d.ts +25 -0
- package/lib/myaccount/profileApi.d.ts +13 -0
- package/lib/myaccount/request.d.ts +29 -0
- package/lib/myaccount/transactions/Base.d.ts +15 -0
- package/lib/myaccount/transactions/EmailChallengeTransaction.d.ts +12 -0
- package/lib/myaccount/transactions/EmailStatusTransaction.d.ts +9 -0
- package/lib/myaccount/transactions/EmailTransaction.d.ts +15 -0
- package/lib/myaccount/transactions/PhoneTransaction.d.ts +12 -0
- package/lib/myaccount/transactions/ProfileSchemaTransaction.d.ts +5 -0
- package/lib/myaccount/transactions/ProfileTransaction.d.ts +7 -0
- package/lib/myaccount/transactions/index.d.ts +7 -0
- package/lib/myaccount/types.d.ts +55 -0
- package/lib/services/AutoRenewService.d.ts +2 -2
- package/lib/services/LeaderElectionService.d.ts +33 -0
- package/lib/services/SyncStorageService.d.ts +17 -5
- package/lib/services/index.d.ts +1 -0
- package/lib/types/JWT.d.ts +4 -1
- package/lib/types/OktaAuthOptions.d.ts +4 -2
- package/lib/types/Service.d.ts +7 -4
- package/lib/types/Storage.d.ts +2 -0
- package/lib/types/TokenManager.d.ts +20 -4
- package/lib/types/api.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +43 -18
- package/polyfill/index.js +7 -0
- package/esm/esm.browser.js +0 -9829
- package/esm/esm.browser.js.map +0 -1
- package/esm/esm.node.mjs +0 -9927
- package/esm/esm.node.mjs.map +0 -1
package/cjs/options/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["getDefaultOptions","options","devMode","httpRequestClient","fetchRequest","storageUtil","storageManager","STORAGE_MANAGER_OPTIONS","transactionManager","enableSharedStorage","mergeOptions","args","buildOptions","issuer","tokenUrl","authorizeUrl","userinfoUrl","revokeUrl","logoutUrl","clientId","redirectUri","state","scopes","postLogoutRedirectUri","responseMode","responseType","pkce","useInteractionCodeFlow","httpRequestInterceptors","transformErrorXHR","transformAuthState","restoreOriginalUri","headers","cookies","flow","codeChallenge","codeChallengeMethod","recoveryToken","activationToken","idx","useGenericRemediator","exchangeCodeForTokens","ignoreSignature","clientSecret","setLocation"],"sources":["../../../lib/options/index.ts"],"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\nimport { removeTrailingSlash, removeNils } from '../util';\nimport { assertValidConfig } from '../builderUtil';\nimport { OktaAuthOptions } from '../types';\n\nimport fetchRequest from '../fetch/fetchRequest';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, enableSharedStorage, getCookieSettings } from './node';\nimport { isHTTPS } from '../features';\n\nexport function getDefaultOptions(): OktaAuthOptions {\n\n \n const options = {\n devMode: false,\n httpRequestClient: fetchRequest,\n storageUtil: getStorage(),\n storageManager: STORAGE_MANAGER_OPTIONS,\n transactionManager: {\n enableSharedStorage\n }\n };\n return options;\n}\n\nfunction mergeOptions(options, args): OktaAuthOptions {\n return Object.assign({}, options, removeNils(args), {\n storageManager: Object.assign({}, options.storageManager, args.storageManager),\n transactionManager: Object.assign({}, options.transactionManager, args.transactionManager),\n });\n}\n\nexport function buildOptions(args: OktaAuthOptions = {}): OktaAuthOptions {\n assertValidConfig(args);\n args = mergeOptions(getDefaultOptions(), args);\n return removeNils({\n // OIDC configuration\n issuer: removeTrailingSlash(args.issuer),\n tokenUrl: removeTrailingSlash(args.tokenUrl),\n authorizeUrl: removeTrailingSlash(args.authorizeUrl),\n userinfoUrl: removeTrailingSlash(args.userinfoUrl),\n revokeUrl: removeTrailingSlash(args.revokeUrl),\n logoutUrl: removeTrailingSlash(args.logoutUrl),\n clientId: args.clientId,\n redirectUri: args.redirectUri,\n state: args.state,\n scopes: args.scopes,\n postLogoutRedirectUri: args.postLogoutRedirectUri,\n responseMode: args.responseMode,\n responseType: args.responseType,\n pkce: args.pkce === false ? false : true, // PKCE defaults to true\n useInteractionCodeFlow: args.useInteractionCodeFlow,\n\n // Internal options\n httpRequestClient: args.httpRequestClient,\n httpRequestInterceptors: args.httpRequestInterceptors,\n transformErrorXHR: args.transformErrorXHR,\n transformAuthState: args.transformAuthState,\n restoreOriginalUri: args.restoreOriginalUri,\n storageUtil: args.storageUtil,\n headers: args.headers,\n devMode: !!args.devMode,\n storageManager: args.storageManager,\n transactionManager: args.transactionManager,\n cookies: getCookieSettings(args, isHTTPS()),\n flow: args.flow,\n codeChallenge: args.codeChallenge,\n codeChallengeMethod: args.codeChallengeMethod,\n recoveryToken: args.recoveryToken,\n activationToken: args.activationToken,\n // BETA WARNING: configs in this section are subject to change without a breaking change notice\n idx: {\n useGenericRemediator: !!args.idx?.useGenericRemediator, // false by default\n exchangeCodeForTokens: args.idx?.exchangeCodeForTokens !== false // true by default\n },\n\n // Give the developer the ability to disable token signature validation.\n ignoreSignature: !!args.ignoreSignature,\n\n // Server-side web applications\n clientSecret: args.clientSecret,\n setLocation: args.setLocation\n });\n}\n"],"mappings":";;;;;;;;;AAYA;;AACA;;AAGA;;AACA;;AACA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO,SAASA,iBAAT,GAA8C;EAGnD,MAAMC,OAAO,GAAG;IACdC,OAAO,EAAE,KADK;IAEdC,iBAAiB,EAAEC,qBAFL;IAGdC,WAAW,EAAE,uBAHC;IAIdC,cAAc,EAAEC,6BAJF;IAKdC,kBAAkB,EAAE;MAClBC,mBAAmB,EAAnBA;IADkB;EALN,CAAhB;EASA,OAAOR,OAAP;AACD;;AAED,SAASS,YAAT,CAAsBT,OAAtB,EAA+BU,IAA/B,EAAsD;EACpD,OAAO,qBAAc,EAAd,EAAkBV,OAAlB,EAA2B,sBAAWU,IAAX,CAA3B,EAA6C;IAClDL,cAAc,EAAE,qBAAc,EAAd,EAAkBL,OAAO,C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AsBhBC,kBAAkB,EAAEnB,IAAI,CAACmB,kBAtBT;IAuBhBC,kBAAkB,EAAEpB,IAAI,CAACoB,kBAvBT;IAwBhB1B,WAAW,EAAEM,IAAI,CAACN,WAxBF;IAyBhB2B,OAAO,EAAErB,IAAI,CAACqB,OAzBE;IA0BhB9B,OAAO,EAAE,CAAC,CAACS,IAAI,CAACT,OA1BA;IA2BhBI,cAAc,EAAEK,IAAI,CAACL,cA3BL;IA4BhBE,kBAAkB,EAAEG,IAAI,CAACH,kBA5BT;IA6BhByB,OAAO,EAAE,6BAAkBtB,IAAlB,EAAwB,wBAAxB,CA7BO;IA8BhBuB,IAAI,EAAEvB,IAAI,CAACuB,IA9BK;IA+BhBC,aAAa,EAAExB,IAAI,CAACwB,aA/BJ;IAgChBC,mBAAmB,EAAEzB,IAAI,CAACyB,mBAhCV;IAiChBC,aAAa,EAAE1B,IAAI,CAAC0B,aAjCJ;IAkChBC,eAAe,EAAE3B,IAAI,CAAC2B,eAlCN;IAmChB;IACAC,GAAG,EAAE;MACHC,oBAAoB,EAAE,CAAC,eAAC7B,IAAI,CAAC4B,GAAN,sCAAC,UAAUC,oBAAX,CADpB;MACqD;MACxDC,qBAAqB,EAAE,eAAA9B,IAAI,CAAC4B,GAAL,0DAAUE,qBAAV,MAAoC,KAFxD,CAE8D;;IAF9D,CApCW;IAyChB;IACAC,eAAe,EAAE,CAAC,CAAC/B,IAAI,CAAC+B,eA1CR;IA4ChB;IACAC,YAAY,EAAEhC,IAAI,CAACgC,YA7CH;IA8ChBC,WAAW,EAAEjC,IAAI,CAACiC;EA9CF,CAAX,CAAP;AAgDD"}
|
package/cjs/options/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"node.js","names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","enableSharedStorage","getCookieSettings","args","isHTTPS","cookies"],"sources":["../../../lib/options/node.ts"],"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\nimport { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\nexport const enableSharedStorage = false;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"mappings":";;;;;;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,SAASA,UAAT,GAAmC;EACxC,OAAOC,sBAAP;AACD;;AAEM,MAAMC,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,QADY;EADT,CADqD;EAM5DC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,QADY;EADT,CANqD;EAW5DE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,QADY;EADH;AAX+C,CAAvD;;AAkBA,MAAMG,mBAAmB,GAAG,KAA5B,C,CAEP;;;;AACO,SAASC,iBAAT,CAA2BC,IAAqB,GAAG,EAAnD,EAAuDC,OAAvD,EAA0E;EAC/E,OAAOD,IAAI,CAACE,OAAZ;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"serverStorage.js","names":["sharedStorage","NodeCache","ServerCookies","constructor","nodeCache","set","name","value","expiresAt","Date","parse","ttl","now","get","delete","del","ServerStorage","storage","testStorageType","storageType","supported","getStorageByType","storageProvider","getStorage","AuthSdkError","findStorageType","getHttpCache","getItem","setItem","key","isSharedStorage"],"sources":["../../../lib/server/serverStorage.ts"],"sourcesContent":["/*!\n * Copyright (c) 2018-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\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore \n// Do not use this type in code, so it won't be emitted in the declaration output\nimport NodeCache from 'node-cache';\nimport { SimpleStorage, StorageType, StorageUtil, Cookies } from '../types';\nimport { AuthSdkError } from '../errors';\n// eslint-disable-next-line import/no-commonjs\n\n// this is a SHARED memory storage to support a stateless http server\nconst sharedStorage = typeof NodeCache === 'function' ? new NodeCache() : null;\n\nclass ServerCookies implements Cookies {\n nodeCache: any; // NodeCache\n \n constructor(nodeCache) {\n this.nodeCache = nodeCache;\n }\n\n set(name: string, value: string, expiresAt: string): string {\n // eslint-disable-next-line no-extra-boolean-cast\n if (!!(Date.parse(expiresAt))) {\n // Time to expiration in seconds\n var ttl = (Date.parse(expiresAt) - Date.now()) / 1000;\n this.nodeCache.set(name, value, ttl);\n } else {\n this.nodeCache.set(name, value);\n }\n\n return this.get(name);\n }\n\n get(name): string {\n return this.nodeCache.get(name);\n }\n\n delete(name) {\n return this.nodeCache.del(name);\n }\n}\n// Building this as an object allows us to mock the functions in our tests\nclass ServerStorage implements StorageUtil {\n nodeCache: any; // NodeCache\n storage: Cookies;\n constructor(nodeCache) {\n this.nodeCache = nodeCache;\n this.storage = new ServerCookies(nodeCache);\n }\n\n testStorageType(storageType: StorageType): boolean {\n var supported = false;\n switch (storageType) {\n case 'memory':\n supported = true;\n break;\n default:\n break;\n }\n return supported;\n }\n\n getStorageByType(storageType: StorageType): SimpleStorage {\n let storageProvider;\n switch (storageType) {\n case 'memory':\n storageProvider = this.getStorage();\n break;\n default:\n throw new AuthSdkError(`Unrecognized storage option: ${storageType}`);\n break;\n }\n return storageProvider;\n }\n\n findStorageType(): StorageType {\n return 'memory';\n }\n\n // will be removed in next version. OKTA-362589\n getHttpCache() {\n return null; // stubbed in server.js\n }\n\n // shared in-memory using node cache\n getStorage(): SimpleStorage {\n return {\n getItem: this.nodeCache.get,\n setItem: (key, value) => {\n this.nodeCache.set(key, value, '2200-01-01T00:00:00.000Z');\n },\n isSharedStorage: () => true\n };\n }\n}\n\nexport default new ServerStorage(sharedStorage);\n"],"mappings":";;;;;;AAgBA;;AAEA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AAEA;AACA,MAAMA,aAAa,GAAG,OAAOC,kBAAP,KAAqB,UAArB,GAAkC,IAAIA,kBAAJ,EAAlC,GAAoD,IAA1E;;AAEA,MAAMC,aAAN,CAAuC;EACrB;EAEhBC,WAAW,CAACC,SAAD,EAAY;IACrB,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;EAEDC,GAAG,CAACC,IAAD,EAAeC,KAAf,EAA8BC,SAA9B,EAAyD;IAC1D;IACA,IAAI,CAAC,CAAEC,IAAI,CAACC,KAAL,CAAWF,SAAX,CAAP,EAA+B;MAC7B;MACA,IAAIG,GAAG,GAAG,CAACF,IAAI,CAACC,KAAL,CAAWF,SAAX,IAAwBC,IAAI,CAACG,GAAL,EAAzB,IAAuC,IAAjD;MACA,KAAKR,SAAL,CAAeC,GAAf,CAAmB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;QACvB,KAAKH,SAAL,CAAeC,GAAf,CAAmBwB,GAAnB,EAAwBtB,KAAxB,EAA+B,0BAA/B;MACD,CAJI;MAKLuB,eAAe,EAAE,MAAM;IALlB,CAAP;EAOD;;AAnDwC;;eAsD5B,IAAId,aAAJ,CAAkBhB,aAAlB,C"}
|
|
@@ -6,10 +6,10 @@ exports.AutoRenewService = void 0;
|
|
|
6
6
|
|
|
7
7
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
8
8
|
|
|
9
|
-
var _TokenManager = require("../TokenManager");
|
|
10
|
-
|
|
11
9
|
var _errors = require("../errors");
|
|
12
10
|
|
|
11
|
+
var _types = require("../types");
|
|
12
|
+
|
|
13
13
|
var _features = require("../features");
|
|
14
14
|
|
|
15
15
|
/*!
|
|
@@ -68,17 +68,17 @@ class AutoRenewService {
|
|
|
68
68
|
return !!this.options.autoRenew || !!this.options.autoRemove;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
start() {
|
|
71
|
+
async start() {
|
|
72
72
|
if (this.canStart()) {
|
|
73
|
-
this.stop();
|
|
74
|
-
this.tokenManager.on(
|
|
73
|
+
await this.stop();
|
|
74
|
+
this.tokenManager.on(_types.EVENT_EXPIRED, this.onTokenExpiredHandler);
|
|
75
75
|
this.started = true;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
stop() {
|
|
79
|
+
async stop() {
|
|
80
80
|
if (this.started) {
|
|
81
|
-
this.tokenManager.off(
|
|
81
|
+
this.tokenManager.off(_types.EVENT_EXPIRED, this.onTokenExpiredHandler);
|
|
82
82
|
this.renewTimeQueue = [];
|
|
83
83
|
this.started = false;
|
|
84
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"AutoRenewService.js","names":["AutoRenewService","constructor","tokenManager","options","renewTimeQueue","onTokenExpiredHandler","bind","shouldThrottleRenew","res","push","Date","now","length","firstTime","shift","lastTime","requiresLeadership","syncStorage","key","autoRenew","error","AuthSdkError","emitError","renew","catch","autoRemove","remove","canStart","start","stop","on","EVENT_EXPIRED","started","off","isStarted"],"sources":["../../../lib/services/AutoRenewService.ts"],"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 { TokenManager } from '../TokenManager';\nimport { AuthSdkError } from '../errors';\nimport { ServiceInterface, ServiceManagerOptions, EVENT_EXPIRED } from '../types';\nimport { isBrowser } from '../features';\n\nexport class AutoRenewService implements ServiceInterface {\n private tokenManager: TokenManager;\n private options: ServiceManagerOptions;\n private renewTimeQueue: Array<number>;\n private started = false;\n\n constructor(tokenManager: TokenManager, options: ServiceManagerOptions = {}) {\n this.tokenManager = tokenManager;\n this.options = options;\n this.renewTimeQueue = [];\n this.onTokenExpiredHandler = this.onTokenExpiredHandler.bind(this);\n }\n \n private shouldThrottleRenew(): boolean {\n let res = false;\n this.renewTimeQueue.push(Date.now());\n if (this.renewTimeQueue.length >= 10) {\n // get and remove first item from queue\n const firstTime = this.renewTimeQueue.shift() as number;\n const lastTime = this.renewTimeQueue[this.renewTimeQueue.length - 1];\n res = (lastTime - firstTime) < 30 * 1000;\n }\n return res;\n }\n\n requiresLeadership() {\n // If tokens sync storage is enabled, handle tokens expiration only in 1 leader tab\n return !!this.options.syncStorage && isBrowser();\n }\n\n private onTokenExpiredHandler(key: string) {\n if (this.options.autoRenew) {\n if (this.shouldThrottleRenew()) {\n const error = new AuthSdkError('Too many token renew requests');\n this.tokenManager.emitError(error);\n } else {\n this.tokenManager.renew(key).catch(() => {}); // Renew errors will emit an \"error\" event \n }\n } else if (this.options.autoRemove) {\n this.tokenManager.remove(key);\n }\n }\n\n canStart() {\n return (!!this.options.autoRenew || !!this.options.autoRemove);\n }\n\n async start() {\n if (this.canStart()) {\n await this.stop();\n this.tokenManager.on(EVENT_EXPIRED, this.onTokenExpiredHandler);\n this.started = true;\n }\n }\n\n async stop() {\n if (this.started) {\n this.tokenManager.off(EVENT_EXPIRED, this.onTokenExpiredHandler);\n this.renewTimeQueue = [];\n this.started = false;\n }\n }\n\n isStarted() {\n return this.started;\n }\n}\n"],"mappings":";;;;;;;;AAcA;;AACA;;AACA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAMA,gBAAN,CAAmD;EAMxDC,WAAW,CAACC,YAAD,EAA6BC,OAA8B,GAAG,EAA9D,EAAkE;IAAA,+CAF3D,KAE2D;IAC3E,KAAKD,YAAL,GAAoBA,YAApB;IACA,KAAKC,OAAL,GAAeA,OAAf;IACA,KAAKC,cAAL,GAAsB,EAAtB;IACA,KAAKC,qBAAL,GAA6B,KAAKA,qBAAL,CAA2BC,IAA3B,CAAgC,IAAhC,CAA7B;EACD;;EAEOC,mBAAmB,GAAY;IACrC,IAAIC,GAAG,GAAG,KAAV;IACA,KAAKJ,cAAL,CAAoBK,IAApB,CAAyBC,IAAI,CAACC,GAAL,EAAzB;;IACA,IAAI,KAAKP,cAAL,CAAoBQ,MAApB,IAA8B,EAAlC,EAAsC;MACpC;MACA,MAAMC,SAAS,GAAG,KAAKT,cAAL,CAAoBU,KAApB,EAAlB;MACA,MAAMC,QAAQ,GAAG,KAAKX,cAAL,CAAoB,KAAKA,cAAL,CAAoBQ,MAApB,GAA6B,CAAjD,CAAjB;MACAJ,GAAG,GAAIO,QAAQ,GAAGF,SAAZ,GAAyB,KAAK,IAApC;IACD;;IACD,OAAOL,GAAP;EACD;;EAEDQ,kBAAkB,GAAG;IACnB;IACA,OAAO,CA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equireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.LeaderElectionService = void 0;
|
|
6
|
+
|
|
7
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
8
|
+
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
10
|
+
|
|
11
|
+
var _broadcastChannel = require("broadcast-channel");
|
|
12
|
+
|
|
13
|
+
var _features = require("../features");
|
|
14
|
+
|
|
15
|
+
/*!
|
|
16
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
17
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
18
|
+
*
|
|
19
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
22
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
*
|
|
24
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
class LeaderElectionService {
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
(0, _defineProperty2.default)(this, "started", false);
|
|
29
|
+
this.options = options;
|
|
30
|
+
this.onLeaderDuplicate = this.onLeaderDuplicate.bind(this);
|
|
31
|
+
this.onLeader = this.onLeader.bind(this);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
onLeaderDuplicate() {}
|
|
35
|
+
|
|
36
|
+
async onLeader() {
|
|
37
|
+
var _this$options$onLeade, _this$options;
|
|
38
|
+
|
|
39
|
+
await ((_this$options$onLeade = (_this$options = this.options).onLeader) === null || _this$options$onLeade === void 0 ? void 0 : _this$options$onLeade.call(_this$options));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isLeader() {
|
|
43
|
+
var _this$elector;
|
|
44
|
+
|
|
45
|
+
return !!((_this$elector = this.elector) !== null && _this$elector !== void 0 && _this$elector.isLeader);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
hasLeader() {
|
|
49
|
+
var _this$elector2;
|
|
50
|
+
|
|
51
|
+
return !!((_this$elector2 = this.elector) !== null && _this$elector2 !== void 0 && _this$elector2.hasLeader);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async start() {
|
|
55
|
+
await this.stop();
|
|
56
|
+
|
|
57
|
+
if (this.canStart()) {
|
|
58
|
+
const {
|
|
59
|
+
electionChannelName
|
|
60
|
+
} = this.options;
|
|
61
|
+
this.channel = new _broadcastChannel.BroadcastChannel(electionChannelName);
|
|
62
|
+
this.elector = (0, _broadcastChannel.createLeaderElection)(this.channel);
|
|
63
|
+
this.elector.onduplicate = this.onLeaderDuplicate;
|
|
64
|
+
this.elector.awaitLeadership().then(this.onLeader);
|
|
65
|
+
this.started = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async stop() {
|
|
70
|
+
if (this.started) {
|
|
71
|
+
if (this.elector) {
|
|
72
|
+
await this.elector.die();
|
|
73
|
+
this.elector = undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.channel) {
|
|
77
|
+
// Workaround to fix error `Failed to execute 'postMessage' on 'BroadcastChannel': Channel is closed`
|
|
78
|
+
this.channel.postInternal = () => _promise.default.resolve();
|
|
79
|
+
|
|
80
|
+
await this.channel.close();
|
|
81
|
+
this.channel = undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.started = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
requiresLeadership() {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
isStarted() {
|
|
93
|
+
return this.started;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
canStart() {
|
|
97
|
+
return (0, _features.isBrowser)();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
exports.LeaderElectionService = LeaderElectionService;
|
|
103
|
+
//# sourceMappingURL=LeaderElectionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeaderElectionService.js","names":["LeaderElectionService","constructor","options","onLeaderDuplicate","bind","onLeader","isLeader","elector","hasLeader","start","stop","canStart","electionChannelName","channel","BroadcastChannel","onduplicate","awaitLeadership","then","started","die","undefined","postInternal","resolve","close","requiresLeadership","isStarted"],"sources":["../../../lib/services/LeaderElectionService.ts"],"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 { ServiceInterface, ServiceManagerOptions } from '../types';\nimport {\n BroadcastChannel,\n createLeaderElection,\n LeaderElector\n} from 'broadcast-channel';\nimport { isBrowser } from '../features';\n\ndeclare type OnLeaderHandler = (() => Promise<void>);\ndeclare type ServiceOptions = ServiceManagerOptions & {\n onLeader?: OnLeaderHandler;\n};\n\nexport class LeaderElectionService implements ServiceInterface {\n private options: ServiceOptions;\n private channel?: BroadcastChannel;\n private elector?: LeaderElector;\n private started = false;\n\n constructor(options: ServiceOptions = {}) {\n this.options = options;\n this.onLeaderDuplicate = this.onLeaderDuplicate.bind(this);\n this.onLeader = this.onLeader.bind(this);\n }\n\n private onLeaderDuplicate() {\n }\n\n private async onLeader() {\n await this.options.onLeader?.();\n }\n\n isLeader() {\n return !!this.elector?.isLeader;\n }\n\n hasLeader() {\n return !!this.elector?.hasLeader;\n }\n\n async start() {\n await this.stop();\n if (this.canStart()) {\n const { electionChannelName } = this.options;\n this.channel = new BroadcastChannel(electionChannelName as string);\n this.elector = createLeaderElection(this.channel);\n this.elector.onduplicate = this.onLeaderDuplicate;\n this.elector.awaitLeadership().then(this.onLeader);\n this.started = true;\n }\n }\n\n async stop() {\n if (this.started) {\n if (this.elector) {\n await this.elector.die();\n this.elector = undefined;\n }\n if (this.channel) {\n // Workaround to fix error `Failed to execute 'postMessage' on 'BroadcastChannel': Channel is closed`\n (this.channel as any).postInternal = () => Promise.resolve();\n await this.channel.close();\n this.channel = undefined;\n }\n this.started = false;\n }\n }\n\n requiresLeadership() {\n return false;\n }\n\n isStarted() {\n return this.started;\n }\n\n canStart() {\n return isBrowser();\n }\n\n}\n"],"mappings":";;;;;;;;;;AAcA;;AAKA;;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBO,MAAMA,qBAAN,CAAwD;EAM7DC,WAAW,CAACC,OAAuB,GAAG,EAA3B,EAA+B;IAAA,+CAFxB,KAEwB;IACxC,KAAKA,OAAL,GAAeA,OAAf;IACA,KAAKC,iBAAL,GAAyB,KAAKA,iBAAL,CAAuBC,IAAvB,CAA4B,IAA5B,CAAzB;IACA,KAAKC,QAAL,GAAgB,KAAKA,QAAL,CAAcD,IAAd,CAAmB,IAAnB,CAAhB;EACD;;EAEOD,iBAAiB,GAAG,CAC3B;;EAEqB,MAARE,QAAQ,GAAG;IAAA;;IACvB,gCAAM,sBAAKH,OAAL,EAAaG,QAAnB,0DAAM,yCAAN;EACD;;EAEDC,QAAQ,GAAG;IAAA;;IACT,OAAO,CAAC,mBAAC,KAAKC,OAAN,0CAAC,cAAcD,QAAf,CAAR;EACD;;EAEDE,SAAS,GAAG;IAAA;;IACV,OAAO,CAAC,oBAAC,KAAKD,OAAN,2CAAC,eAAcC,SAAf,CAAR;EACD;;EAEU,MAALC,KAAK,GAAG;IACZ,MAAM,KAAKC,IAAL,EAAN;;IACA,IAAI,KAAKC,QAAL,EAAJ,EAAqB;MACnB,MAAM;QAAEC;MAAF,IAA0B,KAAKV,OAArC;MACA,KAAKW,OAAL,GAAe,IAAIC,kCAAJ,CAAqBF,mBAArB,CAAf;MACA,KAAKL,OAAL,GAAe,4CAAqB,KAAKM,OAA1B,CAAf;MACA,KAAKN,OAAL,CAAaQ,WAAb,GAA2B,KAAKZ,iBAAhC;MACA,KAAKI,OAAL,CAAaS,eAAb,GAA+BC,IAA/B,CAAoC,KAAKZ,QAAzC;MACA,KAAKa,OAAL,GAAe,IAAf;IACD;EACF;;EAES,MAAJR,IAAI,GAAG;IACX,IAAI,KAAKQ,OAAT,EAAkB;MAChB,IAAI,KAAKX,OAAT,EAAkB;QAChB,MAAM,KAAKA,OAAL,CAAaY,GAAb,EAAN;QACA,KAAKZ,OAAL,GAAea,SAAf;MACD;;MACD,IAAI,KAAKP,OAAT,EAAkB;QAChB;QACC,KAAKA,OAAN,CAAsBQ,YAAtB,GAAqC,MAAM,iBAAQC,OAAR,EAA3C;;QACA,MAAM,KAAKT,OAAL,CAAaU,KAAb,EAAN;QACA,KAAKV,OAAL,GAAeO,SAAf;MACD;;MACD,KAAKF,OAAL,GAAe,KAAf;IACD;EACF;;EAEDM,kBAAkB,GAAG;IACnB,OAAO,KAAP;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKP,OAAZ;EACD;;EAEDP,QAAQ,GAAG;IACT,OAAO,0BAAP;EACD;;AAjE4D"}
|
|
@@ -6,8 +6,12 @@ exports.SyncStorageService = void 0;
|
|
|
6
6
|
|
|
7
7
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
8
8
|
|
|
9
|
+
var _broadcastChannel = require("broadcast-channel");
|
|
10
|
+
|
|
9
11
|
var _features = require("../features");
|
|
10
12
|
|
|
13
|
+
var _types = require("../types");
|
|
14
|
+
|
|
11
15
|
/*!
|
|
12
16
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
17
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,43 +23,17 @@ var _features = require("../features");
|
|
|
19
23
|
*
|
|
20
24
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
25
|
*/
|
|
22
|
-
|
|
23
|
-
/* global window */
|
|
24
26
|
class SyncStorageService {
|
|
25
27
|
constructor(tokenManager, options = {}) {
|
|
26
28
|
(0, _defineProperty2.default)(this, "started", false);
|
|
29
|
+
(0, _defineProperty2.default)(this, "enablePostMessage", true);
|
|
27
30
|
this.tokenManager = tokenManager;
|
|
28
31
|
this.options = options;
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
storageListener({
|
|
37
|
-
key,
|
|
38
|
-
newValue,
|
|
39
|
-
oldValue
|
|
40
|
-
}) {
|
|
41
|
-
const opts = this.tokenManager.getOptions();
|
|
42
|
-
|
|
43
|
-
const handleCrossTabsStorageChange = () => {
|
|
44
|
-
this.tokenManager.resetExpireEventTimeoutAll();
|
|
45
|
-
this.tokenManager.emitEventsForCrossTabsStorageUpdate(newValue, oldValue);
|
|
46
|
-
}; // Skip if:
|
|
47
|
-
// not from localStorage.clear (event.key is null)
|
|
48
|
-
// event.key is not the storageKey
|
|
49
|
-
// oldValue === newValue
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (key && (key !== opts.storageKey || newValue === oldValue)) {
|
|
53
|
-
return;
|
|
54
|
-
} // LocalStorage cross tabs update is not synced in IE, set a 1s timer by default to read latest value
|
|
55
|
-
// https://stackoverflow.com/questions/24077117/localstorage-in-win8-1-ie11-does-not-synchronize
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.syncTimeout = setTimeout(() => handleCrossTabsStorageChange(), opts._storageEventDelay);
|
|
32
|
+
this.onTokenAddedHandler = this.onTokenAddedHandler.bind(this);
|
|
33
|
+
this.onTokenRemovedHandler = this.onTokenRemovedHandler.bind(this);
|
|
34
|
+
this.onTokenRenewedHandler = this.onTokenRenewedHandler.bind(this);
|
|
35
|
+
this.onSetStorageHandler = this.onSetStorageHandler.bind(this);
|
|
36
|
+
this.onSyncMessageHandler = this.onSyncMessageHandler.bind(this);
|
|
59
37
|
}
|
|
60
38
|
|
|
61
39
|
requiresLeadership() {
|
|
@@ -70,23 +48,127 @@ class SyncStorageService {
|
|
|
70
48
|
return !!this.options.syncStorage && (0, _features.isBrowser)();
|
|
71
49
|
}
|
|
72
50
|
|
|
73
|
-
start() {
|
|
51
|
+
async start() {
|
|
74
52
|
if (this.canStart()) {
|
|
75
|
-
this.stop();
|
|
76
|
-
|
|
53
|
+
await this.stop();
|
|
54
|
+
const {
|
|
55
|
+
syncChannelName
|
|
56
|
+
} = this.options;
|
|
57
|
+
this.channel = new _broadcastChannel.BroadcastChannel(syncChannelName);
|
|
58
|
+
this.tokenManager.on(_types.EVENT_ADDED, this.onTokenAddedHandler);
|
|
59
|
+
this.tokenManager.on(_types.EVENT_REMOVED, this.onTokenRemovedHandler);
|
|
60
|
+
this.tokenManager.on(_types.EVENT_RENEWED, this.onTokenRenewedHandler);
|
|
61
|
+
this.tokenManager.on(_types.EVENT_SET_STORAGE, this.onSetStorageHandler);
|
|
62
|
+
this.channel.addEventListener('message', this.onSyncMessageHandler);
|
|
77
63
|
this.started = true;
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
66
|
|
|
81
|
-
stop() {
|
|
67
|
+
async stop() {
|
|
82
68
|
if (this.started) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
var _this$channel, _this$channel2;
|
|
70
|
+
|
|
71
|
+
this.tokenManager.off(_types.EVENT_ADDED, this.onTokenAddedHandler);
|
|
72
|
+
this.tokenManager.off(_types.EVENT_REMOVED, this.onTokenRemovedHandler);
|
|
73
|
+
this.tokenManager.off(_types.EVENT_RENEWED, this.onTokenRenewedHandler);
|
|
74
|
+
this.tokenManager.off(_types.EVENT_SET_STORAGE, this.onSetStorageHandler);
|
|
75
|
+
(_this$channel = this.channel) === null || _this$channel === void 0 ? void 0 : _this$channel.removeEventListener('message', this.onSyncMessageHandler);
|
|
76
|
+
await ((_this$channel2 = this.channel) === null || _this$channel2 === void 0 ? void 0 : _this$channel2.close());
|
|
77
|
+
this.channel = undefined;
|
|
86
78
|
this.started = false;
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
|
|
82
|
+
onTokenAddedHandler(key, token) {
|
|
83
|
+
var _this$channel3;
|
|
84
|
+
|
|
85
|
+
if (!this.enablePostMessage) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
(_this$channel3 = this.channel) === null || _this$channel3 === void 0 ? void 0 : _this$channel3.postMessage({
|
|
90
|
+
type: _types.EVENT_ADDED,
|
|
91
|
+
key,
|
|
92
|
+
token
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
onTokenRemovedHandler(key, token) {
|
|
97
|
+
var _this$channel4;
|
|
98
|
+
|
|
99
|
+
if (!this.enablePostMessage) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
(_this$channel4 = this.channel) === null || _this$channel4 === void 0 ? void 0 : _this$channel4.postMessage({
|
|
104
|
+
type: _types.EVENT_REMOVED,
|
|
105
|
+
key,
|
|
106
|
+
token
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
onTokenRenewedHandler(key, token, oldToken) {
|
|
111
|
+
var _this$channel5;
|
|
112
|
+
|
|
113
|
+
if (!this.enablePostMessage) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
(_this$channel5 = this.channel) === null || _this$channel5 === void 0 ? void 0 : _this$channel5.postMessage({
|
|
118
|
+
type: _types.EVENT_RENEWED,
|
|
119
|
+
key,
|
|
120
|
+
token,
|
|
121
|
+
oldToken
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
onSetStorageHandler(storage) {
|
|
126
|
+
var _this$channel6;
|
|
127
|
+
|
|
128
|
+
(_this$channel6 = this.channel) === null || _this$channel6 === void 0 ? void 0 : _this$channel6.postMessage({
|
|
129
|
+
type: _types.EVENT_SET_STORAGE,
|
|
130
|
+
storage
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/* eslint-disable complexity */
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
onSyncMessageHandler(msg) {
|
|
137
|
+
// Notes:
|
|
138
|
+
// 1. Using `enablePostMessage` flag here to prevent sync message loop.
|
|
139
|
+
// If this flag is on, tokenManager event handlers do not post sync message.
|
|
140
|
+
// 2. IE11 has known issue with synchronization of LocalStorage cross tabs.
|
|
141
|
+
// One workaround is to set empty event handler for `window.onstorage`.
|
|
142
|
+
// But it's not 100% working, sometimes you still get old value from LocalStorage.
|
|
143
|
+
// Better approch is to explicitly udpate LocalStorage with `setStorage`.
|
|
144
|
+
this.enablePostMessage = false;
|
|
145
|
+
|
|
146
|
+
switch (msg.type) {
|
|
147
|
+
case _types.EVENT_SET_STORAGE:
|
|
148
|
+
this.tokenManager.getStorage().setStorage(msg.storage);
|
|
149
|
+
break;
|
|
150
|
+
|
|
151
|
+
case _types.EVENT_ADDED:
|
|
152
|
+
this.tokenManager.emitAdded(msg.key, msg.token);
|
|
153
|
+
this.tokenManager.setExpireEventTimeout(msg.key, msg.token);
|
|
154
|
+
break;
|
|
155
|
+
|
|
156
|
+
case _types.EVENT_REMOVED:
|
|
157
|
+
this.tokenManager.clearExpireEventTimeout(msg.key);
|
|
158
|
+
this.tokenManager.emitRemoved(msg.key, msg.token);
|
|
159
|
+
break;
|
|
160
|
+
|
|
161
|
+
case _types.EVENT_RENEWED:
|
|
162
|
+
this.tokenManager.emitRenewed(msg.key, msg.token, msg.oldToken);
|
|
163
|
+
break;
|
|
164
|
+
|
|
165
|
+
default:
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.enablePostMessage = true;
|
|
170
|
+
}
|
|
171
|
+
|
|
90
172
|
}
|
|
91
173
|
|
|
92
174
|
exports.SyncStorageService = SyncStorageService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"SyncStorageService.js","names":["SyncStorageService","constructor","tokenManager","options","onTokenAddedHandler","bind","onTokenRemovedHandler","onTokenRenewedHandler","onSetStorageHandler","onSyncMessageHandler","requiresLeadership","isStarted","started","canStart","syncStorage","start","stop","syncChannelName","channel","BroadcastChannel","on","EVENT_ADDED","EVENT_REMOVED","EVENT_RENEWED","EVENT_SET_STORAGE","addEventListener","off","removeEventListener","close","undefined","key","token","enablePostMessage","postMessage","type","oldToken","storage","msg","getStorage","setStorage","emitAdded","setExpireEventTimeout","clearExpireEventTimeout","emitRemoved","emitRenewed"],"sources":["../../../lib/services/SyncStorageService.ts"],"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\nimport { TokenManager } from '../TokenManager';\nimport { BroadcastChannel } from 'broadcast-channel';\nimport { isBrowser } from '../features';\nimport {\n ServiceManagerOptions, ServiceInterface, Token, Tokens, \n EVENT_ADDED, EVENT_REMOVED, EVENT_RENEWED, EVENT_SET_STORAGE\n} from '../types';\n\nexport type SyncMessage = {\n type: string;\n key?: string;\n token?: Token;\n oldToken?: Token;\n storage?: Tokens;\n};\nexport class SyncStorageService implements ServiceInterface {\n private tokenManager: TokenManager;\n private options: ServiceManagerOptions;\n private channel?: BroadcastChannel<SyncMessage>;\n private started = false;\n private enablePostMessage = true;\n\n constructor(tokenManager: TokenManager, options: ServiceManagerOptions = {}) {\n this.tokenManager = tokenManager;\n this.options = options;\n this.onTokenAddedHandler = this.onTokenAddedHandler.bind(this);\n this.onTokenRemovedHandler = this.onTokenRemovedHandler.bind(this);\n this.onTokenRenewedHandler = this.onTokenRenewedHandler.bind(this);\n this.onSetStorageHandler = this.onSetStorageHandler.bind(this);\n this.onSyncMessageHandler = this.onSyncMessageHandler.bind(this);\n }\n\n requiresLeadership() {\n return false;\n }\n\n isStarted() {\n return this.started;\n }\n\n canStart() {\n return !!this.options.syncStorage && isBrowser();\n }\n\n async start() {\n if (this.canStart()) {\n await this.stop();\n const { syncChannelName } = this.options;\n this.channel = new BroadcastChannel(syncChannelName as string);\n this.tokenManager.on(EVENT_ADDED, this.onTokenAddedHandler);\n this.tokenManager.on(EVENT_REMOVED, this.onTokenRemovedHandler);\n this.tokenManager.on(EVENT_RENEWED, this.onTokenRenewedHandler);\n this.tokenManager.on(EVENT_SET_STORAGE, this.onSetStorageHandler);\n this.channel.addEventListener('message', this.onSyncMessageHandler);\n this.started = true;\n }\n }\n\n async stop() {\n if (this.started) {\n this.tokenManager.off(EVENT_ADDED, this.onTokenAddedHandler);\n this.tokenManager.off(EVENT_REMOVED, this.onTokenRemovedHandler);\n this.tokenManager.off(EVENT_RENEWED, this.onTokenRenewedHandler);\n this.tokenManager.off(EVENT_SET_STORAGE, this.onSetStorageHandler);\n this.channel?.removeEventListener('message', this.onSyncMessageHandler);\n await this.channel?.close();\n this.channel = undefined;\n this.started = false;\n }\n }\n\n private onTokenAddedHandler(key: string, token: Token) {\n if (!this.enablePostMessage) {\n return;\n }\n this.channel?.postMessage({\n type: EVENT_ADDED,\n key,\n token\n });\n }\n\n private onTokenRemovedHandler(key: string, token: Token) {\n if (!this.enablePostMessage) {\n return;\n }\n this.channel?.postMessage({\n type: EVENT_REMOVED,\n key,\n token\n });\n }\n\n private onTokenRenewedHandler(key: string, token: Token, oldToken?: Token) {\n if (!this.enablePostMessage) {\n return;\n }\n this.channel?.postMessage({\n type: EVENT_RENEWED,\n key,\n token,\n oldToken\n });\n }\n\n private onSetStorageHandler(storage: Tokens) {\n this.channel?.postMessage({\n type: EVENT_SET_STORAGE,\n storage\n });\n }\n\n /* eslint-disable complexity */\n private onSyncMessageHandler(msg: SyncMessage) {\n // Notes:\n // 1. Using `enablePostMessage` flag here to prevent sync message loop.\n // If this flag is on, tokenManager event handlers do not post sync message.\n // 2. IE11 has known issue with synchronization of LocalStorage cross tabs.\n // One workaround is to set empty event handler for `window.onstorage`.\n // But it's not 100% working, sometimes you still get old value from LocalStorage.\n // Better approch is to explicitly udpate LocalStorage with `setStorage`.\n\n this.enablePostMessage = false;\n switch (msg.type) {\n case EVENT_SET_STORAGE:\n this.tokenManager.getStorage().setStorage(msg.storage);\n break;\n case EVENT_ADDED:\n this.tokenManager.emitAdded(msg.key, msg.token);\n this.tokenManager.setExpireEventTimeout(msg.key, msg.token);\n break;\n case EVENT_REMOVED:\n this.tokenManager.clearExpireEventTimeout(msg.key);\n this.tokenManager.emitRemoved(msg.key, msg.token);\n break;\n case EVENT_RENEWED:\n this.tokenManager.emitRenewed(msg.key, msg.token, msg.oldToken);\n break;\n default:\n break;\n }\n this.enablePostMessage = true;\n }\n} "],"mappings":";;;;;;;;AAaA;;AACA;;AACA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBO,MAAMA,kBAAN,CAAqD;EAO1DC,WAAW,CAACC,YAAD,EAA6BC,OAA8B,GAAG,EAA9D,EAAkE;IAAA,+CAH3D,KAG2D;IAAA,yDAFjD,IAEiD;IAC3E,KAAKD,YAAL,GAAoBA,YAApB;IACA,KAAKC,OAAL,GAAeA,OAAf;IACA,KAAKC,mBAAL,GAA2B,KAAKA,mBAAL,CAAyBC,IAAzB,CAA8B,IAA9B,CAA3B;IACA,KAAKC,qBAAL,GAA6B,KAAKA,qBAAL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B;MAExBY;IAFwB,CAA1B;EAID;EAED;;;EACQ3B,oBAAoB,CAAC4B,GAAD,EAAmB;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA;IAEA,KAAKL,iBAAL,GAAyB,KAAzB;;IACA,QAAQK,GAAG,CAACH,IAAZ;MACE,KAAKV,wBAAL;QACE,KAAKtB,YAAL,CAAkBoC,UAAlB,GAA+BC,UAA/B,CAA0CF,GAAG,CAACD,OAA9C;QACA;;MACF,KAAKf,kBAAL;QACE,KAAKnB,YAAL,CAAkBsC,SAAlB,CAA4BH,GAAG,CAACP,GAAhC,EAAqCO,GAAG,CAACN,KAAzC;QACA,KAAK7B,YAAL,CAAkBuC,qBAAlB,CAAwCJ,GAAG,CAACP,GAA5C,EAAiDO,GAAG,CAACN,KAArD;QACA;;MACF,KAAKT,oBAAL;QACE,KAAKpB,YAAL,CAAkBwC,uBAAlB,CAA0CL,GAAG,CAACP,GAA9C;QACA,KAAK5B,YAAL,CAAkByC,WAAlB,CAA8BN,GAAG,CAACP,GAAlC,EAAuCO,GAAG,CAACN,KAA3C;QACA;;MACF,KAAKR,oBAAL;QACE,KAAKrB,YAAL,CAAkB0C,WAAlB,CAA8BP,GAAG,CAACP,GAAlC,EAAuCO,GAAG,CAACN,KAA3C,EAAkDM,GAAG,CAACF,QAAtD;QACA;;MACF;QACE;IAhBJ;;IAkBA,KAAKH,iBAAL,GAAyB,IAAzB;EACD;;AA/HyD"}
|
package/cjs/services/index.js
CHANGED
|
@@ -27,4 +27,17 @@ _Object$keys(_SyncStorageService).forEach(function (key) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
var _LeaderElectionService = require("./LeaderElectionService");
|
|
32
|
+
|
|
33
|
+
_Object$keys(_LeaderElectionService).forEach(function (key) {
|
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
|
35
|
+
if (key in exports && exports[key] === _LeaderElectionService[key]) return;
|
|
36
|
+
Object.defineProperty(exports, key, {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _LeaderElectionService[key];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
30
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../lib/services/index.ts"],"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\nexport * from './AutoRenewService';\nexport * from './SyncStorageService';\nexport * from './LeaderElectionService';\n"],"mappings":";;;;AAaA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/cjs/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"session.js","names":["sessionExists","sdk","session","get","then","res","status","catch","getSession","withCredentials","refresh","href","user","closeSession","url","getIssuerOrigin","method","refreshSession","setCookieAndRedirect","sessionToken","redirectUrl","window","location","assign","checkAccountSetupComplete","token"],"sources":["../../lib/session.ts"],"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/* global window */\nimport { omit, getLink, toQueryString } from './util';\nimport { get, post, httpRequest } from './http';\n\nfunction sessionExists(sdk) {\n return sdk.session.get()\n .then(function(res) {\n if (res.status === 'ACTIVE') {\n return true;\n }\n return false;\n })\n .catch(function() {\n return false;\n });\n}\n\nfunction getSession(sdk) { \n return get(sdk, '/api/v1/sessions/me', { withCredentials: true })\n .then(function(session) {\n var res = omit(session, '_links');\n\n res.refresh = function() {\n return post(sdk, getLink(session, 'refresh').href, {}, { withCredentials: true });\n };\n\n res.user = function() {\n return get(sdk, getLink(session, 'user').href, { withCredentials: true });\n };\n\n return res;\n })\n .catch(function() {\n // Return INACTIVE status on failure\n return {status: 'INACTIVE'};\n });\n}\n\nfunction closeSession(sdk) {\n return httpRequest(sdk, {\n url: sdk.getIssuerOrigin() + '/api/v1/sessions/me',\n method: 'DELETE',\n withCredentials: true\n });\n}\n\nfunction refreshSession(sdk) {\n return post(sdk, '/api/v1/sessions/me/lifecycle/refresh', {}, { withCredentials: true });\n}\n\nfunction setCookieAndRedirect(sdk, sessionToken, redirectUrl) {\n redirectUrl = redirectUrl || window.location.href;\n window.location.assign(sdk.getIssuerOrigin() + '/login/sessionCookieRedirect' +\n toQueryString({\n checkAccountSetupComplete: true,\n token: sessionToken,\n redirectUrl: redirectUrl\n }));\n}\n\nexport {\n sessionExists,\n getSession,\n closeSession,\n refreshSession,\n setCookieAndRedirect\n};\n"],"mappings":";;;;;;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,OAAOA,GAAG,CAACC,OAAJ,CAAYC,GAAZ,GACJ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