@okta/okta-auth-js 6.9.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +76 -41
- package/cjs/authn/AuthnTransactionImpl.js +44 -0
- package/cjs/authn/AuthnTransactionImpl.js.map +1 -0
- package/cjs/authn/api.js +105 -0
- package/cjs/authn/api.js.map +1 -0
- package/cjs/authn/factory.js +45 -0
- package/cjs/authn/factory.js.map +1 -0
- package/cjs/authn/index.js +41 -0
- package/cjs/authn/index.js.map +1 -0
- package/cjs/authn/mixin.js +82 -0
- package/cjs/authn/mixin.js.map +1 -0
- package/cjs/authn/types.js +2 -0
- package/cjs/authn/types.js.map +1 -0
- package/cjs/authn/util/flattenEmbedded.js +44 -0
- package/cjs/authn/util/flattenEmbedded.js.map +1 -0
- package/cjs/authn/util/link2fn.js +108 -0
- package/cjs/authn/util/link2fn.js.map +1 -0
- package/cjs/authn/util/links2fns.js +47 -0
- package/cjs/authn/util/links2fns.js.map +1 -0
- package/cjs/authn/util/poll.js +136 -0
- package/cjs/authn/util/poll.js.map +1 -0
- package/cjs/authn/util/stateToken.js +32 -0
- package/cjs/authn/util/stateToken.js.map +1 -0
- package/cjs/base/factory.js +47 -0
- package/cjs/base/factory.js.map +1 -0
- package/cjs/base/index.js +41 -0
- package/cjs/base/index.js.map +1 -0
- package/cjs/base/options.js +24 -0
- package/cjs/base/options.js.map +1 -0
- package/cjs/base/types.js +2 -0
- package/cjs/base/types.js.map +1 -0
- package/cjs/browser/browserStorage.js +12 -35
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/browser/fingerprint.js +3 -9
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/clock.js +1 -5
- package/cjs/clock.js.map +1 -1
- package/cjs/constants.js +1 -7
- package/cjs/constants.js.map +1 -1
- package/cjs/core/AuthStateManager.js +225 -0
- package/cjs/core/AuthStateManager.js.map +1 -0
- package/cjs/core/ServiceManager/browser.js +157 -0
- package/cjs/core/ServiceManager/browser.js.map +1 -0
- package/cjs/core/ServiceManager/index.js +15 -0
- package/cjs/core/ServiceManager/index.js.map +1 -0
- package/cjs/core/ServiceManager/node.js +42 -0
- package/cjs/core/ServiceManager/node.js.map +1 -0
- package/cjs/core/factory.js +26 -0
- package/cjs/core/factory.js.map +1 -0
- package/cjs/core/index.js +93 -0
- package/cjs/core/index.js.map +1 -0
- package/cjs/core/mixin.js +78 -0
- package/cjs/core/mixin.js.map +1 -0
- package/cjs/core/options.js +29 -0
- package/cjs/core/options.js.map +1 -0
- package/cjs/core/storage.js +10 -0
- package/cjs/core/storage.js.map +1 -0
- package/cjs/{types → core/types}/AuthState.js +0 -0
- package/cjs/core/types/AuthState.js.map +1 -0
- package/cjs/{types → core/types}/Service.js +0 -0
- package/cjs/core/types/Service.js.map +1 -0
- package/cjs/{types → core/types}/api.js +0 -0
- package/cjs/core/types/api.js.map +1 -0
- package/cjs/core/types/index.js +41 -0
- package/cjs/core/types/index.js.map +1 -0
- package/cjs/crypto/base64.js +1 -7
- package/cjs/crypto/base64.js.map +1 -1
- package/cjs/crypto/index.js +17 -6
- package/cjs/crypto/index.js.map +1 -1
- package/cjs/crypto/node.js +4 -10
- package/cjs/crypto/node.js.map +1 -1
- package/cjs/crypto/oidcHash.js +1 -5
- package/cjs/crypto/oidcHash.js.map +1 -1
- package/cjs/crypto/types.js +2 -0
- package/cjs/crypto/types.js.map +1 -0
- package/cjs/crypto/webcrypto.js +1 -3
- package/cjs/crypto/webcrypto.js.map +1 -1
- package/cjs/errors/AuthApiError.js +1 -1
- package/cjs/errors/AuthApiError.js.map +1 -1
- package/cjs/errors/AuthPollStopError.js +1 -1
- package/cjs/errors/AuthSdkError.js +1 -1
- package/cjs/errors/AuthSdkError.js.map +1 -1
- package/cjs/errors/CustomError.js +1 -5
- package/cjs/errors/CustomError.js.map +1 -1
- package/cjs/errors/OAuthError.js +1 -1
- package/cjs/errors/index.js +23 -1
- package/cjs/errors/index.js.map +1 -1
- package/cjs/errors/types.js +2 -0
- package/cjs/errors/types.js.map +1 -0
- package/cjs/exports/authn.js +55 -0
- package/cjs/exports/authn.js.map +1 -0
- package/cjs/exports/cdn/authn.js +11 -0
- package/cjs/exports/cdn/authn.js.map +1 -0
- package/cjs/exports/cdn/core.js +11 -0
- package/cjs/exports/cdn/core.js.map +1 -0
- package/cjs/exports/cdn/default.js +11 -0
- package/cjs/exports/cdn/default.js.map +1 -0
- package/cjs/exports/cdn/idx.js +11 -0
- package/cjs/exports/cdn/idx.js.map +1 -0
- package/cjs/exports/cdn/myaccount.js +11 -0
- package/cjs/exports/cdn/myaccount.js.map +1 -0
- package/cjs/exports/common.js +141 -0
- package/cjs/exports/common.js.map +1 -0
- package/cjs/exports/core.js +42 -0
- package/cjs/exports/core.js.map +1 -0
- package/cjs/exports/default.js +81 -0
- package/cjs/exports/default.js.map +1 -0
- package/cjs/exports/idx.js +50 -0
- package/cjs/exports/idx.js.map +1 -0
- package/cjs/exports/myaccount.js +54 -0
- package/cjs/exports/myaccount.js.map +1 -0
- package/cjs/fetch/fetchRequest.js +7 -25
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/OktaUserAgent.js +56 -0
- package/cjs/http/OktaUserAgent.js.map +1 -0
- package/cjs/http/headers.js.map +1 -1
- package/cjs/http/index.js +54 -4
- package/cjs/http/index.js.map +1 -1
- package/cjs/http/mixin.js +46 -0
- package/cjs/http/mixin.js.map +1 -0
- package/cjs/http/options.js +36 -0
- package/cjs/http/options.js.map +1 -0
- package/cjs/http/request.js +4 -10
- package/cjs/http/request.js.map +1 -1
- package/cjs/http/types.js +2 -0
- package/cjs/http/types.js.map +1 -0
- package/cjs/idx/IdxTransactionManager.js +85 -0
- package/cjs/idx/IdxTransactionManager.js.map +1 -0
- package/cjs/idx/authenticate.js +1 -1
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/index.js +8 -10
- package/cjs/idx/authenticator/index.js.map +1 -1
- package/cjs/idx/authenticator/util.js +1 -5
- package/cjs/idx/authenticator/util.js.map +1 -1
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/emailVerify.js +1 -1
- package/cjs/idx/emailVerify.js.map +1 -1
- package/cjs/idx/factory/OktaAuthIdx.js +14 -0
- package/cjs/idx/factory/OktaAuthIdx.js.map +1 -0
- package/cjs/idx/factory/api.js +91 -0
- package/cjs/idx/factory/api.js.map +1 -0
- package/cjs/idx/factory/index.js +28 -0
- package/cjs/idx/factory/index.js.map +1 -0
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/index.js +6 -8
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/handleInteractionCodeRedirect.js +1 -5
- package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/cjs/idx/idxState/index.js +3 -5
- package/cjs/idx/idxState/index.js.map +1 -1
- package/cjs/idx/idxState/v1/actionParser.js +2 -6
- package/cjs/idx/idxState/v1/actionParser.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js +5 -10
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +23 -21
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js +4 -10
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/idxState/v1/remediationParser.js +2 -6
- package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
- package/cjs/idx/index.js +85 -3
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +2 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +1 -3
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/mixin.js +28 -0
- package/cjs/idx/mixin.js.map +1 -0
- package/cjs/idx/options.js +32 -0
- package/cjs/idx/options.js.map +1 -0
- package/cjs/idx/poll.js +3 -13
- 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 +4 -10
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +46 -69
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +7 -19
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +6 -56
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +10 -48
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +25 -51
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +10 -48
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +5 -17
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengeAuthenticator.js +2 -2
- package/cjs/idx/remediators/ChallengePoll.js +3 -5
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollAuthenticator.js +2 -2
- package/cjs/idx/remediators/EnrollPoll.js +6 -16
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js +12 -28
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +9 -25
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js +5 -23
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/index.js +1 -3
- package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/util.js +11 -35
- package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -1
- package/cjs/idx/remediators/Identify.js +3 -5
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +3 -5
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/RedirectIdp.js +2 -2
- package/cjs/idx/remediators/ResetAuthenticator.js +2 -2
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +4 -6
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +2 -2
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +5 -9
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollProfile.js +2 -2
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +12 -41
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +3 -5
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +20 -22
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js +3 -13
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +6 -47
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/storage.js +89 -0
- package/cjs/idx/storage.js.map +1 -0
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/api.js +12 -0
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/index.js +28 -4
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/types/meta.js +2 -0
- package/cjs/idx/types/meta.js.map +1 -0
- package/cjs/idx/types/options.js.map +1 -1
- package/cjs/idx/types/storage.js +2 -0
- package/cjs/idx/types/storage.js.map +1 -0
- package/cjs/idx/unlockAccount.js +2 -6
- package/cjs/idx/unlockAccount.js.map +1 -1
- package/cjs/idx/util.js +17 -60
- package/cjs/idx/util.js.map +1 -1
- package/cjs/idx/webauthn.js +101 -0
- package/cjs/idx/webauthn.js.map +1 -0
- package/cjs/myaccount/api.js +3 -5
- package/cjs/myaccount/api.js.map +1 -1
- package/cjs/myaccount/factory.js +14 -0
- package/cjs/myaccount/factory.js.map +1 -0
- package/cjs/myaccount/index.js +28 -4
- package/cjs/myaccount/index.js.map +1 -1
- package/cjs/myaccount/mixin.js +23 -0
- package/cjs/myaccount/mixin.js.map +1 -0
- package/cjs/myaccount/request.js +3 -15
- package/cjs/myaccount/request.js.map +1 -1
- package/cjs/myaccount/transactions/Base.js +1 -5
- package/cjs/myaccount/transactions/Base.js.map +1 -1
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js +1 -1
- package/cjs/myaccount/transactions/EmailStatusTransaction.js +1 -1
- package/cjs/myaccount/transactions/EmailTransaction.js +1 -1
- package/cjs/myaccount/transactions/PhoneTransaction.js +1 -1
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js +1 -1
- package/cjs/myaccount/transactions/ProfileTransaction.js +1 -1
- package/cjs/myaccount/transactions/index.js +1 -1
- package/cjs/myaccount/types.js.map +1 -1
- package/cjs/oidc/TokenManager.js +479 -0
- package/cjs/oidc/TokenManager.js.map +1 -0
- package/cjs/oidc/TransactionManager.js +107 -0
- package/cjs/oidc/TransactionManager.js.map +1 -0
- package/cjs/oidc/decodeToken.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +2 -8
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/endpoints/index.js +3 -5
- package/cjs/oidc/endpoints/index.js.map +1 -1
- package/cjs/oidc/endpoints/token.js +3 -15
- package/cjs/oidc/endpoints/token.js.map +1 -1
- package/cjs/oidc/endpoints/well-known.js +3 -7
- package/cjs/oidc/endpoints/well-known.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js +2 -10
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/oidc/factory/OktaAuthOAuth.js +23 -0
- package/cjs/oidc/factory/OktaAuthOAuth.js.map +1 -0
- package/cjs/oidc/factory/api.js +104 -0
- package/cjs/oidc/factory/api.js.map +1 -0
- package/cjs/oidc/factory/index.js +28 -0
- package/cjs/oidc/factory/index.js.map +1 -0
- package/cjs/oidc/getToken.js +5 -9
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getUserInfo.js +4 -8
- package/cjs/oidc/getUserInfo.js.map +1 -1
- package/cjs/oidc/getWithPopup.js +2 -8
- package/cjs/oidc/getWithPopup.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js +2 -8
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/getWithoutPrompt.js +2 -8
- package/cjs/oidc/getWithoutPrompt.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js +3 -9
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/index.js +100 -4
- package/cjs/oidc/index.js.map +1 -1
- package/cjs/oidc/mixin/browser.js +62 -0
- package/cjs/oidc/mixin/browser.js.map +1 -0
- package/cjs/oidc/mixin/index.js +342 -0
- package/cjs/oidc/mixin/index.js.map +1 -0
- package/cjs/oidc/mixin/node.js +44 -0
- package/cjs/oidc/mixin/node.js.map +1 -0
- package/cjs/oidc/options/OAuthOptionsConstructor.js +120 -0
- package/cjs/oidc/options/OAuthOptionsConstructor.js.map +1 -0
- package/cjs/oidc/options/browser.js +6 -0
- package/cjs/oidc/options/browser.js.map +1 -0
- package/cjs/oidc/options/index.js +15 -0
- package/cjs/oidc/options/index.js.map +1 -0
- package/cjs/oidc/options/node.js +6 -0
- package/cjs/oidc/options/node.js.map +1 -0
- package/cjs/oidc/parseFromUrl.js +8 -11
- package/cjs/oidc/parseFromUrl.js.map +1 -1
- package/cjs/oidc/renewToken.js +1 -1
- package/cjs/oidc/renewToken.js.map +1 -1
- package/cjs/oidc/renewTokens.js +1 -5
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/renewTokensWithRefresh.js +1 -5
- package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
- package/cjs/oidc/revokeToken.js +3 -7
- package/cjs/oidc/revokeToken.js.map +1 -1
- package/cjs/oidc/storage.js +43 -0
- package/cjs/oidc/storage.js.map +1 -0
- package/cjs/{types → oidc/types}/JWT.js +0 -0
- package/cjs/oidc/types/JWT.js.map +1 -0
- package/cjs/{types → oidc/types}/Token.js +0 -0
- package/cjs/oidc/types/Token.js.map +1 -0
- package/cjs/{types → oidc/types}/TokenManager.js +0 -0
- package/cjs/oidc/types/TokenManager.js.map +1 -0
- package/cjs/oidc/types/Transaction.js +68 -0
- package/cjs/oidc/types/Transaction.js.map +1 -0
- package/cjs/oidc/types/TransactionManager.js +2 -0
- package/cjs/oidc/types/TransactionManager.js.map +1 -0
- package/cjs/{types → oidc/types}/UserClaims.js +0 -0
- package/cjs/oidc/types/UserClaims.js.map +1 -0
- package/cjs/oidc/types/api.js +2 -0
- package/cjs/oidc/types/api.js.map +1 -0
- package/cjs/oidc/types/index.js +145 -0
- package/cjs/oidc/types/index.js.map +1 -0
- package/cjs/oidc/types/meta.js +2 -0
- package/cjs/oidc/types/meta.js.map +1 -0
- package/cjs/oidc/types/options.js +2 -0
- package/cjs/oidc/types/options.js.map +1 -0
- package/cjs/oidc/types/proto.js +2 -0
- package/cjs/oidc/types/proto.js.map +1 -0
- package/cjs/oidc/types/storage.js +2 -0
- package/cjs/oidc/types/storage.js.map +1 -0
- package/cjs/oidc/util/browser.js +1 -5
- 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 +12 -14
- package/cjs/oidc/util/index.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +1 -5
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/oauth.js +2 -4
- package/cjs/oidc/util/oauth.js.map +1 -1
- package/cjs/oidc/util/oauthMeta.js.map +1 -1
- package/cjs/oidc/util/pkce.js +3 -11
- package/cjs/oidc/util/pkce.js.map +1 -1
- package/cjs/oidc/util/prepareTokenParams.js +2 -4
- package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
- package/cjs/oidc/util/refreshToken.js.map +1 -1
- package/cjs/oidc/util/sharedStorage.js +54 -0
- package/cjs/oidc/util/sharedStorage.js.map +1 -0
- package/cjs/oidc/util/validateClaims.js +1 -1
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/util/validateToken.js +1 -1
- package/cjs/oidc/util/validateToken.js.map +1 -1
- package/cjs/oidc/verifyToken.js +3 -11
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/server/serverStorage.js +2 -9
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/AutoRenewService.js +3 -3
- package/cjs/services/AutoRenewService.js.map +1 -1
- package/cjs/services/LeaderElectionService.js +3 -5
- package/cjs/services/LeaderElectionService.js.map +1 -1
- package/cjs/services/SyncStorageService.js +26 -18
- package/cjs/services/SyncStorageService.js.map +1 -1
- package/cjs/services/index.js +3 -5
- package/cjs/services/index.js.map +1 -1
- package/cjs/session/api.js +88 -0
- package/cjs/session/api.js.map +1 -0
- package/cjs/session/factory.js +17 -0
- package/cjs/session/factory.js.map +1 -0
- package/cjs/session/index.js +54 -0
- package/cjs/session/index.js.map +1 -0
- package/cjs/session/mixin.js +32 -0
- package/cjs/session/mixin.js.map +1 -0
- package/cjs/session/types.js +2 -0
- package/cjs/session/types.js.map +1 -0
- package/cjs/storage/BaseStorageManager.js +102 -0
- package/cjs/storage/BaseStorageManager.js.map +1 -0
- package/cjs/storage/SavedObject.js +100 -0
- package/cjs/storage/SavedObject.js.map +1 -0
- package/cjs/storage/index.js +67 -0
- package/cjs/storage/index.js.map +1 -0
- package/cjs/storage/mixin.js +22 -0
- package/cjs/storage/mixin.js.map +1 -0
- package/cjs/storage/options/StorageOptionsConstructor.js +36 -0
- package/cjs/storage/options/StorageOptionsConstructor.js.map +1 -0
- package/cjs/storage/options/browser.js +82 -0
- package/cjs/storage/options/browser.js.map +1 -0
- package/cjs/storage/options/node.js +43 -0
- package/cjs/storage/options/node.js.map +1 -0
- package/cjs/storage/types.js +2 -0
- package/cjs/storage/types.js.map +1 -0
- package/cjs/types/global.d.js +2 -0
- package/cjs/types/global.d.js.map +1 -0
- package/cjs/util/PromiseQueue.js +85 -0
- package/cjs/util/PromiseQueue.js.map +1 -0
- package/cjs/util/index.js +15 -17
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/misc.js +2 -8
- package/cjs/util/misc.js.map +1 -1
- package/cjs/util/object.js +6 -16
- package/cjs/util/object.js.map +1 -1
- package/dist/okta-auth-js.authn.min.analyzer.html +38 -0
- package/dist/okta-auth-js.authn.min.js +3 -0
- package/dist/{myaccount.umd.js.LICENSE.txt → okta-auth-js.authn.min.js.LICENSE.txt} +0 -0
- package/dist/okta-auth-js.authn.min.js.map +1 -0
- package/dist/okta-auth-js.core.min.analyzer.html +38 -0
- package/dist/okta-auth-js.core.min.js +3 -0
- package/dist/okta-auth-js.core.min.js.LICENSE.txt +12 -0
- package/dist/okta-auth-js.core.min.js.map +1 -0
- package/dist/okta-auth-js.idx.min.analyzer.html +38 -0
- package/dist/okta-auth-js.idx.min.js +3 -0
- package/dist/okta-auth-js.idx.min.js.LICENSE.txt +12 -0
- package/dist/okta-auth-js.idx.min.js.map +1 -0
- package/dist/okta-auth-js.min.analyzer.html +38 -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.myaccount.min.analyzer.html +38 -0
- package/dist/okta-auth-js.myaccount.min.js +3 -0
- package/dist/okta-auth-js.myaccount.min.js.LICENSE.txt +12 -0
- package/dist/okta-auth-js.myaccount.min.js.map +1 -0
- package/esm/browser/authn/AuthnTransactionImpl.js +33 -0
- package/esm/browser/authn/AuthnTransactionImpl.js.map +1 -0
- package/esm/browser/authn/api.js +79 -0
- package/esm/browser/authn/api.js.map +1 -0
- package/esm/browser/authn/factory.js +37 -0
- package/esm/browser/authn/factory.js.map +1 -0
- package/esm/browser/authn/mixin.js +58 -0
- package/esm/browser/authn/mixin.js.map +1 -0
- package/esm/browser/authn/util/flattenEmbedded.js +44 -0
- package/esm/browser/authn/util/flattenEmbedded.js.map +1 -0
- package/esm/browser/authn/util/link2fn.js +103 -0
- package/esm/browser/authn/util/link2fn.js.map +1 -0
- package/esm/browser/authn/util/links2fns.js +45 -0
- package/esm/browser/authn/util/links2fns.js.map +1 -0
- package/esm/browser/authn/util/poll.js +120 -0
- package/esm/browser/authn/util/poll.js.map +1 -0
- package/esm/browser/authn/util/stateToken.js +26 -0
- package/esm/browser/authn/util/stateToken.js.map +1 -0
- package/esm/browser/base/factory.js +37 -0
- package/esm/browser/base/factory.js.map +1 -0
- package/esm/browser/base/options.js +22 -0
- package/esm/browser/base/options.js.map +1 -0
- package/esm/browser/browser/browserStorage.js +0 -9
- package/esm/browser/browser/browserStorage.js.map +1 -1
- package/esm/browser/browser/fingerprint.js +3 -2
- package/esm/browser/browser/fingerprint.js.map +1 -1
- package/esm/browser/constants.js +1 -4
- package/esm/browser/constants.js.map +1 -1
- package/esm/browser/core/AuthStateManager.js +162 -0
- package/esm/browser/core/AuthStateManager.js.map +1 -0
- package/esm/browser/core/ServiceManager/browser.js +115 -0
- package/esm/browser/core/ServiceManager/browser.js.map +1 -0
- package/esm/browser/core/factory.js +31 -0
- package/esm/browser/core/factory.js.map +1 -0
- package/esm/browser/core/mixin.js +70 -0
- package/esm/browser/core/mixin.js.map +1 -0
- package/esm/browser/core/options.js +30 -0
- package/esm/browser/core/options.js.map +1 -0
- package/esm/browser/core/storage.js +20 -0
- package/esm/browser/core/storage.js.map +1 -0
- package/esm/browser/errors/AuthApiError.js.map +1 -1
- package/esm/browser/errors/AuthSdkError.js.map +1 -1
- package/esm/browser/errors/index.js.map +1 -1
- package/esm/browser/exports/exports/authn.js +106 -0
- package/esm/browser/exports/exports/authn.js.map +1 -0
- package/esm/browser/exports/exports/core.js +102 -0
- package/esm/browser/exports/exports/core.js.map +1 -0
- package/esm/browser/exports/exports/default.js +141 -0
- package/esm/browser/exports/exports/default.js.map +1 -0
- package/esm/browser/exports/exports/idx.js +122 -0
- package/esm/browser/exports/exports/idx.js.map +1 -0
- package/esm/browser/exports/exports/myaccount.js +115 -0
- package/esm/browser/exports/exports/myaccount.js.map +1 -0
- package/esm/browser/fetch/fetchRequest.js.map +1 -1
- package/esm/browser/http/OktaUserAgent.js +39 -0
- package/esm/browser/http/OktaUserAgent.js.map +1 -0
- package/esm/browser/http/headers.js.map +1 -1
- package/esm/browser/http/mixin.js +46 -0
- package/esm/browser/http/mixin.js.map +1 -0
- package/esm/browser/http/options.js +31 -0
- package/esm/browser/http/options.js.map +1 -0
- package/esm/browser/http/request.js.map +1 -1
- package/esm/browser/idx/IdxTransactionManager.js +72 -0
- package/esm/browser/idx/IdxTransactionManager.js.map +1 -0
- package/esm/browser/idx/authenticate.js +0 -1
- package/esm/browser/idx/authenticate.js.map +1 -1
- package/esm/browser/idx/cancel.js.map +1 -1
- package/esm/browser/idx/emailVerify.js.map +1 -1
- package/esm/browser/idx/factory/OktaAuthIdx.js +23 -0
- package/esm/browser/idx/factory/OktaAuthIdx.js.map +1 -0
- package/esm/browser/idx/factory/api.js +73 -0
- package/esm/browser/idx/factory/api.js.map +1 -0
- package/esm/browser/idx/flow/FlowSpecification.js.map +1 -1
- package/esm/browser/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/esm/browser/idx/idxState/index.js.map +1 -1
- package/esm/browser/idx/idxState/v1/generateIdxAction.js +5 -2
- package/esm/browser/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/browser/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/esm/browser/idx/idxState/v1/remediationParser.js.map +1 -1
- package/esm/browser/idx/interact.js +4 -3
- package/esm/browser/idx/interact.js.map +1 -1
- package/esm/browser/idx/introspect.js +4 -3
- package/esm/browser/idx/introspect.js.map +1 -1
- package/esm/browser/idx/mixin.js +29 -0
- package/esm/browser/idx/mixin.js.map +1 -0
- package/esm/browser/idx/options.js +29 -0
- package/esm/browser/idx/options.js.map +1 -0
- package/esm/browser/idx/poll.js.map +1 -1
- package/esm/browser/idx/proceed.js.map +1 -1
- package/esm/browser/idx/recoverPassword.js.map +1 -1
- package/esm/browser/idx/register.js +2 -5
- package/esm/browser/idx/register.js.map +1 -1
- package/esm/browser/idx/remediate.js +24 -36
- package/esm/browser/idx/remediate.js.map +1 -1
- package/esm/browser/idx/remediators/AuthenticatorVerificationData.js +0 -29
- package/esm/browser/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/esm/browser/idx/remediators/Base/AuthenticatorData.js +0 -10
- package/esm/browser/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/esm/browser/idx/remediators/Base/Remediator.js.map +1 -1
- package/esm/browser/idx/remediators/Base/SelectAuthenticator.js +0 -10
- package/esm/browser/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/esm/browser/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/esm/browser/idx/remediators/EnrollPoll.js.map +1 -1
- package/esm/browser/idx/remediators/EnrollProfile.js.map +1 -1
- package/esm/browser/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/esm/browser/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/esm/browser/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/esm/browser/idx/remediators/SelectEnrollmentChannel.js +1 -9
- package/esm/browser/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/esm/browser/idx/run.js +3 -25
- package/esm/browser/idx/run.js.map +1 -1
- package/esm/browser/idx/startTransaction.js.map +1 -1
- package/esm/browser/idx/storage.js +77 -0
- package/esm/browser/idx/storage.js.map +1 -0
- package/esm/browser/idx/transactionMeta.js +3 -2
- package/esm/browser/idx/transactionMeta.js.map +1 -1
- package/esm/browser/idx/types/api.js.map +1 -1
- package/esm/browser/idx/types/idx-js.js +1 -4
- package/esm/browser/idx/types/idx-js.js.map +1 -1
- package/esm/browser/idx/unlockAccount.js +0 -1
- package/esm/browser/idx/unlockAccount.js.map +1 -1
- package/esm/browser/idx/util.js +2 -8
- package/esm/browser/idx/util.js.map +1 -1
- package/esm/browser/idx/webauthn.js +79 -0
- package/esm/browser/idx/webauthn.js.map +1 -0
- package/esm/browser/myaccount/api.js +16 -0
- package/esm/browser/myaccount/api.js.map +1 -0
- package/esm/browser/myaccount/factory.js +23 -0
- package/esm/browser/myaccount/factory.js.map +1 -0
- package/esm/browser/myaccount/mixin.js +30 -0
- package/esm/browser/myaccount/mixin.js.map +1 -0
- package/esm/browser/myaccount/request.js +4 -1
- package/esm/browser/myaccount/request.js.map +1 -1
- package/esm/browser/myaccount/transactions/Base.js.map +1 -1
- package/esm/browser/myaccount/types.js +4 -0
- package/esm/browser/myaccount/types.js.map +1 -1
- package/esm/browser/oidc/TokenManager.js +384 -0
- package/esm/browser/oidc/TokenManager.js.map +1 -0
- package/esm/browser/oidc/TransactionManager.js +76 -0
- package/esm/browser/oidc/TransactionManager.js.map +1 -0
- package/esm/browser/oidc/decodeToken.js.map +1 -1
- package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
- package/esm/browser/oidc/endpoints/token.js +3 -0
- package/esm/browser/oidc/endpoints/token.js.map +1 -1
- package/esm/browser/oidc/endpoints/well-known.js +5 -2
- package/esm/browser/oidc/endpoints/well-known.js.map +1 -1
- package/esm/browser/oidc/exchangeCodeForTokens.js +3 -2
- package/esm/browser/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/browser/oidc/factory/OktaAuthOAuth.js +29 -0
- package/esm/browser/oidc/factory/OktaAuthOAuth.js.map +1 -0
- package/esm/browser/oidc/factory/api.js +89 -0
- package/esm/browser/oidc/factory/api.js.map +1 -0
- package/esm/browser/oidc/getToken.js +0 -2
- package/esm/browser/oidc/getToken.js.map +1 -1
- package/esm/browser/oidc/getUserInfo.js +4 -3
- package/esm/browser/oidc/getUserInfo.js.map +1 -1
- package/esm/browser/oidc/getWithPopup.js +3 -2
- package/esm/browser/oidc/getWithPopup.js.map +1 -1
- package/esm/browser/oidc/getWithRedirect.js +1 -3
- package/esm/browser/oidc/getWithRedirect.js.map +1 -1
- package/esm/browser/oidc/getWithoutPrompt.js.map +1 -1
- package/esm/browser/oidc/handleOAuthResponse.js +3 -2
- package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/browser/oidc/mixin/browser.js +52 -0
- package/esm/browser/oidc/mixin/browser.js.map +1 -0
- package/esm/browser/oidc/mixin/index.js +247 -0
- package/esm/browser/oidc/mixin/index.js.map +1 -0
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js +85 -0
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js.map +1 -0
- package/esm/browser/oidc/options/browser.js +16 -0
- package/esm/browser/oidc/options/browser.js.map +1 -0
- package/esm/browser/oidc/parseFromUrl.js +7 -5
- package/esm/browser/oidc/parseFromUrl.js.map +1 -1
- package/esm/browser/oidc/renewToken.js +1 -3
- package/esm/browser/oidc/renewToken.js.map +1 -1
- package/esm/browser/oidc/renewTokens.js +3 -2
- package/esm/browser/oidc/renewTokens.js.map +1 -1
- package/esm/browser/oidc/renewTokensWithRefresh.js.map +1 -1
- package/esm/browser/oidc/revokeToken.js +6 -3
- package/esm/browser/oidc/revokeToken.js.map +1 -1
- package/esm/browser/oidc/storage.js +49 -0
- package/esm/browser/oidc/storage.js.map +1 -0
- package/esm/browser/{types → oidc/types}/Token.js +0 -0
- package/esm/browser/oidc/types/Token.js.map +1 -0
- package/esm/browser/{types → oidc/types}/TokenManager.js +0 -0
- package/esm/browser/oidc/types/TokenManager.js.map +1 -0
- package/esm/browser/{types → oidc/types}/Transaction.js +0 -0
- package/esm/browser/oidc/types/Transaction.js.map +1 -0
- package/esm/browser/oidc/util/browser.js.map +1 -1
- package/esm/browser/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/browser/oidc/util/errors.js.map +1 -1
- package/esm/browser/oidc/util/loginRedirect.js.map +1 -1
- package/esm/browser/oidc/util/oauth.js.map +1 -1
- package/esm/browser/oidc/util/oauthMeta.js.map +1 -1
- package/esm/browser/oidc/util/prepareTokenParams.js.map +1 -1
- package/esm/browser/oidc/util/refreshToken.js.map +1 -1
- package/esm/browser/oidc/util/sharedStorage.js +54 -0
- package/esm/browser/oidc/util/sharedStorage.js.map +1 -0
- package/esm/browser/oidc/util/validateClaims.js.map +1 -1
- package/esm/browser/oidc/util/validateToken.js +1 -3
- package/esm/browser/oidc/util/validateToken.js.map +1 -1
- package/esm/browser/oidc/verifyToken.js +0 -2
- package/esm/browser/oidc/verifyToken.js.map +1 -1
- package/esm/browser/package.json +5 -0
- package/esm/browser/services/AutoRenewService.js +1 -3
- package/esm/browser/services/AutoRenewService.js.map +1 -1
- package/esm/browser/services/LeaderElectionService.js.map +1 -1
- package/esm/browser/services/SyncStorageService.js +18 -13
- package/esm/browser/services/SyncStorageService.js.map +1 -1
- package/esm/browser/session/api.js +69 -0
- package/esm/browser/session/api.js.map +1 -0
- package/esm/browser/session/factory.js +27 -0
- package/esm/browser/session/factory.js.map +1 -0
- package/esm/browser/session/mixin.js +37 -0
- package/esm/browser/session/mixin.js.map +1 -0
- package/esm/browser/storage/BaseStorageManager.js +69 -0
- package/esm/browser/storage/BaseStorageManager.js.map +1 -0
- package/esm/browser/storage/SavedObject.js +76 -0
- package/esm/browser/storage/SavedObject.js.map +1 -0
- package/esm/browser/storage/mixin.js +26 -0
- package/esm/browser/storage/mixin.js.map +1 -0
- package/esm/browser/storage/options/StorageOptionsConstructor.js +31 -0
- package/esm/browser/storage/options/StorageOptionsConstructor.js.map +1 -0
- package/esm/browser/storage/options/browser.js +76 -0
- package/esm/browser/storage/options/browser.js.map +1 -0
- package/esm/browser/util/PromiseQueue.js +65 -0
- package/esm/browser/util/PromiseQueue.js.map +1 -0
- package/esm/node/authn/AuthnTransactionImpl.js +33 -0
- package/esm/node/authn/AuthnTransactionImpl.js.map +1 -0
- package/esm/node/authn/api.js +80 -0
- package/esm/node/authn/api.js.map +1 -0
- package/esm/node/authn/factory.js +37 -0
- package/esm/node/authn/factory.js.map +1 -0
- package/esm/node/authn/mixin.js +58 -0
- package/esm/node/authn/mixin.js.map +1 -0
- package/esm/node/authn/util/flattenEmbedded.js +44 -0
- package/esm/node/authn/util/flattenEmbedded.js.map +1 -0
- package/esm/node/authn/util/link2fn.js +104 -0
- package/esm/node/authn/util/link2fn.js.map +1 -0
- package/esm/node/authn/util/links2fns.js +45 -0
- package/esm/node/authn/util/links2fns.js.map +1 -0
- package/esm/node/authn/util/poll.js +121 -0
- package/esm/node/authn/util/poll.js.map +1 -0
- package/esm/node/authn/util/stateToken.js +26 -0
- package/esm/node/authn/util/stateToken.js.map +1 -0
- package/esm/node/base/factory.js +37 -0
- package/esm/node/base/factory.js.map +1 -0
- package/esm/node/base/options.js +22 -0
- package/esm/node/base/options.js.map +1 -0
- package/esm/node/browser/fingerprint.js +4 -3
- package/esm/node/browser/fingerprint.js.map +1 -1
- package/esm/node/constants.js +1 -4
- package/esm/node/constants.js.map +1 -1
- package/esm/node/core/AuthStateManager.js +163 -0
- package/esm/node/core/AuthStateManager.js.map +1 -0
- package/esm/node/core/ServiceManager/node.js +34 -0
- package/esm/node/core/ServiceManager/node.js.map +1 -0
- package/esm/node/core/factory.js +31 -0
- package/esm/node/core/factory.js.map +1 -0
- package/esm/node/core/mixin.js +70 -0
- package/esm/node/core/mixin.js.map +1 -0
- package/esm/node/core/options.js +31 -0
- package/esm/node/core/options.js.map +1 -0
- package/esm/node/core/storage.js +20 -0
- package/esm/node/core/storage.js.map +1 -0
- package/esm/node/errors/AuthApiError.js.map +1 -1
- package/esm/node/errors/AuthSdkError.js.map +1 -1
- package/esm/node/errors/index.js.map +1 -1
- package/esm/node/exports/exports/authn.js +106 -0
- package/esm/node/exports/exports/authn.js.map +1 -0
- package/esm/node/exports/exports/core.js +102 -0
- package/esm/node/exports/exports/core.js.map +1 -0
- package/esm/node/exports/exports/default.js +141 -0
- package/esm/node/exports/exports/default.js.map +1 -0
- package/esm/node/exports/exports/idx.js +122 -0
- package/esm/node/exports/exports/idx.js.map +1 -0
- package/esm/node/exports/exports/myaccount.js +115 -0
- package/esm/node/exports/exports/myaccount.js.map +1 -0
- package/esm/node/fetch/fetchRequest.js.map +1 -1
- package/esm/node/http/OktaUserAgent.js +39 -0
- package/esm/node/http/OktaUserAgent.js.map +1 -0
- package/esm/node/http/headers.js.map +1 -1
- package/esm/node/http/mixin.js +46 -0
- package/esm/node/http/mixin.js.map +1 -0
- package/esm/node/http/options.js +32 -0
- package/esm/node/http/options.js.map +1 -0
- package/esm/node/http/request.js.map +1 -1
- package/esm/node/idx/IdxTransactionManager.js +72 -0
- package/esm/node/idx/IdxTransactionManager.js.map +1 -0
- package/esm/node/idx/authenticate.js +0 -1
- package/esm/node/idx/authenticate.js.map +1 -1
- package/esm/node/idx/cancel.js.map +1 -1
- package/esm/node/idx/emailVerify.js.map +1 -1
- package/esm/node/idx/factory/OktaAuthIdx.js +23 -0
- package/esm/node/idx/factory/OktaAuthIdx.js.map +1 -0
- package/esm/node/idx/factory/api.js +74 -0
- package/esm/node/idx/factory/api.js.map +1 -0
- package/esm/node/idx/flow/FlowSpecification.js.map +1 -1
- package/esm/node/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/esm/node/idx/idxState/index.js.map +1 -1
- package/esm/node/idx/idxState/v1/generateIdxAction.js +6 -2
- package/esm/node/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/node/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/esm/node/idx/idxState/v1/remediationParser.js.map +1 -1
- package/esm/node/idx/interact.js +5 -4
- package/esm/node/idx/interact.js.map +1 -1
- package/esm/node/idx/introspect.js +5 -4
- package/esm/node/idx/introspect.js.map +1 -1
- package/esm/node/idx/mixin.js +29 -0
- package/esm/node/idx/mixin.js.map +1 -0
- package/esm/node/idx/options.js +29 -0
- package/esm/node/idx/options.js.map +1 -0
- package/esm/node/idx/poll.js.map +1 -1
- package/esm/node/idx/proceed.js.map +1 -1
- package/esm/node/idx/recoverPassword.js.map +1 -1
- package/esm/node/idx/register.js +2 -5
- package/esm/node/idx/register.js.map +1 -1
- package/esm/node/idx/remediate.js +24 -36
- package/esm/node/idx/remediate.js.map +1 -1
- package/esm/node/idx/remediators/AuthenticatorVerificationData.js +0 -29
- package/esm/node/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/esm/node/idx/remediators/Base/AuthenticatorData.js +0 -10
- package/esm/node/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/esm/node/idx/remediators/Base/Remediator.js.map +1 -1
- package/esm/node/idx/remediators/Base/SelectAuthenticator.js +0 -10
- package/esm/node/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/esm/node/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/esm/node/idx/remediators/EnrollPoll.js.map +1 -1
- package/esm/node/idx/remediators/EnrollProfile.js.map +1 -1
- package/esm/node/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/esm/node/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/esm/node/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/esm/node/idx/remediators/SelectEnrollmentChannel.js +1 -9
- package/esm/node/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/esm/node/idx/run.js +3 -25
- package/esm/node/idx/run.js.map +1 -1
- package/esm/node/idx/startTransaction.js.map +1 -1
- package/esm/node/idx/storage.js +77 -0
- package/esm/node/idx/storage.js.map +1 -0
- package/esm/node/idx/transactionMeta.js +3 -2
- package/esm/node/idx/transactionMeta.js.map +1 -1
- package/esm/node/idx/types/api.js.map +1 -1
- package/esm/node/idx/types/idx-js.js +1 -4
- package/esm/node/idx/types/idx-js.js.map +1 -1
- package/esm/node/idx/unlockAccount.js +0 -1
- package/esm/node/idx/unlockAccount.js.map +1 -1
- package/esm/node/idx/util.js +2 -8
- package/esm/node/idx/util.js.map +1 -1
- package/esm/node/idx/webauthn.js +79 -0
- package/esm/node/idx/webauthn.js.map +1 -0
- package/esm/node/myaccount/api.js +16 -0
- package/esm/node/myaccount/api.js.map +1 -0
- package/esm/node/myaccount/factory.js +23 -0
- package/esm/node/myaccount/factory.js.map +1 -0
- package/esm/node/myaccount/mixin.js +30 -0
- package/esm/node/myaccount/mixin.js.map +1 -0
- package/esm/node/myaccount/request.js +5 -1
- package/esm/node/myaccount/request.js.map +1 -1
- package/esm/node/myaccount/transactions/Base.js.map +1 -1
- package/esm/node/myaccount/types.js +5 -0
- package/esm/node/myaccount/types.js.map +1 -1
- package/esm/node/oidc/TokenManager.js +385 -0
- package/esm/node/oidc/TokenManager.js.map +1 -0
- package/esm/node/oidc/TransactionManager.js +76 -0
- package/esm/node/oidc/TransactionManager.js.map +1 -0
- package/esm/node/oidc/decodeToken.js.map +1 -1
- package/esm/node/oidc/endpoints/authorize.js.map +1 -1
- package/esm/node/oidc/endpoints/token.js +4 -0
- package/esm/node/oidc/endpoints/token.js.map +1 -1
- package/esm/node/oidc/endpoints/well-known.js +6 -2
- package/esm/node/oidc/endpoints/well-known.js.map +1 -1
- package/esm/node/oidc/exchangeCodeForTokens.js +3 -2
- package/esm/node/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/node/oidc/factory/OktaAuthOAuth.js +29 -0
- package/esm/node/oidc/factory/OktaAuthOAuth.js.map +1 -0
- package/esm/node/oidc/factory/api.js +90 -0
- package/esm/node/oidc/factory/api.js.map +1 -0
- package/esm/node/oidc/getToken.js +0 -2
- package/esm/node/oidc/getToken.js.map +1 -1
- package/esm/node/oidc/getUserInfo.js +5 -3
- package/esm/node/oidc/getUserInfo.js.map +1 -1
- package/esm/node/oidc/getWithPopup.js +3 -2
- package/esm/node/oidc/getWithPopup.js.map +1 -1
- package/esm/node/oidc/getWithRedirect.js +1 -3
- package/esm/node/oidc/getWithRedirect.js.map +1 -1
- package/esm/node/oidc/getWithoutPrompt.js.map +1 -1
- package/esm/node/oidc/handleOAuthResponse.js +3 -2
- package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/node/oidc/mixin/index.js +247 -0
- package/esm/node/oidc/mixin/index.js.map +1 -0
- package/esm/node/oidc/mixin/node.js +43 -0
- package/esm/node/oidc/mixin/node.js.map +1 -0
- package/esm/node/oidc/options/OAuthOptionsConstructor.js +85 -0
- package/esm/node/oidc/options/OAuthOptionsConstructor.js.map +1 -0
- package/esm/node/oidc/options/node.js +16 -0
- package/esm/node/oidc/options/node.js.map +1 -0
- package/esm/node/oidc/parseFromUrl.js +7 -5
- package/esm/node/oidc/parseFromUrl.js.map +1 -1
- package/esm/node/oidc/renewToken.js +1 -3
- package/esm/node/oidc/renewToken.js.map +1 -1
- package/esm/node/oidc/renewTokens.js +3 -2
- package/esm/node/oidc/renewTokens.js.map +1 -1
- package/esm/node/oidc/renewTokensWithRefresh.js.map +1 -1
- package/esm/node/oidc/revokeToken.js +6 -3
- package/esm/node/oidc/revokeToken.js.map +1 -1
- package/esm/node/oidc/storage.js +50 -0
- package/esm/node/oidc/storage.js.map +1 -0
- package/esm/node/{types → oidc/types}/Token.js +0 -0
- package/esm/node/oidc/types/Token.js.map +1 -0
- package/esm/node/{types → oidc/types}/TokenManager.js +0 -0
- package/esm/node/oidc/types/TokenManager.js.map +1 -0
- package/esm/node/{types → oidc/types}/Transaction.js +0 -0
- package/esm/node/oidc/types/Transaction.js.map +1 -0
- package/esm/node/oidc/util/browser.js.map +1 -1
- package/esm/node/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/node/oidc/util/errors.js.map +1 -1
- package/esm/node/oidc/util/loginRedirect.js.map +1 -1
- package/esm/node/oidc/util/oauth.js.map +1 -1
- package/esm/node/oidc/util/oauthMeta.js.map +1 -1
- package/esm/node/oidc/util/prepareTokenParams.js.map +1 -1
- package/esm/node/oidc/util/refreshToken.js.map +1 -1
- package/esm/node/oidc/util/sharedStorage.js +54 -0
- package/esm/node/oidc/util/sharedStorage.js.map +1 -0
- package/esm/node/oidc/util/validateClaims.js.map +1 -1
- package/esm/node/oidc/util/validateToken.js +1 -3
- package/esm/node/oidc/util/validateToken.js.map +1 -1
- package/esm/node/oidc/verifyToken.js +0 -2
- package/esm/node/oidc/verifyToken.js.map +1 -1
- package/esm/node/package.json +5 -0
- package/esm/node/server/serverStorage.js +0 -4
- package/esm/node/server/serverStorage.js.map +1 -1
- package/esm/node/session/api.js +70 -0
- package/esm/node/session/api.js.map +1 -0
- package/esm/node/session/factory.js +27 -0
- package/esm/node/session/factory.js.map +1 -0
- package/esm/node/session/mixin.js +37 -0
- package/esm/node/session/mixin.js.map +1 -0
- package/esm/node/storage/BaseStorageManager.js +69 -0
- package/esm/node/storage/BaseStorageManager.js.map +1 -0
- package/esm/node/storage/SavedObject.js +76 -0
- package/esm/node/storage/SavedObject.js.map +1 -0
- package/esm/node/storage/mixin.js +26 -0
- package/esm/node/storage/mixin.js.map +1 -0
- package/esm/node/storage/options/StorageOptionsConstructor.js +31 -0
- package/esm/node/storage/options/StorageOptionsConstructor.js.map +1 -0
- package/esm/node/storage/options/node.js +40 -0
- package/esm/node/storage/options/node.js.map +1 -0
- package/esm/node/util/PromiseQueue.js +65 -0
- package/esm/node/util/PromiseQueue.js.map +1 -0
- package/package.json +71 -28
- package/types/lib/authn/AuthnTransactionImpl.d.ts +41 -0
- package/types/lib/authn/api.d.ts +23 -0
- package/types/lib/authn/factory.d.ts +15 -0
- package/types/lib/authn/index.d.ts +3 -0
- package/types/lib/authn/mixin.d.ts +16 -0
- package/types/lib/authn/types.d.ts +101 -0
- package/types/lib/authn/util/flattenEmbedded.d.ts +3 -0
- package/types/lib/authn/util/link2fn.d.ts +3 -0
- package/types/lib/authn/util/links2fns.d.ts +3 -0
- package/types/lib/authn/util/poll.d.ts +21 -0
- package/types/lib/authn/util/stateToken.d.ts +15 -0
- package/types/lib/base/factory.d.ts +2 -0
- package/types/lib/base/index.d.ts +3 -0
- package/types/lib/base/options.d.ts +16 -0
- package/types/lib/base/types.d.ts +43 -0
- package/types/lib/browser/browserStorage.d.ts +33 -0
- package/types/lib/browser/fingerprint.d.ts +14 -0
- package/{lib → types/lib}/clock.d.ts +0 -0
- package/types/lib/constants.d.ts +30 -0
- package/types/lib/core/AuthStateManager.d.ts +33 -0
- package/types/lib/core/ServiceManager/browser.d.ts +32 -0
- package/{lib/crypto/webcrypto.d.ts → types/lib/core/ServiceManager/index.d.ts} +0 -0
- package/types/lib/core/ServiceManager/node.d.ts +23 -0
- package/types/lib/core/factory.d.ts +5 -0
- package/types/lib/core/index.d.ts +7 -0
- package/types/lib/core/mixin.d.ts +4 -0
- package/types/lib/core/options.d.ts +50 -0
- package/types/lib/core/storage.d.ts +15 -0
- package/types/lib/core/types/AuthState.d.ts +33 -0
- package/types/lib/core/types/Service.d.ts +27 -0
- package/types/lib/core/types/api.d.ts +15 -0
- package/types/lib/core/types/index.d.ts +3 -0
- package/{lib → types/lib}/crypto/base64.d.ts +0 -0
- package/{lib → types/lib}/crypto/browser.d.ts +0 -0
- package/types/lib/crypto/index.d.ts +16 -0
- package/{lib → types/lib}/crypto/node.d.ts +0 -0
- package/{lib → types/lib}/crypto/oidcHash.d.ts +0 -0
- package/types/lib/crypto/types.d.ts +4 -0
- package/{lib → types/lib}/crypto/verifyToken.d.ts +0 -0
- package/types/lib/crypto/webcrypto.d.ts +12 -0
- package/types/lib/errors/AuthApiError.d.ts +24 -0
- package/{lib → types/lib}/errors/AuthPollStopError.d.ts +0 -0
- package/types/lib/errors/AuthSdkError.d.ts +22 -0
- package/{lib → types/lib}/errors/CustomError.d.ts +0 -0
- package/{lib → types/lib}/errors/OAuthError.d.ts +0 -0
- package/types/lib/errors/index.d.ts +19 -0
- package/types/lib/errors/types.d.ts +14 -0
- package/types/lib/exports/authn.d.ts +11 -0
- package/types/lib/exports/cdn/authn.d.ts +2 -0
- package/types/lib/exports/cdn/core.d.ts +2 -0
- package/types/lib/exports/cdn/default.d.ts +2 -0
- package/types/lib/exports/cdn/idx.d.ts +2 -0
- package/types/lib/exports/cdn/myaccount.d.ts +2 -0
- package/types/lib/exports/common.d.ts +11 -0
- package/types/lib/exports/core.d.ts +10 -0
- package/types/lib/exports/default.d.ts +13 -0
- package/types/lib/exports/idx.d.ts +11 -0
- package/types/lib/exports/myaccount.d.ts +11 -0
- package/{lib → types/lib}/features.d.ts +0 -0
- package/types/lib/fetch/fetchRequest.d.ts +14 -0
- package/types/lib/http/OktaUserAgent.d.ts +22 -0
- package/types/lib/http/headers.d.ts +14 -0
- package/types/lib/http/index.d.ts +6 -0
- package/types/lib/http/mixin.d.ts +4 -0
- package/types/lib/http/options.d.ts +25 -0
- package/types/lib/http/request.d.ts +16 -0
- package/types/lib/http/types.d.ts +65 -0
- package/types/lib/idx/IdxTransactionManager.d.ts +18 -0
- package/types/lib/idx/authenticate.d.ts +13 -0
- package/{lib → types/lib}/idx/authenticator/Authenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/OktaPassword.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/OktaVerifyTotp.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/SecurityQuestionEnrollment.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/SecurityQuestionVerification.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/VerificationCodeAuthenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/WebauthnEnrollment.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/WebauthnVerification.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/getAuthenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/index.d.ts +0 -0
- package/{lib → types/lib}/idx/authenticator/util.d.ts +0 -0
- package/types/lib/idx/cancel.d.ts +13 -0
- package/types/lib/idx/emailVerify.d.ts +23 -0
- package/types/lib/idx/factory/OktaAuthIdx.d.ts +9 -0
- package/types/lib/idx/factory/api.d.ts +14 -0
- package/types/lib/idx/factory/index.d.ts +2 -0
- package/{lib → types/lib}/idx/flow/AccountUnlockFlow.d.ts +0 -0
- package/{lib → types/lib}/idx/flow/AuthenticationFlow.d.ts +0 -0
- package/types/lib/idx/flow/FlowSpecification.d.ts +9 -0
- package/{lib → types/lib}/idx/flow/PasswordRecoveryFlow.d.ts +0 -0
- package/{lib → types/lib}/idx/flow/RegistrationFlow.d.ts +0 -0
- package/{lib → types/lib}/idx/flow/RemediationFlow.d.ts +0 -0
- package/{lib → types/lib}/idx/flow/index.d.ts +0 -0
- package/types/lib/idx/handleInteractionCodeRedirect.d.ts +13 -0
- package/types/lib/idx/idxState/index.d.ts +7 -0
- package/{lib → types/lib}/idx/idxState/v1/actionParser.d.ts +0 -0
- package/types/lib/idx/idxState/v1/generateIdxAction.d.ts +15 -0
- package/types/lib/idx/idxState/v1/idxResponseParser.d.ts +21 -0
- package/types/lib/idx/idxState/v1/makeIdxState.d.ts +14 -0
- package/{lib → types/lib}/idx/idxState/v1/parsers.d.ts +0 -0
- package/types/lib/idx/idxState/v1/remediationParser.d.ts +13 -0
- package/types/lib/idx/index.d.ts +30 -0
- package/types/lib/idx/interact.d.ts +26 -0
- package/types/lib/idx/introspect.d.ts +14 -0
- package/types/lib/idx/mixin.d.ts +6 -0
- package/types/lib/idx/options.d.ts +57 -0
- package/types/lib/idx/poll.d.ts +13 -0
- package/types/lib/idx/proceed.d.ts +14 -0
- package/types/lib/idx/recoverPassword.d.ts +13 -0
- package/types/lib/idx/register.d.ts +13 -0
- package/types/lib/idx/remediate.d.ts +20 -0
- package/{lib → types/lib}/idx/remediators/AuthenticatorEnrollmentData.d.ts +0 -0
- package/types/lib/idx/remediators/AuthenticatorVerificationData.d.ts +24 -0
- package/types/lib/idx/remediators/Base/AuthenticatorData.d.ts +26 -0
- package/types/lib/idx/remediators/Base/Remediator.d.ts +42 -0
- package/types/lib/idx/remediators/Base/SelectAuthenticator.d.ts +32 -0
- package/types/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +25 -0
- package/{lib → types/lib}/idx/remediators/ChallengeAuthenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/ChallengePoll.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/EnrollAuthenticator.d.ts +0 -0
- package/types/lib/idx/remediators/EnrollPoll.d.ts +23 -0
- package/types/lib/idx/remediators/EnrollProfile.d.ts +39 -0
- package/types/lib/idx/remediators/EnrollmentChannelData.d.ts +57 -0
- package/types/lib/idx/remediators/GenericRemediator/GenericRemediator.d.ts +8 -0
- package/{lib → types/lib}/idx/remediators/GenericRemediator/index.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/GenericRemediator/util.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/Identify.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/ReEnrollAuthenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/RedirectIdp.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/ResetAuthenticator.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/SelectAuthenticatorEnroll.d.ts +0 -0
- package/types/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +36 -0
- package/{lib → types/lib}/idx/remediators/SelectEnrollProfile.d.ts +0 -0
- package/types/lib/idx/remediators/SelectEnrollmentChannel.d.ts +46 -0
- package/{lib → types/lib}/idx/remediators/Skip.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/index.d.ts +0 -0
- package/{lib → types/lib}/idx/remediators/util.d.ts +0 -0
- package/types/lib/idx/run.d.ts +13 -0
- package/types/lib/idx/startTransaction.d.ts +13 -0
- package/types/lib/idx/storage.d.ts +18 -0
- package/types/lib/idx/transactionMeta.d.ts +21 -0
- package/{lib → types/lib}/idx/types/FlowIdentifier.d.ts +0 -0
- package/types/lib/idx/types/api.d.ts +158 -0
- package/{lib → types/lib}/idx/types/idx-js.d.ts +0 -0
- package/types/lib/idx/types/index.d.ts +19 -0
- package/types/lib/idx/types/meta.d.ts +22 -0
- package/types/lib/idx/types/options.d.ts +67 -0
- package/types/lib/idx/types/storage.d.ts +28 -0
- package/types/lib/idx/unlockAccount.d.ts +13 -0
- package/types/lib/idx/util.d.ts +14 -0
- package/types/lib/idx/webauthn.d.ts +31 -0
- package/{lib → types/lib}/myaccount/api.d.ts +0 -0
- package/{lib → types/lib}/myaccount/emailApi.d.ts +0 -0
- package/types/lib/myaccount/factory.d.ts +6 -0
- package/types/lib/myaccount/index.d.ts +15 -0
- package/types/lib/myaccount/mixin.d.ts +4 -0
- package/{lib → types/lib}/myaccount/phoneApi.d.ts +0 -0
- package/{lib → types/lib}/myaccount/profileApi.d.ts +0 -0
- package/types/lib/myaccount/request.d.ts +29 -0
- package/types/lib/myaccount/transactions/Base.d.ts +15 -0
- package/{lib → types/lib}/myaccount/transactions/EmailChallengeTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/EmailStatusTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/EmailTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/PhoneTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/ProfileSchemaTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/ProfileTransaction.d.ts +0 -0
- package/{lib → types/lib}/myaccount/transactions/index.d.ts +0 -0
- package/types/lib/myaccount/types.d.ts +58 -0
- package/types/lib/oidc/TokenManager.d.ts +53 -0
- package/types/lib/oidc/TransactionManager.d.ts +24 -0
- package/types/lib/oidc/decodeToken.d.ts +2 -0
- package/types/lib/oidc/endpoints/authorize.d.ts +14 -0
- package/{lib → types/lib}/oidc/endpoints/index.d.ts +0 -0
- package/types/lib/oidc/endpoints/token.d.ts +15 -0
- package/types/lib/oidc/endpoints/well-known.d.ts +3 -0
- package/types/lib/oidc/exchangeCodeForTokens.d.ts +14 -0
- package/types/lib/oidc/factory/OktaAuthOAuth.d.ts +4 -0
- package/types/lib/oidc/factory/api.d.ts +15 -0
- package/types/lib/oidc/factory/index.d.ts +2 -0
- package/types/lib/oidc/getToken.d.ts +2 -0
- package/types/lib/oidc/getUserInfo.d.ts +2 -0
- package/types/lib/oidc/getWithPopup.d.ts +2 -0
- package/types/lib/oidc/getWithRedirect.d.ts +2 -0
- package/types/lib/oidc/getWithoutPrompt.d.ts +2 -0
- package/types/lib/oidc/handleOAuthResponse.d.ts +2 -0
- package/types/lib/oidc/index.d.ts +35 -0
- package/types/lib/oidc/mixin/browser.d.ts +17 -0
- package/types/lib/oidc/mixin/index.d.ts +4 -0
- package/types/lib/oidc/mixin/node.d.ts +17 -0
- package/types/lib/oidc/options/OAuthOptionsConstructor.d.ts +48 -0
- package/types/lib/oidc/options/browser.d.ts +1 -0
- package/types/lib/oidc/options/index.d.ts +1 -0
- package/types/lib/oidc/options/node.d.ts +1 -0
- package/types/lib/oidc/parseFromUrl.d.ts +5 -0
- package/types/lib/oidc/renewToken.d.ts +2 -0
- package/types/lib/oidc/renewTokens.d.ts +2 -0
- package/types/lib/oidc/renewTokensWithRefresh.d.ts +2 -0
- package/types/lib/oidc/revokeToken.d.ts +14 -0
- package/types/lib/oidc/storage.d.ts +16 -0
- package/{lib → types/lib/oidc}/types/JWT.d.ts +0 -0
- package/{lib → types/lib/oidc}/types/Token.d.ts +0 -0
- package/types/lib/oidc/types/TokenManager.d.ts +61 -0
- package/types/lib/oidc/types/Transaction.d.ts +29 -0
- package/types/lib/oidc/types/TransactionManager.d.ts +15 -0
- package/{lib → types/lib/oidc}/types/UserClaims.d.ts +0 -0
- package/types/lib/oidc/types/api.d.ts +117 -0
- package/types/lib/oidc/types/index.d.ts +22 -0
- package/types/lib/oidc/types/meta.d.ts +21 -0
- package/types/lib/oidc/types/options.d.ts +77 -0
- package/{lib/types/OAuth.d.ts → types/lib/oidc/types/proto.d.ts} +0 -0
- package/types/lib/oidc/types/storage.d.ts +13 -0
- package/types/lib/oidc/util/browser.d.ts +6 -0
- package/types/lib/oidc/util/defaultTokenParams.d.ts +2 -0
- package/types/lib/oidc/util/errors.d.ts +15 -0
- package/{lib → types/lib}/oidc/util/index.d.ts +0 -0
- package/types/lib/oidc/util/loginRedirect.d.ts +30 -0
- package/types/lib/oidc/util/oauth.d.ts +6 -0
- package/types/lib/oidc/util/oauthMeta.d.ts +2 -0
- package/{lib → types/lib}/oidc/util/pkce.d.ts +0 -0
- package/types/lib/oidc/util/prepareTokenParams.d.ts +6 -0
- package/types/lib/oidc/util/refreshToken.d.ts +3 -0
- package/types/lib/oidc/util/sharedStorage.d.ts +5 -0
- package/{lib → types/lib}/oidc/util/urlParams.d.ts +0 -0
- package/types/lib/oidc/util/validateClaims.d.ts +14 -0
- package/types/lib/oidc/util/validateToken.d.ts +2 -0
- package/types/lib/oidc/verifyToken.d.ts +2 -0
- package/types/lib/server/serverStorage.d.ts +24 -0
- package/types/lib/services/AutoRenewService.d.ts +27 -0
- package/types/lib/services/LeaderElectionService.d.ts +33 -0
- package/types/lib/services/SyncStorageService.d.ts +38 -0
- package/{lib → types/lib}/services/index.d.ts +0 -0
- package/{lib/session.d.ts → types/lib/session/api.d.ts} +0 -0
- package/types/lib/session/factory.d.ts +3 -0
- package/types/lib/session/index.d.ts +4 -0
- package/types/lib/session/mixin.d.ts +5 -0
- package/types/lib/session/types.d.ts +18 -0
- package/types/lib/storage/BaseStorageManager.d.ts +23 -0
- package/types/lib/storage/SavedObject.d.ts +25 -0
- package/types/lib/storage/index.d.ts +5 -0
- package/types/lib/storage/mixin.d.ts +3 -0
- package/types/lib/storage/options/StorageOptionsConstructor.d.ts +20 -0
- package/types/lib/storage/options/browser.d.ts +15 -0
- package/types/lib/storage/options/node.d.ts +15 -0
- package/types/lib/storage/types.d.ts +78 -0
- package/types/lib/util/PromiseQueue.d.ts +30 -0
- package/{lib → types/lib}/util/console.d.ts +0 -0
- package/types/lib/util/index.d.ts +17 -0
- package/{lib → types/lib}/util/misc.d.ts +0 -0
- package/{lib → types/lib}/util/object.d.ts +0 -0
- package/{lib → types/lib}/util/types.d.ts +0 -0
- package/{lib → types/lib}/util/url.d.ts +0 -0
- package/umd/authn.js +3 -0
- package/{dist/okta-auth-js.umd.js.LICENSE.txt → umd/authn.js.LICENSE.txt} +0 -0
- package/umd/authn.js.map +1 -0
- package/umd/core.js +3 -0
- package/umd/core.js.LICENSE.txt +14 -0
- package/umd/core.js.map +1 -0
- package/umd/default.js +3 -0
- package/umd/default.js.LICENSE.txt +14 -0
- package/umd/default.js.map +1 -0
- package/umd/idx.js +3 -0
- package/umd/idx.js.LICENSE.txt +14 -0
- package/umd/idx.js.map +1 -0
- package/umd/myaccount.js +3 -0
- package/umd/myaccount.js.LICENSE.txt +14 -0
- package/umd/myaccount.js.map +1 -0
- package/cjs/AuthStateManager.js +0 -231
- package/cjs/AuthStateManager.js.map +0 -1
- package/cjs/OktaAuth.js +0 -760
- package/cjs/OktaAuth.js.map +0 -1
- package/cjs/OktaUserAgent.js +0 -56
- package/cjs/OktaUserAgent.js.map +0 -1
- package/cjs/PromiseQueue.js +0 -89
- package/cjs/PromiseQueue.js.map +0 -1
- package/cjs/SavedObject.js +0 -112
- package/cjs/SavedObject.js.map +0 -1
- package/cjs/ServiceManager.js +0 -171
- package/cjs/ServiceManager.js.map +0 -1
- package/cjs/StorageManager.js +0 -210
- package/cjs/StorageManager.js.map +0 -1
- package/cjs/TokenManager.js +0 -496
- package/cjs/TokenManager.js.map +0 -1
- package/cjs/TransactionManager.js +0 -373
- package/cjs/TransactionManager.js.map +0 -1
- package/cjs/builderUtil.js +0 -49
- package/cjs/builderUtil.js.map +0 -1
- package/cjs/cdnEntry.js +0 -52
- package/cjs/cdnEntry.js.map +0 -1
- package/cjs/crypto/webauthn.js +0 -101
- package/cjs/crypto/webauthn.js.map +0 -1
- package/cjs/index.js +0 -186
- package/cjs/index.js.map +0 -1
- package/cjs/options/browser.js +0 -86
- package/cjs/options/browser.js.map +0 -1
- package/cjs/options/index.js +0 -105
- package/cjs/options/index.js.map +0 -1
- package/cjs/options/node.js +0 -45
- package/cjs/options/node.js.map +0 -1
- package/cjs/session.js +0 -88
- package/cjs/session.js.map +0 -1
- package/cjs/tx/AuthTransaction.js +0 -234
- package/cjs/tx/AuthTransaction.js.map +0 -1
- package/cjs/tx/TransactionState.js +0 -2
- package/cjs/tx/TransactionState.js.map +0 -1
- package/cjs/tx/api.js +0 -102
- package/cjs/tx/api.js.map +0 -1
- package/cjs/tx/index.js +0 -69
- package/cjs/tx/index.js.map +0 -1
- package/cjs/tx/poll.js +0 -138
- package/cjs/tx/poll.js.map +0 -1
- package/cjs/tx/util.js +0 -36
- package/cjs/tx/util.js.map +0 -1
- package/cjs/types/AuthState.js.map +0 -1
- package/cjs/types/Cookies.js +0 -2
- package/cjs/types/Cookies.js.map +0 -1
- package/cjs/types/EventEmitter.js +0 -2
- package/cjs/types/EventEmitter.js.map +0 -1
- package/cjs/types/JWT.js.map +0 -1
- package/cjs/types/OAuth.js +0 -2
- package/cjs/types/OAuth.js.map +0 -1
- package/cjs/types/OktaAuthOptions.js +0 -2
- package/cjs/types/OktaAuthOptions.js.map +0 -1
- package/cjs/types/Service.js.map +0 -1
- package/cjs/types/Storage.js +0 -2
- package/cjs/types/Storage.js.map +0 -1
- package/cjs/types/Token.js.map +0 -1
- package/cjs/types/TokenManager.js.map +0 -1
- package/cjs/types/Transaction.js +0 -77
- package/cjs/types/Transaction.js.map +0 -1
- package/cjs/types/UserClaims.js.map +0 -1
- package/cjs/types/api.js.map +0 -1
- package/cjs/types/http.js +0 -2
- package/cjs/types/http.js.map +0 -1
- package/cjs/types/index.js +0 -212
- package/cjs/types/index.js.map +0 -1
- package/cjs/util/sharedStorage.js +0 -58
- package/cjs/util/sharedStorage.js.map +0 -1
- package/cjs/util/storage.js +0 -29
- package/cjs/util/storage.js.map +0 -1
- package/dist/myaccount.umd.js +0 -3
- package/dist/myaccount.umd.js.map +0 -1
- package/dist/okta-auth-js.umd.js +0 -3
- package/dist/okta-auth-js.umd.js.map +0 -1
- package/esm/browser/AuthStateManager.js +0 -161
- package/esm/browser/AuthStateManager.js.map +0 -1
- package/esm/browser/OktaAuth.js +0 -557
- package/esm/browser/OktaAuth.js.map +0 -1
- package/esm/browser/OktaUserAgent.js +0 -39
- package/esm/browser/OktaUserAgent.js.map +0 -1
- package/esm/browser/PromiseQueue.js +0 -65
- package/esm/browser/PromiseQueue.js.map +0 -1
- package/esm/browser/SavedObject.js +0 -82
- package/esm/browser/SavedObject.js.map +0 -1
- package/esm/browser/ServiceManager.js +0 -115
- package/esm/browser/ServiceManager.js.map +0 -1
- package/esm/browser/StorageManager.js +0 -148
- package/esm/browser/StorageManager.js.map +0 -1
- package/esm/browser/TokenManager.js +0 -386
- package/esm/browser/TokenManager.js.map +0 -1
- package/esm/browser/TransactionManager.js +0 -244
- package/esm/browser/TransactionManager.js.map +0 -1
- package/esm/browser/builderUtil.js +0 -39
- package/esm/browser/builderUtil.js.map +0 -1
- package/esm/browser/crypto/webauthn.js +0 -79
- package/esm/browser/crypto/webauthn.js.map +0 -1
- package/esm/browser/index.js +0 -92
- package/esm/browser/index.js.map +0 -1
- package/esm/browser/myaccount/myaccount/index.js +0 -24
- package/esm/browser/myaccount/myaccount/index.js.map +0 -1
- package/esm/browser/options/browser.js +0 -77
- package/esm/browser/options/browser.js.map +0 -1
- package/esm/browser/options/index.js +0 -85
- package/esm/browser/options/index.js.map +0 -1
- package/esm/browser/session.js +0 -66
- package/esm/browser/session.js.map +0 -1
- package/esm/browser/tx/AuthTransaction.js +0 -174
- package/esm/browser/tx/AuthTransaction.js.map +0 -1
- package/esm/browser/tx/api.js +0 -72
- package/esm/browser/tx/api.js.map +0 -1
- package/esm/browser/tx/poll.js +0 -117
- package/esm/browser/tx/poll.js.map +0 -1
- package/esm/browser/tx/util.js +0 -26
- package/esm/browser/tx/util.js.map +0 -1
- package/esm/browser/types/Token.js.map +0 -1
- package/esm/browser/types/TokenManager.js.map +0 -1
- package/esm/browser/types/Transaction.js.map +0 -1
- package/esm/browser/util/sharedStorage.js +0 -56
- package/esm/browser/util/sharedStorage.js.map +0 -1
- package/esm/browser/util/storage.js +0 -26
- package/esm/browser/util/storage.js.map +0 -1
- package/esm/node/AuthStateManager.js +0 -161
- package/esm/node/AuthStateManager.js.map +0 -1
- package/esm/node/OktaAuth.js +0 -557
- package/esm/node/OktaAuth.js.map +0 -1
- package/esm/node/OktaUserAgent.js +0 -39
- package/esm/node/OktaUserAgent.js.map +0 -1
- package/esm/node/PromiseQueue.js +0 -65
- package/esm/node/PromiseQueue.js.map +0 -1
- package/esm/node/SavedObject.js +0 -82
- package/esm/node/SavedObject.js.map +0 -1
- package/esm/node/ServiceManager.js +0 -115
- package/esm/node/ServiceManager.js.map +0 -1
- package/esm/node/StorageManager.js +0 -148
- package/esm/node/StorageManager.js.map +0 -1
- package/esm/node/TokenManager.js +0 -387
- package/esm/node/TokenManager.js.map +0 -1
- package/esm/node/TransactionManager.js +0 -244
- package/esm/node/TransactionManager.js.map +0 -1
- package/esm/node/browser/browserStorage.js +0 -216
- package/esm/node/browser/browserStorage.js.map +0 -1
- package/esm/node/builderUtil.js +0 -39
- package/esm/node/builderUtil.js.map +0 -1
- package/esm/node/crypto/webauthn.js +0 -79
- package/esm/node/crypto/webauthn.js.map +0 -1
- package/esm/node/index.js +0 -92
- package/esm/node/index.js.map +0 -1
- package/esm/node/myaccount/myaccount/index.js +0 -24
- package/esm/node/myaccount/myaccount/index.js.map +0 -1
- package/esm/node/options/index.js +0 -85
- package/esm/node/options/index.js.map +0 -1
- package/esm/node/options/node.js +0 -41
- package/esm/node/options/node.js.map +0 -1
- package/esm/node/services/AutoRenewService.js +0 -77
- package/esm/node/services/AutoRenewService.js.map +0 -1
- package/esm/node/services/LeaderElectionService.js +0 -74
- package/esm/node/services/LeaderElectionService.js.map +0 -1
- package/esm/node/services/SyncStorageService.js +0 -130
- package/esm/node/services/SyncStorageService.js.map +0 -1
- package/esm/node/session.js +0 -66
- package/esm/node/session.js.map +0 -1
- package/esm/node/tx/AuthTransaction.js +0 -174
- package/esm/node/tx/AuthTransaction.js.map +0 -1
- package/esm/node/tx/api.js +0 -72
- package/esm/node/tx/api.js.map +0 -1
- package/esm/node/tx/poll.js +0 -117
- package/esm/node/tx/poll.js.map +0 -1
- package/esm/node/tx/util.js +0 -26
- package/esm/node/tx/util.js.map +0 -1
- package/esm/node/types/Token.js.map +0 -1
- package/esm/node/types/TokenManager.js.map +0 -1
- package/esm/node/types/Transaction.js.map +0 -1
- package/esm/node/util/sharedStorage.js +0 -56
- package/esm/node/util/sharedStorage.js.map +0 -1
- package/esm/node/util/storage.js +0 -26
- package/esm/node/util/storage.js.map +0 -1
- package/esm/package.json +0 -5
- package/lib/AuthStateManager.d.ts +0 -33
- package/lib/OktaAuth.d.ts +0 -81
- package/lib/OktaUserAgent.d.ts +0 -22
- package/lib/PromiseQueue.d.ts +0 -30
- package/lib/SavedObject.d.ts +0 -26
- package/lib/ServiceManager.d.ts +0 -32
- package/lib/StorageManager.d.ts +0 -28
- package/lib/TokenManager.d.ts +0 -53
- package/lib/TransactionManager.d.ts +0 -39
- package/lib/browser/browserStorage.d.ts +0 -15
- package/lib/browser/fingerprint.d.ts +0 -13
- package/lib/builderUtil.d.ts +0 -14
- package/lib/cdnEntry.d.ts +0 -18
- package/lib/constants.d.ts +0 -33
- package/lib/crypto/index.d.ts +0 -15
- package/lib/crypto/webauthn.d.ts +0 -25
- package/lib/errors/AuthApiError.d.ts +0 -23
- package/lib/errors/AuthSdkError.d.ts +0 -22
- package/lib/errors/index.d.ts +0 -18
- package/lib/fetch/fetchRequest.d.ts +0 -14
- package/lib/http/headers.d.ts +0 -14
- package/lib/http/index.d.ts +0 -2
- package/lib/http/request.d.ts +0 -16
- package/lib/idx/authenticate.d.ts +0 -13
- package/lib/idx/cancel.d.ts +0 -13
- package/lib/idx/emailVerify.d.ts +0 -26
- package/lib/idx/flow/FlowSpecification.d.ts +0 -9
- package/lib/idx/handleInteractionCodeRedirect.d.ts +0 -13
- package/lib/idx/idxState/index.d.ts +0 -7
- package/lib/idx/idxState/v1/generateIdxAction.d.ts +0 -15
- package/lib/idx/idxState/v1/idxResponseParser.d.ts +0 -21
- package/lib/idx/idxState/v1/makeIdxState.d.ts +0 -14
- package/lib/idx/idxState/v1/remediationParser.d.ts +0 -13
- package/lib/idx/index.d.ts +0 -24
- package/lib/idx/interact.d.ts +0 -26
- package/lib/idx/introspect.d.ts +0 -14
- package/lib/idx/poll.d.ts +0 -13
- package/lib/idx/proceed.d.ts +0 -14
- package/lib/idx/recoverPassword.d.ts +0 -13
- package/lib/idx/register.d.ts +0 -13
- package/lib/idx/remediate.d.ts +0 -21
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +0 -28
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +0 -46
- package/lib/idx/remediators/Base/Remediator.d.ts +0 -43
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +0 -54
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +0 -26
- package/lib/idx/remediators/EnrollPoll.d.ts +0 -23
- package/lib/idx/remediators/EnrollProfile.d.ts +0 -39
- package/lib/idx/remediators/EnrollmentChannelData.d.ts +0 -58
- package/lib/idx/remediators/GenericRemediator/GenericRemediator.d.ts +0 -9
- package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +0 -36
- package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +0 -48
- package/lib/idx/run.d.ts +0 -13
- package/lib/idx/startTransaction.d.ts +0 -13
- package/lib/idx/transactionMeta.d.ts +0 -21
- package/lib/idx/types/api.d.ts +0 -112
- package/lib/idx/types/index.d.ts +0 -18
- package/lib/idx/types/options.d.ts +0 -47
- package/lib/idx/unlockAccount.d.ts +0 -13
- package/lib/idx/util.d.ts +0 -15
- package/lib/index.d.ts +0 -26
- package/lib/myaccount/index.d.ts +0 -13
- package/lib/myaccount/request.d.ts +0 -29
- package/lib/myaccount/transactions/Base.d.ts +0 -15
- package/lib/myaccount/types.d.ts +0 -55
- package/lib/oidc/decodeToken.d.ts +0 -2
- package/lib/oidc/endpoints/authorize.d.ts +0 -14
- package/lib/oidc/endpoints/token.d.ts +0 -14
- package/lib/oidc/endpoints/well-known.d.ts +0 -3
- package/lib/oidc/exchangeCodeForTokens.d.ts +0 -14
- package/lib/oidc/getToken.d.ts +0 -2
- package/lib/oidc/getUserInfo.d.ts +0 -2
- package/lib/oidc/getWithPopup.d.ts +0 -2
- package/lib/oidc/getWithRedirect.d.ts +0 -2
- package/lib/oidc/getWithoutPrompt.d.ts +0 -2
- package/lib/oidc/handleOAuthResponse.d.ts +0 -2
- package/lib/oidc/index.d.ts +0 -28
- package/lib/oidc/parseFromUrl.d.ts +0 -5
- package/lib/oidc/renewToken.d.ts +0 -2
- package/lib/oidc/renewTokens.d.ts +0 -2
- package/lib/oidc/renewTokensWithRefresh.d.ts +0 -2
- package/lib/oidc/revokeToken.d.ts +0 -14
- package/lib/oidc/util/browser.d.ts +0 -6
- package/lib/oidc/util/defaultTokenParams.d.ts +0 -2
- package/lib/oidc/util/errors.d.ts +0 -15
- package/lib/oidc/util/loginRedirect.d.ts +0 -30
- package/lib/oidc/util/oauth.d.ts +0 -6
- package/lib/oidc/util/oauthMeta.d.ts +0 -2
- package/lib/oidc/util/prepareTokenParams.d.ts +0 -5
- package/lib/oidc/util/refreshToken.d.ts +0 -3
- package/lib/oidc/util/validateClaims.d.ts +0 -14
- package/lib/oidc/util/validateToken.d.ts +0 -2
- package/lib/oidc/verifyToken.d.ts +0 -2
- package/lib/options/browser.d.ts +0 -16
- package/lib/options/index.d.ts +0 -14
- package/lib/options/node.d.ts +0 -16
- package/lib/server/serverStorage.d.ts +0 -25
- package/lib/services/AutoRenewService.d.ts +0 -27
- package/lib/services/LeaderElectionService.d.ts +0 -33
- package/lib/services/SyncStorageService.d.ts +0 -38
- package/lib/tx/AuthTransaction.d.ts +0 -58
- package/lib/tx/TransactionState.d.ts +0 -37
- package/lib/tx/api.d.ts +0 -18
- package/lib/tx/index.d.ts +0 -17
- package/lib/tx/poll.d.ts +0 -20
- package/lib/tx/util.d.ts +0 -15
- package/lib/types/AuthState.d.ts +0 -25
- package/lib/types/Cookies.d.ts +0 -26
- package/lib/types/EventEmitter.d.ts +0 -17
- package/lib/types/OktaAuthOptions.d.ts +0 -93
- package/lib/types/Service.d.ts +0 -26
- package/lib/types/Storage.d.ts +0 -95
- package/lib/types/TokenManager.d.ts +0 -39
- package/lib/types/Transaction.d.ts +0 -40
- package/lib/types/api.d.ts +0 -251
- package/lib/types/http.d.ts +0 -47
- package/lib/types/index.d.ts +0 -27
- package/lib/util/index.d.ts +0 -17
- package/lib/util/sharedStorage.d.ts +0 -6
- package/lib/util/storage.d.ts +0 -12
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
|
|
7
|
-
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
8
|
-
|
|
9
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
10
|
-
|
|
11
|
-
var _errors = require("./errors");
|
|
12
|
-
|
|
13
|
-
var _constants = require("./constants");
|
|
14
|
-
|
|
15
|
-
var _types = require("./types");
|
|
16
|
-
|
|
17
|
-
var _idxJs = require("./idx/types/idx-js");
|
|
18
|
-
|
|
19
|
-
var _util = require("./util");
|
|
20
|
-
|
|
21
|
-
var _sharedStorage = require("./util/sharedStorage");
|
|
22
|
-
|
|
23
|
-
/*!
|
|
24
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
25
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
26
|
-
*
|
|
27
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
30
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
-
*
|
|
32
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
33
|
-
*/
|
|
34
|
-
class TransactionManager {
|
|
35
|
-
constructor(options) {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
|
-
this.storageManager = options.storageManager;
|
|
38
|
-
this.legacyWidgetSupport = options.legacyWidgetSupport === false ? false : true;
|
|
39
|
-
this.saveNonceCookie = options.saveNonceCookie === false ? false : true;
|
|
40
|
-
this.saveStateCookie = options.saveStateCookie === false ? false : true;
|
|
41
|
-
this.saveParamsCookie = options.saveParamsCookie === false ? false : true;
|
|
42
|
-
this.enableSharedStorage = options.enableSharedStorage === false ? false : true;
|
|
43
|
-
this.saveLastResponse = options.saveLastResponse === false ? false : true;
|
|
44
|
-
this.options = options;
|
|
45
|
-
} // eslint-disable-next-line complexity
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
clear(options = {}) {
|
|
49
|
-
const transactionStorage = this.storageManager.getTransactionStorage();
|
|
50
|
-
const meta = transactionStorage.getStorage(); // Clear primary storage (by default, sessionStorage on browser)
|
|
51
|
-
|
|
52
|
-
transactionStorage.clearStorage(); // Usually we want to also clear shared storage unless another tab may need it to continue/complete a flow
|
|
53
|
-
|
|
54
|
-
if (this.enableSharedStorage && options.clearSharedStorage !== false) {
|
|
55
|
-
const state = options.state || (meta === null || meta === void 0 ? void 0 : meta.state);
|
|
56
|
-
|
|
57
|
-
if (state) {
|
|
58
|
-
(0, _sharedStorage.clearTransactionFromSharedStorage)(this.storageManager, state);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (options.clearIdxResponse !== false) {
|
|
63
|
-
this.clearIdxResponse();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!this.legacyWidgetSupport) {
|
|
67
|
-
return;
|
|
68
|
-
} // This is for compatibility with older versions of the signin widget. OKTA-304806
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (options.oauth) {
|
|
72
|
-
this.clearLegacyOAuthParams();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (options.pkce) {
|
|
76
|
-
this.clearLegacyPKCE();
|
|
77
|
-
}
|
|
78
|
-
} // eslint-disable-next-line complexity
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
save(meta, options = {}) {
|
|
82
|
-
// There must be only one transaction executing at a time.
|
|
83
|
-
// Before saving, check to see if a transaction is already stored.
|
|
84
|
-
// An existing transaction indicates a concurrency/race/overlap condition
|
|
85
|
-
let storage = this.storageManager.getTransactionStorage();
|
|
86
|
-
const obj = storage.getStorage(); // oie process may need to update transaction in the middle of process for tracking purpose
|
|
87
|
-
// false alarm might be caused
|
|
88
|
-
// TODO: revisit for a better solution, https://oktainc.atlassian.net/browse/OKTA-430919
|
|
89
|
-
|
|
90
|
-
if ((0, _types.isTransactionMeta)(obj) && !options.muteWarning) {
|
|
91
|
-
// eslint-disable-next-line max-len
|
|
92
|
-
(0, _util.warn)('a saved auth transaction exists in storage. This may indicate another auth flow is already in progress.');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
storage.setStorage(meta); // Shared storage allows continuation of transaction in another tab
|
|
96
|
-
|
|
97
|
-
if (this.enableSharedStorage && meta.state) {
|
|
98
|
-
(0, _sharedStorage.saveTransactionToSharedStorage)(this.storageManager, meta.state, meta);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (!options.oauth) {
|
|
102
|
-
return;
|
|
103
|
-
} // Legacy cookie storage
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (this.saveNonceCookie || this.saveStateCookie || this.saveParamsCookie) {
|
|
107
|
-
const cookieStorage = this.storageManager.getStorage({
|
|
108
|
-
storageType: 'cookie'
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
if (this.saveParamsCookie) {
|
|
112
|
-
const {
|
|
113
|
-
responseType,
|
|
114
|
-
state,
|
|
115
|
-
nonce,
|
|
116
|
-
scopes,
|
|
117
|
-
clientId,
|
|
118
|
-
urls,
|
|
119
|
-
ignoreSignature
|
|
120
|
-
} = meta;
|
|
121
|
-
const oauthParams = {
|
|
122
|
-
responseType,
|
|
123
|
-
state,
|
|
124
|
-
nonce,
|
|
125
|
-
scopes,
|
|
126
|
-
clientId,
|
|
127
|
-
urls,
|
|
128
|
-
ignoreSignature
|
|
129
|
-
};
|
|
130
|
-
cookieStorage.setItem(_constants.REDIRECT_OAUTH_PARAMS_NAME, (0, _stringify.default)(oauthParams), null);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (this.saveNonceCookie && meta.nonce) {
|
|
134
|
-
// Set nonce cookie for servers to validate nonce in id_token
|
|
135
|
-
cookieStorage.setItem(_constants.REDIRECT_NONCE_COOKIE_NAME, meta.nonce, null);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (this.saveStateCookie && meta.state) {
|
|
139
|
-
// Set state cookie for servers to validate state
|
|
140
|
-
cookieStorage.setItem(_constants.REDIRECT_STATE_COOKIE_NAME, meta.state, null);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
exists(options = {}) {
|
|
146
|
-
try {
|
|
147
|
-
const meta = this.load(options);
|
|
148
|
-
return !!meta;
|
|
149
|
-
} catch {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
} // load transaction meta from storage
|
|
153
|
-
// eslint-disable-next-line complexity,max-statements
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
load(options = {}) {
|
|
157
|
-
let meta; // If state was passed, try loading transaction data from shared storage
|
|
158
|
-
|
|
159
|
-
if (this.enableSharedStorage && options.state) {
|
|
160
|
-
(0, _sharedStorage.pruneSharedStorage)(this.storageManager); // prune before load
|
|
161
|
-
|
|
162
|
-
meta = (0, _sharedStorage.loadTransactionFromSharedStorage)(this.storageManager, options.state);
|
|
163
|
-
|
|
164
|
-
if ((0, _types.isTransactionMeta)(meta)) {
|
|
165
|
-
return meta;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
let storage = this.storageManager.getTransactionStorage();
|
|
170
|
-
meta = storage.getStorage();
|
|
171
|
-
|
|
172
|
-
if ((0, _types.isTransactionMeta)(meta)) {
|
|
173
|
-
// if we have meta in the new location, there is no need to go further
|
|
174
|
-
return meta;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (!this.legacyWidgetSupport) {
|
|
178
|
-
return null;
|
|
179
|
-
} // This is for compatibility with older versions of the signin widget. OKTA-304806
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (options.oauth) {
|
|
183
|
-
try {
|
|
184
|
-
const oauthParams = this.loadLegacyOAuthParams();
|
|
185
|
-
(0, _assign.default)(meta, oauthParams);
|
|
186
|
-
} finally {
|
|
187
|
-
this.clearLegacyOAuthParams();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (options.pkce) {
|
|
192
|
-
try {
|
|
193
|
-
const pkceMeta = this.loadLegacyPKCE();
|
|
194
|
-
(0, _assign.default)(meta, pkceMeta);
|
|
195
|
-
} finally {
|
|
196
|
-
this.clearLegacyPKCE();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if ((0, _types.isTransactionMeta)(meta)) {
|
|
201
|
-
return meta;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return null;
|
|
205
|
-
} // This is for compatibility with older versions of the signin widget. OKTA-304806
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
clearLegacyPKCE() {
|
|
209
|
-
// clear storages
|
|
210
|
-
let storage;
|
|
211
|
-
|
|
212
|
-
if (this.storageManager.storageUtil.testStorageType('localStorage')) {
|
|
213
|
-
storage = this.storageManager.getLegacyPKCEStorage({
|
|
214
|
-
storageType: 'localStorage'
|
|
215
|
-
});
|
|
216
|
-
storage.clearStorage();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {
|
|
220
|
-
storage = this.storageManager.getLegacyPKCEStorage({
|
|
221
|
-
storageType: 'sessionStorage'
|
|
222
|
-
});
|
|
223
|
-
storage.clearStorage();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
loadLegacyPKCE() {
|
|
228
|
-
let storage;
|
|
229
|
-
let obj; // Try reading from localStorage first.
|
|
230
|
-
|
|
231
|
-
if (this.storageManager.storageUtil.testStorageType('localStorage')) {
|
|
232
|
-
storage = this.storageManager.getLegacyPKCEStorage({
|
|
233
|
-
storageType: 'localStorage'
|
|
234
|
-
});
|
|
235
|
-
obj = storage.getStorage();
|
|
236
|
-
|
|
237
|
-
if (obj && obj.codeVerifier) {
|
|
238
|
-
return obj;
|
|
239
|
-
}
|
|
240
|
-
} // If meta is not valid, read from sessionStorage. This is expected for more recent versions of the widget.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {
|
|
244
|
-
storage = this.storageManager.getLegacyPKCEStorage({
|
|
245
|
-
storageType: 'sessionStorage'
|
|
246
|
-
});
|
|
247
|
-
obj = storage.getStorage();
|
|
248
|
-
|
|
249
|
-
if (obj && obj.codeVerifier) {
|
|
250
|
-
return obj;
|
|
251
|
-
}
|
|
252
|
-
} // If meta is not valid, throw an exception to avoid misleading server-side error
|
|
253
|
-
// The most likely cause of this error is trying to handle a callback twice
|
|
254
|
-
// eslint-disable-next-line max-len
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
throw new _errors.AuthSdkError('Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.', undefined);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
clearLegacyOAuthParams() {
|
|
261
|
-
// clear storages
|
|
262
|
-
let storage;
|
|
263
|
-
|
|
264
|
-
if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {
|
|
265
|
-
storage = this.storageManager.getLegacyOAuthParamsStorage({
|
|
266
|
-
storageType: 'sessionStorage'
|
|
267
|
-
});
|
|
268
|
-
storage.clearStorage();
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (this.storageManager.storageUtil.testStorageType('cookie')) {
|
|
272
|
-
storage = this.storageManager.getLegacyOAuthParamsStorage({
|
|
273
|
-
storageType: 'cookie'
|
|
274
|
-
});
|
|
275
|
-
storage.clearStorage();
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
loadLegacyOAuthParams() {
|
|
280
|
-
let storage;
|
|
281
|
-
let oauthParams; // load first from session storage
|
|
282
|
-
|
|
283
|
-
if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {
|
|
284
|
-
storage = this.storageManager.getLegacyOAuthParamsStorage({
|
|
285
|
-
storageType: 'sessionStorage'
|
|
286
|
-
});
|
|
287
|
-
oauthParams = storage.getStorage();
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if ((0, _types.isOAuthTransactionMeta)(oauthParams)) {
|
|
291
|
-
return oauthParams;
|
|
292
|
-
} // try to load from cookie
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (this.storageManager.storageUtil.testStorageType('cookie')) {
|
|
296
|
-
storage = this.storageManager.getLegacyOAuthParamsStorage({
|
|
297
|
-
storageType: 'cookie'
|
|
298
|
-
});
|
|
299
|
-
oauthParams = storage.getStorage();
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if ((0, _types.isOAuthTransactionMeta)(oauthParams)) {
|
|
303
|
-
return oauthParams;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
throw new _errors.AuthSdkError('Unable to retrieve OAuth redirect params from storage'); // Something is there but we don't recognize it
|
|
307
|
-
// throw new AuthSdkError('Unable to parse the ' + REDIRECT_OAUTH_PARAMS_NAME + ' value from storage');
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
saveIdxResponse(data) {
|
|
311
|
-
if (!this.saveLastResponse) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const storage = this.storageManager.getIdxResponseStorage();
|
|
316
|
-
|
|
317
|
-
if (!storage) {
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
storage.setStorage(data);
|
|
322
|
-
} // eslint-disable-next-line complexity
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
loadIdxResponse(options) {
|
|
326
|
-
if (!this.saveLastResponse) {
|
|
327
|
-
return null;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
const storage = this.storageManager.getIdxResponseStorage();
|
|
331
|
-
|
|
332
|
-
if (!storage) {
|
|
333
|
-
return null;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const storedValue = storage.getStorage();
|
|
337
|
-
|
|
338
|
-
if (!storedValue || !(0, _idxJs.isRawIdxResponse)(storedValue.rawIdxResponse)) {
|
|
339
|
-
return null;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (options) {
|
|
343
|
-
const {
|
|
344
|
-
stateHandle,
|
|
345
|
-
interactionHandle
|
|
346
|
-
} = options;
|
|
347
|
-
|
|
348
|
-
if (stateHandle && storedValue.stateHandle !== stateHandle) {
|
|
349
|
-
return null;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if (interactionHandle && storedValue.interactionHandle !== interactionHandle) {
|
|
353
|
-
return null;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return storedValue;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
clearIdxResponse() {
|
|
361
|
-
if (!this.saveLastResponse) {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
const storage = this.storageManager.getIdxResponseStorage();
|
|
366
|
-
storage === null || storage === void 0 ? void 0 : storage.clearStorage();
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
exports.default = TransactionManager;
|
|
372
|
-
module.exports = exports.default;
|
|
373
|
-
//# sourceMappingURL=TransactionManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionManager.js","names":["TransactionManager","constructor","options","storageManager","legacyWidgetSupport","saveNonceCookie","saveStateCookie","saveParamsCookie","enableSharedStorage","saveLastResponse","clear","transactionStorage","getTransactionStorage","meta","getStorage","clearStorage","clearSharedStorage","state","clearTransactionFromSharedStorage","clearIdxResponse","oauth","clearLegacyOAuthParams","pkce","clearLegacyPKCE","save","storage","obj","isTransactionMeta","muteWarning","warn","setStorage","saveTransactionToSharedStorage","cookieStorage","storageType","responseType","nonce","scopes","clientId","urls","ignoreSignature","oauthParams","setItem","REDIRECT_OAUTH_PARAMS_NAME","REDIRECT_NONCE_COOKIE_NAME","REDIRECT_STATE_COOKIE_NAME","exists","load","pruneSharedStorage","loadTransactionFromSharedStorage","loadLegacyOAuthParams","pkceMeta","loadLegacyPKCE","storageUtil","testStorageType","getLegacyPKCEStorage","codeVerifier","AuthSdkError","undefined","getLegacyOAuthParamsStorage","isOAuthTransactionMeta","saveIdxResponse","data","getIdxResponseStorage","loadIdxResponse","storedValue","isRawIdxResponse","rawIdxResponse","stateHandle","interactionHandle"],"sources":["../../lib/TransactionManager.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 { AuthSdkError } from './errors';\nimport { REDIRECT_NONCE_COOKIE_NAME, REDIRECT_OAUTH_PARAMS_NAME, REDIRECT_STATE_COOKIE_NAME } from './constants';\nimport { StorageManager } from './StorageManager';\nimport {\n StorageProvider,\n TransactionMeta,\n isTransactionMeta,\n isOAuthTransactionMeta,\n PKCETransactionMeta,\n OAuthTransactionMeta,\n TransactionMetaOptions,\n TransactionManagerOptions,\n CookieStorage,\n SavedIdxResponse,\n IntrospectOptions\n} from './types';\nimport { isRawIdxResponse } from './idx/types/idx-js';\nimport { warn } from './util';\nimport {\n clearTransactionFromSharedStorage,\n loadTransactionFromSharedStorage,\n pruneSharedStorage,\n saveTransactionToSharedStorage\n} from './util/sharedStorage';\n\nexport interface ClearTransactionMetaOptions extends TransactionMetaOptions {\n clearSharedStorage?: boolean; // true by default\n clearIdxResponse?: boolean; // true by default\n}\nexport default class TransactionManager {\n options: TransactionManagerOptions;\n storageManager: StorageManager;\n legacyWidgetSupport: boolean;\n saveNonceCookie: boolean;\n saveStateCookie: boolean;\n saveParamsCookie: boolean;\n enableSharedStorage: boolean;\n saveLastResponse: boolean;\n\n constructor(options: TransactionManagerOptions) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.storageManager = options.storageManager!;\n this.legacyWidgetSupport = options.legacyWidgetSupport === false ? false : true;\n this.saveNonceCookie = options.saveNonceCookie === false ? false : true;\n this.saveStateCookie = options.saveStateCookie === false ? false : true;\n this.saveParamsCookie = options.saveParamsCookie === false ? false : true;\n this.enableSharedStorage = options.enableSharedStorage === false ? false : true;\n this.saveLastResponse = options.saveLastResponse === false ? false : true;\n this.options = options;\n }\n\n // eslint-disable-next-line complexity\n clear(options: ClearTransactionMetaOptions = {}) {\n const transactionStorage: StorageProvider = this.storageManager.getTransactionStorage();\n const meta = transactionStorage.getStorage();\n\n // Clear primary storage (by default, sessionStorage on browser)\n transactionStorage.clearStorage();\n\n // Usually we want to also clear shared storage unless another tab may need it to continue/complete a flow\n if (this.enableSharedStorage && options.clearSharedStorage !== false) {\n const state = options.state || meta?.state;\n if (state) {\n clearTransactionFromSharedStorage(this.storageManager, state);\n }\n }\n\n if (options.clearIdxResponse !== false) {\n this.clearIdxResponse();\n }\n \n if (!this.legacyWidgetSupport) {\n return;\n }\n\n // This is for compatibility with older versions of the signin widget. OKTA-304806\n if (options.oauth) {\n this.clearLegacyOAuthParams();\n }\n\n if (options.pkce) {\n this.clearLegacyPKCE();\n }\n }\n\n // eslint-disable-next-line complexity\n save(meta: TransactionMeta, options: TransactionMetaOptions = {}) {\n // There must be only one transaction executing at a time.\n // Before saving, check to see if a transaction is already stored.\n // An existing transaction indicates a concurrency/race/overlap condition\n\n let storage: StorageProvider = this.storageManager.getTransactionStorage();\n const obj = storage.getStorage();\n // oie process may need to update transaction in the middle of process for tracking purpose\n // false alarm might be caused \n // TODO: revisit for a better solution, https://oktainc.atlassian.net/browse/OKTA-430919\n if (isTransactionMeta(obj) && !options.muteWarning) {\n // eslint-disable-next-line max-len\n warn('a saved auth transaction exists in storage. This may indicate another auth flow is already in progress.');\n }\n\n storage.setStorage(meta);\n\n // Shared storage allows continuation of transaction in another tab\n if (this.enableSharedStorage && meta.state) {\n saveTransactionToSharedStorage(this.storageManager, meta.state, meta);\n }\n\n if (!options.oauth) {\n return;\n }\n \n // Legacy cookie storage\n if (this.saveNonceCookie || this.saveStateCookie || this.saveParamsCookie) {\n const cookieStorage: CookieStorage = this.storageManager.getStorage({ storageType: 'cookie' }) as CookieStorage;\n\n if (this.saveParamsCookie) {\n const { \n responseType,\n state,\n nonce,\n scopes,\n clientId,\n urls,\n ignoreSignature\n } = meta;\n const oauthParams = {\n responseType,\n state,\n nonce,\n scopes,\n clientId,\n urls,\n ignoreSignature\n };\n cookieStorage.setItem(REDIRECT_OAUTH_PARAMS_NAME, JSON.stringify(oauthParams), null);\n }\n\n if (this.saveNonceCookie && meta.nonce) {\n // Set nonce cookie for servers to validate nonce in id_token\n cookieStorage.setItem(REDIRECT_NONCE_COOKIE_NAME, meta.nonce, null);\n }\n\n if (this.saveStateCookie && meta.state) {\n // Set state cookie for servers to validate state\n cookieStorage.setItem(REDIRECT_STATE_COOKIE_NAME, meta.state, null);\n }\n }\n }\n\n exists(options: TransactionMetaOptions = {}): boolean {\n try {\n const meta = this.load(options);\n return !!meta;\n } catch {\n return false;\n }\n }\n\n // load transaction meta from storage\n // eslint-disable-next-line complexity,max-statements\n load(options: TransactionMetaOptions = {}): TransactionMeta | null {\n\n let meta: TransactionMeta;\n\n // If state was passed, try loading transaction data from shared storage\n if (this.enableSharedStorage && options.state) {\n pruneSharedStorage(this.storageManager); // prune before load\n meta = loadTransactionFromSharedStorage(this.storageManager, options.state);\n if (isTransactionMeta(meta)) {\n return meta;\n }\n }\n\n let storage: StorageProvider = this.storageManager.getTransactionStorage();\n meta = storage.getStorage();\n if (isTransactionMeta(meta)) {\n // if we have meta in the new location, there is no need to go further\n return meta;\n }\n\n if (!this.legacyWidgetSupport) {\n return null;\n }\n\n // This is for compatibility with older versions of the signin widget. OKTA-304806\n if (options.oauth) {\n try {\n const oauthParams = this.loadLegacyOAuthParams();\n Object.assign(meta, oauthParams);\n } finally {\n this.clearLegacyOAuthParams();\n }\n }\n\n if (options.pkce) {\n try {\n const pkceMeta: PKCETransactionMeta = this.loadLegacyPKCE();\n Object.assign(meta, pkceMeta);\n } finally {\n this.clearLegacyPKCE();\n }\n }\n\n if (isTransactionMeta(meta)) {\n return meta;\n }\n return null;\n }\n\n // This is for compatibility with older versions of the signin widget. OKTA-304806\n clearLegacyPKCE(): void {\n // clear storages\n let storage: StorageProvider;\n\n if (this.storageManager.storageUtil.testStorageType('localStorage')) {\n storage = this.storageManager.getLegacyPKCEStorage({ storageType: 'localStorage' });\n storage.clearStorage();\n }\n\n if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {\n storage = this.storageManager.getLegacyPKCEStorage({ storageType: 'sessionStorage' });\n storage.clearStorage();\n }\n }\n\n loadLegacyPKCE(): PKCETransactionMeta {\n let storage: StorageProvider;\n let obj;\n \n // Try reading from localStorage first.\n if (this.storageManager.storageUtil.testStorageType('localStorage')) {\n storage = this.storageManager.getLegacyPKCEStorage({ storageType: 'localStorage' });\n obj = storage.getStorage();\n if (obj && obj.codeVerifier) {\n return obj;\n }\n }\n\n // If meta is not valid, read from sessionStorage. This is expected for more recent versions of the widget.\n if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {\n storage = this.storageManager.getLegacyPKCEStorage({ storageType: 'sessionStorage' });\n obj = storage.getStorage();\n if (obj && obj.codeVerifier) {\n return obj;\n }\n }\n \n // If meta is not valid, throw an exception to avoid misleading server-side error\n // The most likely cause of this error is trying to handle a callback twice\n // eslint-disable-next-line max-len\n throw new AuthSdkError('Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.', undefined);\n }\n\n clearLegacyOAuthParams(): void {\n // clear storages\n let storage: StorageProvider;\n\n if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {\n storage = this.storageManager.getLegacyOAuthParamsStorage({ storageType: 'sessionStorage' });\n storage.clearStorage();\n }\n\n if (this.storageManager.storageUtil.testStorageType('cookie')) {\n storage = this.storageManager.getLegacyOAuthParamsStorage({ storageType: 'cookie' });\n storage.clearStorage();\n }\n }\n\n loadLegacyOAuthParams(): OAuthTransactionMeta {\n let storage: StorageProvider;\n let oauthParams;\n \n // load first from session storage\n if (this.storageManager.storageUtil.testStorageType('sessionStorage')) {\n storage = this.storageManager.getLegacyOAuthParamsStorage({ storageType: 'sessionStorage' });\n oauthParams = storage.getStorage();\n }\n if (isOAuthTransactionMeta(oauthParams)) {\n return oauthParams;\n }\n\n // try to load from cookie\n if (this.storageManager.storageUtil.testStorageType('cookie')) {\n storage = this.storageManager.getLegacyOAuthParamsStorage({ storageType: 'cookie' });\n oauthParams = storage.getStorage();\n }\n\n if (isOAuthTransactionMeta(oauthParams)) {\n return oauthParams;\n }\n\n\n throw new AuthSdkError('Unable to retrieve OAuth redirect params from storage');\n\n // Something is there but we don't recognize it\n // throw new AuthSdkError('Unable to parse the ' + REDIRECT_OAUTH_PARAMS_NAME + ' value from storage');\n }\n\n saveIdxResponse(data: SavedIdxResponse): void {\n if (!this.saveLastResponse) {\n return;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n if (!storage) {\n return;\n }\n storage.setStorage(data);\n }\n\n // eslint-disable-next-line complexity\n loadIdxResponse(options?: IntrospectOptions): SavedIdxResponse | null {\n if (!this.saveLastResponse) {\n return null;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n if (!storage) {\n return null;\n }\n const storedValue = storage.getStorage();\n if (!storedValue || !isRawIdxResponse(storedValue.rawIdxResponse)) {\n return null;\n }\n\n if (options) {\n const { stateHandle, interactionHandle } = options;\n if (stateHandle && storedValue.stateHandle !== stateHandle) {\n return null;\n }\n if (interactionHandle && storedValue.interactionHandle !== interactionHandle) {\n return null;\n }\n }\n\n return storedValue;\n }\n\n clearIdxResponse(): void {\n if (!this.saveLastResponse) {\n return;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n storage?.clearStorage();\n }\n}"],"mappings":";;;;;;;;;;AAaA;;AACA;;AAEA;;AAaA;;AACA;;AACA;;AA/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgCe,MAAMA,kBAAN,CAAyB;EAUtCC,WAAW,CAACC,OAAD,EAAqC;IAC9C;IACA,KAAKC,cAAL,GAAsBD,OAAO,CAACC,cAA9B;IACA,KAAKC,mBAAL,GAA2BF,OAAO,CAACE,mBAAR,KAAgC,KAAhC,GAAwC,KAAxC,GAAgD,IAA3E;IACA,KAAKC,eAAL,GAAuBH,OAAO,CAACG,eAAR,KAA4B,KAA5B,GAAoC,KAApC,GAA4C,IAAnE;IACA,KAAKC,eAAL,GA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OAA3C;;MACA,IAAIiE,WAAW,IAAIH,WAAW,CAACG,WAAZ,KAA4BA,WAA/C,EAA4D;QAC1D,OAAO,IAAP;MACD;;MACD,IAAIC,iBAAiB,IAAIJ,WAAW,CAACI,iBAAZ,KAAkCA,iBAA3D,EAA8E;QAC5E,OAAO,IAAP;MACD;IACF;;IAED,OAAOJ,WAAP;EACD;;EAED7C,gBAAgB,GAAS;IACvB,IAAI,CAAC,KAAKV,gBAAV,EAA4B;MAC1B;IACD;;IACD,MAAMgB,OAAO,GAAG,KAAKtB,cAAL,CAAoB2D,qBAApB,EAAhB;IACArC,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEV,YAAT;EACD;;AA1TqC"}
|
package/cjs/builderUtil.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.assertValidConfig = assertValidConfig;
|
|
6
|
-
|
|
7
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
8
|
-
|
|
9
|
-
var _AuthSdkError = _interopRequireDefault(require("./errors/AuthSdkError"));
|
|
10
|
-
|
|
11
|
-
/*!
|
|
12
|
-
* Copyright (c) 2018-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
14
|
-
*
|
|
15
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
18
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
*
|
|
20
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
// TODO: use @okta/configuration-validation (move module to this monorepo?)
|
|
23
|
-
// eslint-disable-next-line complexity
|
|
24
|
-
function assertValidConfig(args) {
|
|
25
|
-
args = args || {};
|
|
26
|
-
var scopes = args.scopes;
|
|
27
|
-
|
|
28
|
-
if (scopes && !Array.isArray(scopes)) {
|
|
29
|
-
throw new _AuthSdkError.default('scopes must be a array of strings. ' + 'Required usage: new OktaAuth({scopes: ["openid", "email"]})');
|
|
30
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var issuer = args.issuer;
|
|
34
|
-
|
|
35
|
-
if (!issuer) {
|
|
36
|
-
throw new _AuthSdkError.default('No issuer passed to constructor. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var isUrlRegex = new RegExp('^http?s?://.+');
|
|
40
|
-
|
|
41
|
-
if (!isUrlRegex.test(issuer)) {
|
|
42
|
-
throw new _AuthSdkError.default('Issuer must be a valid URL. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if ((0, _indexOf.default)(issuer).call(issuer, '-admin.') !== -1) {
|
|
46
|
-
throw new _AuthSdkError.default('Issuer URL passed to constructor contains "-admin" in subdomain. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com})');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=builderUtil.js.map
|
package/cjs/builderUtil.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builderUtil.js","names":["assertValidConfig","args","scopes","Array","isArray","AuthSdkError","issuer","isUrlRegex","RegExp","test"],"sources":["../../lib/builderUtil.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\nimport AuthSdkError from './errors/AuthSdkError';\nimport { OktaAuthOptions } from './types';\n\n// TODO: use @okta/configuration-validation (move module to this monorepo?)\n// eslint-disable-next-line complexity\nfunction assertValidConfig(args: OktaAuthOptions) {\n args = args || {};\n\n var scopes = args.scopes;\n if (scopes && !Array.isArray(scopes)) {\n throw new AuthSdkError('scopes must be a array of strings. ' +\n 'Required usage: new OktaAuth({scopes: [\"openid\", \"email\"]})');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var issuer = args.issuer!;\n if (!issuer) {\n throw new AuthSdkError('No issuer passed to constructor. ' + \n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})');\n }\n\n var isUrlRegex = new RegExp('^http?s?://.+');\n if (!isUrlRegex.test(issuer)) {\n throw new AuthSdkError('Issuer must be a valid URL. ' + \n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})');\n }\n\n if (issuer.indexOf('-admin.') !== -1) {\n throw new AuthSdkError('Issuer URL passed to constructor contains \"-admin\" in subdomain. ' +\n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com})');\n }\n}\n\nexport {\n assertValidConfig\n};\n"],"mappings":";;;;;;;;AAYA;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA,SAASA,iBAAT,CAA2BC,IAA3B,EAAkD;EAChDA,IAAI,GAAGA,IAAI,IAAI,EAAf;EAEA,IAAIC,MAAM,GAAGD,IAAI,CAACC,MAAlB;;EACA,IAAIA,MAAM,IAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAf,EAAsC;IACpC,MAAM,IAAIG,qBAAJ,CAAiB,wCACrB,6DADI,CAAN;EAED,CAP+C,CAShD;;;EACA,IAAIC,MAAM,GAAGL,IAAI,CAACK,MAAlB;;EACA,IAAI,CAACA,MAAL,EAAa;IACX,MAAM,IAAID,qBAAJ,CAAiB,sCACrB,8FADI,CAAN;EAED;;EAED,IAAIE,UAAU,GAAG,IAAIC,MAAJ,CAAW,eAAX,CAAjB;;EACA,IAAI,CAACD,UAAU,CAACE,IAAX,CAAgBH,MAAhB,CAAL,EAA8B;IAC5B,MAAM,IAAID,qBAAJ,CAAiB,iCACrB,8FADI,CAAN;EAED;;EAED,IAAI,sBAAAC,MAAM,MAAN,CAAAA,MAAM,EAAS,SAAT,CAAN,KAA8B,CAAC,CAAnC,EAAsC;IACpC,MAAM,IAAID,qBAAJ,CAAiB,sEACrB,uEADI,CAAN;EAED;AACF"}
|
package/cjs/cdnEntry.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
4
|
-
|
|
5
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
6
|
-
|
|
7
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
|
-
exports.default = void 0;
|
|
10
|
-
|
|
11
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
12
|
-
|
|
13
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
14
|
-
|
|
15
|
-
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
16
|
-
|
|
17
|
-
var _OktaAuth = _interopRequireDefault(require("./OktaAuth"));
|
|
18
|
-
|
|
19
|
-
var MyAccountMethods = _interopRequireWildcard(require("./myaccount/api"));
|
|
20
|
-
|
|
21
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
-
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
|
-
|
|
25
|
-
/*!
|
|
26
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
27
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
28
|
-
*
|
|
29
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
30
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
32
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
-
*
|
|
34
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
35
|
-
*/
|
|
36
|
-
class OktaAuthCDN extends _OktaAuth.default {
|
|
37
|
-
constructor(args) {
|
|
38
|
-
var _context, _context2;
|
|
39
|
-
|
|
40
|
-
super(args);
|
|
41
|
-
this.myaccount = (0, _reduce.default)(_context = (0, _filter.default)(_context2 = (0, _entries.default)(MyAccountMethods)).call(_context2, ([name]) => name !== 'default')).call(_context, (acc, [name, fn]) => {
|
|
42
|
-
acc[name] = fn.bind(null, this);
|
|
43
|
-
return acc;
|
|
44
|
-
}, {});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var _default = OktaAuthCDN;
|
|
50
|
-
exports.default = _default;
|
|
51
|
-
module.exports = exports.default;
|
|
52
|
-
//# sourceMappingURL=cdnEntry.js.map
|
package/cjs/cdnEntry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cdnEntry.js","names":["OktaAuthCDN","OktaAuth","constructor","args","myaccount","MyAccountMethods","name","acc","fn","bind"],"sources":["../../lib/cdnEntry.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 OktaAuth from './OktaAuth';\nimport * as MyAccountMethods from './myaccount/api';\nimport { OktaAuthOptions } from './types';\n\nclass OktaAuthCDN extends OktaAuth {\n myaccount;\n\n constructor(args: OktaAuthOptions) {\n super(args);\n\n this.myaccount = Object.entries(MyAccountMethods)\n .filter(([ name ]) => name !== 'default')\n .reduce((acc, [name, fn]) => {\n acc[name] = (fn as any).bind(null, this);\n return acc;\n }, {});\n }\n}\n\nexport default OktaAuthCDN;\n"],"mappings":";;;;;;;;;;;;;;;;AAaA;;AACA;;;;;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,MAAMA,WAAN,SAA0BC,iBAA1B,CAAmC;EAGjCC,WAAW,CAACC,IAAD,EAAwB;IAAA;;IACjC,MAAMA,IAAN;IAEA,KAAKC,SAAL,GAAiB,uFAAeC,gBAAf,mBACP,CAAC,CAAEC,IAAF,CAAD,KAAcA,IAAI,KAAK,SADhB,kBAEP,CAACC,GAAD,EAAM,CAACD,IAAD,EAAOE,EAAP,CAAN,KAAqB;MAC3BD,GAAG,CAACD,IAAD,CAAH,GAAaE,EAAD,CAAYC,IAAZ,CAAiB,IAAjB,EAAuB,IAAvB,CAAZ;MACA,OAAOF,GAAP;IACD,CALc,EAKZ,EALY,CAAjB;EAMD;;AAZgC;;eAepBP,W"}
|
package/cjs/crypto/webauthn.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.getAttestation = exports.getAssertion = exports.buildCredentialRequestOptions = exports.buildCredentialCreationOptions = void 0;
|
|
4
|
-
|
|
5
|
-
var _base = require("./base64");
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
-
*
|
|
11
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
// Get known credentials from list of enrolled authenticators
|
|
19
|
-
const getEnrolledCredentials = (authenticatorEnrollments = []) => {
|
|
20
|
-
const credentials = [];
|
|
21
|
-
authenticatorEnrollments.forEach(enrollement => {
|
|
22
|
-
if (enrollement.key === 'webauthn') {
|
|
23
|
-
credentials.push({
|
|
24
|
-
type: 'public-key',
|
|
25
|
-
id: (0, _base.base64UrlToBuffer)(enrollement.credentialId)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return credentials;
|
|
30
|
-
}; // Build options for navigator.credentials.create
|
|
31
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const buildCredentialCreationOptions = (activationData, authenticatorEnrollments) => {
|
|
35
|
-
return {
|
|
36
|
-
publicKey: {
|
|
37
|
-
rp: activationData.rp,
|
|
38
|
-
user: {
|
|
39
|
-
id: (0, _base.base64UrlToBuffer)(activationData.user.id),
|
|
40
|
-
name: activationData.user.name,
|
|
41
|
-
displayName: activationData.user.displayName
|
|
42
|
-
},
|
|
43
|
-
challenge: (0, _base.base64UrlToBuffer)(activationData.challenge),
|
|
44
|
-
pubKeyCredParams: activationData.pubKeyCredParams,
|
|
45
|
-
attestation: activationData.attestation,
|
|
46
|
-
authenticatorSelection: activationData.authenticatorSelection,
|
|
47
|
-
excludeCredentials: getEnrolledCredentials(authenticatorEnrollments)
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}; // Build options for navigator.credentials.get
|
|
51
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
exports.buildCredentialCreationOptions = buildCredentialCreationOptions;
|
|
55
|
-
|
|
56
|
-
const buildCredentialRequestOptions = (challengeData, authenticatorEnrollments) => {
|
|
57
|
-
return {
|
|
58
|
-
publicKey: {
|
|
59
|
-
challenge: (0, _base.base64UrlToBuffer)(challengeData.challenge),
|
|
60
|
-
userVerification: challengeData.userVerification,
|
|
61
|
-
allowCredentials: getEnrolledCredentials(authenticatorEnrollments)
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}; // Build attestation for webauthn enroll
|
|
65
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
exports.buildCredentialRequestOptions = buildCredentialRequestOptions;
|
|
69
|
-
|
|
70
|
-
const getAttestation = credential => {
|
|
71
|
-
const response = credential.response;
|
|
72
|
-
const id = credential.id;
|
|
73
|
-
const clientData = (0, _base.bufferToBase64Url)(response.clientDataJSON);
|
|
74
|
-
const attestation = (0, _base.bufferToBase64Url)(response.attestationObject);
|
|
75
|
-
return {
|
|
76
|
-
id,
|
|
77
|
-
clientData,
|
|
78
|
-
attestation
|
|
79
|
-
};
|
|
80
|
-
}; // Build assertion for webauthn verification
|
|
81
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
exports.getAttestation = getAttestation;
|
|
85
|
-
|
|
86
|
-
const getAssertion = credential => {
|
|
87
|
-
const response = credential.response;
|
|
88
|
-
const id = credential.id;
|
|
89
|
-
const clientData = (0, _base.bufferToBase64Url)(response.clientDataJSON);
|
|
90
|
-
const authenticatorData = (0, _base.bufferToBase64Url)(response.authenticatorData);
|
|
91
|
-
const signatureData = (0, _base.bufferToBase64Url)(response.signature);
|
|
92
|
-
return {
|
|
93
|
-
id,
|
|
94
|
-
clientData,
|
|
95
|
-
authenticatorData,
|
|
96
|
-
signatureData
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
exports.getAssertion = getAssertion;
|
|
101
|
-
//# sourceMappingURL=webauthn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.js","names":["getEnrolledCredentials","authenticatorEnrollments","credentials","forEach","enrollement","key","push","type","id","base64UrlToBuffer","credentialId","buildCredentialCreationOptions","activationData","publicKey","rp","user","name","displayName","challenge","pubKeyCredParams","attestation","authenticatorSelection","excludeCredentials","buildCredentialRequestOptions","challengeData","userVerification","allowCredentials","getAttestation","credential","response","clientData","bufferToBase64Url","clientDataJSON","attestationObject","getAssertion","authenticatorData","signatureData","signature"],"sources":["../../../lib/crypto/webauthn.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 { base64UrlToBuffer, bufferToBase64Url } from './base64';\nimport { ActivationData, ChallengeData, IdxAuthenticator } from '../idx/types';\n\n// Get known credentials from list of enrolled authenticators\nconst getEnrolledCredentials = (authenticatorEnrollments: IdxAuthenticator[] = []) => {\n const credentials: PublicKeyCredentialDescriptor[] = [];\n authenticatorEnrollments.forEach((enrollement) => {\n if (enrollement.key === 'webauthn') {\n credentials.push({\n type: 'public-key',\n id: base64UrlToBuffer(enrollement.credentialId),\n });\n }\n });\n return credentials;\n};\n\n// Build options for navigator.credentials.create\n// https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create\nexport const buildCredentialCreationOptions = (\n activationData: ActivationData, authenticatorEnrollments: IdxAuthenticator[]\n) => {\n return {\n publicKey: {\n rp: activationData.rp,\n user: {\n id: base64UrlToBuffer(activationData.user.id),\n name: activationData.user.name,\n displayName: activationData.user.displayName\n },\n challenge: base64UrlToBuffer(activationData.challenge),\n pubKeyCredParams: activationData.pubKeyCredParams,\n attestation: activationData.attestation,\n authenticatorSelection: activationData.authenticatorSelection,\n excludeCredentials: getEnrolledCredentials(authenticatorEnrollments),\n }\n } as CredentialCreationOptions;\n};\n\n\n// Build options for navigator.credentials.get\n// https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get\nexport const buildCredentialRequestOptions = (\n challengeData: ChallengeData, authenticatorEnrollments: IdxAuthenticator[]\n) => {\n return {\n publicKey: {\n challenge: base64UrlToBuffer(challengeData.challenge),\n userVerification: challengeData.userVerification,\n allowCredentials: getEnrolledCredentials(authenticatorEnrollments),\n }\n } as CredentialRequestOptions;\n};\n\n// Build attestation for webauthn enroll\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse\nexport const getAttestation = (credential: PublicKeyCredential) => {\n const response = credential.response as AuthenticatorAttestationResponse;\n const id = credential.id;\n const clientData = bufferToBase64Url(response.clientDataJSON);\n const attestation = bufferToBase64Url(response.attestationObject);\n return {\n id,\n clientData,\n attestation\n };\n};\n\n// Build assertion for webauthn verification\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse\nexport const getAssertion = (credential: PublicKeyCredential) => {\n const response = credential.response as AuthenticatorAssertionResponse;\n const id = credential.id;\n const clientData = bufferToBase64Url(response.clientDataJSON);\n const authenticatorData = bufferToBase64Url(response.authenticatorData);\n const signatureData = bufferToBase64Url(response.signature);\n return {\n id,\n clientData,\n authenticatorData,\n signatureData\n };\n};\n"],"mappings":";;;;AAYA;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA,MAAMA,sBAAsB,GAAG,CAACC,wBAA4C,GAAG,EAAhD,KAAuD;EACpF,MAAMC,WAA4C,GAAG,EAArD;EACAD,wBAAwB,CAACE,OAAzB,CAAkCC,WAAD,IAAiB;IAChD,IAAIA,WAAW,CAACC,GAAZ,KAAoB,UAAxB,EAAoC;MAClCH,WAAW,CAACI,IAAZ,CAAiB;QACfC,IAAI,EAAE,YADS;QAEfC,EAAE,EAAE,IAAAC,uBAAA,EAAkBL,WAAW,CAACM,YAA9B;MAFW,CAAjB;IAID;EACF,CAPD;EAQA,OAAOR,WAAP;AACD,CAXD,C,CAaA;AACA;;;AACO,MAAMS,8BAA8B,GAAG,CAC5CC,cA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