@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.createOAuthOptionsConstructor = createOAuthOptionsConstructor;
|
|
6
|
+
|
|
7
|
+
var _constants = require("../../constants");
|
|
8
|
+
|
|
9
|
+
var _url = require("../../util/url");
|
|
10
|
+
|
|
11
|
+
var _features = require("../../features");
|
|
12
|
+
|
|
13
|
+
var _options = require("../../http/options");
|
|
14
|
+
|
|
15
|
+
var _node = require("./node");
|
|
16
|
+
|
|
17
|
+
var _AuthSdkError = _interopRequireDefault(require("../../errors/AuthSdkError"));
|
|
18
|
+
|
|
19
|
+
/*!
|
|
20
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
21
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
22
|
+
*
|
|
23
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
25
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
26
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
|
+
*
|
|
28
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
29
|
+
*/
|
|
30
|
+
function assertValidConfig(args) {
|
|
31
|
+
args = args || {};
|
|
32
|
+
var scopes = args.scopes;
|
|
33
|
+
|
|
34
|
+
if (scopes && !Array.isArray(scopes)) {
|
|
35
|
+
throw new _AuthSdkError.default('scopes must be a array of strings. ' + 'Required usage: new OktaAuth({scopes: ["openid", "email"]})');
|
|
36
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
var issuer = args.issuer;
|
|
40
|
+
|
|
41
|
+
if (!issuer) {
|
|
42
|
+
throw new _AuthSdkError.default('No issuer passed to constructor. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var isUrlRegex = new RegExp('^http?s?://.+');
|
|
46
|
+
|
|
47
|
+
if (!isUrlRegex.test(issuer)) {
|
|
48
|
+
throw new _AuthSdkError.default('Issuer must be a valid URL. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com/oauth2/{authServerId}"})');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (issuer.indexOf('-admin.') !== -1) {
|
|
52
|
+
throw new _AuthSdkError.default('Issuer URL passed to constructor contains "-admin" in subdomain. ' + 'Required usage: new OktaAuth({issuer: "https://{yourOktaDomain}.com})');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function createOAuthOptionsConstructor() {
|
|
57
|
+
const HttpOptionsConstructor = (0, _options.createHttpOptionsConstructor)();
|
|
58
|
+
return class OAuthOptionsConstructor extends HttpOptionsConstructor {
|
|
59
|
+
// CustomUrls
|
|
60
|
+
// TokenParams
|
|
61
|
+
// Additional options
|
|
62
|
+
// For server-side web applications ONLY!
|
|
63
|
+
// Workaround for bad client time/clock
|
|
64
|
+
// eslint-disable-next-line max-statements
|
|
65
|
+
constructor(options) {
|
|
66
|
+
super(options);
|
|
67
|
+
assertValidConfig(options);
|
|
68
|
+
this.issuer = (0, _url.removeTrailingSlash)(options.issuer);
|
|
69
|
+
this.tokenUrl = (0, _url.removeTrailingSlash)(options.tokenUrl);
|
|
70
|
+
this.authorizeUrl = (0, _url.removeTrailingSlash)(options.authorizeUrl);
|
|
71
|
+
this.userinfoUrl = (0, _url.removeTrailingSlash)(options.userinfoUrl);
|
|
72
|
+
this.revokeUrl = (0, _url.removeTrailingSlash)(options.revokeUrl);
|
|
73
|
+
this.logoutUrl = (0, _url.removeTrailingSlash)(options.logoutUrl);
|
|
74
|
+
this.pkce = options.pkce === false ? false : true; // PKCE defaults to true
|
|
75
|
+
|
|
76
|
+
this.clientId = options.clientId;
|
|
77
|
+
this.redirectUri = options.redirectUri;
|
|
78
|
+
|
|
79
|
+
if ((0, _features.isBrowser)()) {
|
|
80
|
+
this.redirectUri = (0, _url.toAbsoluteUrl)(options.redirectUri, window.location.origin); // allow relative URIs
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
this.responseType = options.responseType;
|
|
84
|
+
this.responseMode = options.responseMode;
|
|
85
|
+
this.state = options.state;
|
|
86
|
+
this.scopes = options.scopes; // Give the developer the ability to disable token signature validation.
|
|
87
|
+
|
|
88
|
+
this.ignoreSignature = !!options.ignoreSignature;
|
|
89
|
+
this.codeChallenge = options.codeChallenge;
|
|
90
|
+
this.codeChallengeMethod = options.codeChallengeMethod;
|
|
91
|
+
this.tokenManager = options.tokenManager;
|
|
92
|
+
this.postLogoutRedirectUri = options.postLogoutRedirectUri;
|
|
93
|
+
this.restoreOriginalUri = options.restoreOriginalUri;
|
|
94
|
+
this.transactionManager = {
|
|
95
|
+
enableSharedStorage: _node.enableSharedStorage,
|
|
96
|
+
...options.transactionManager
|
|
97
|
+
};
|
|
98
|
+
this.clientSecret = options.clientSecret;
|
|
99
|
+
this.setLocation = options.setLocation; // As some end user's devices can have their date
|
|
100
|
+
// and time incorrectly set, allow for the disabling
|
|
101
|
+
// of the jwt liftetime validation
|
|
102
|
+
|
|
103
|
+
this.ignoreLifetime = !!options.ignoreLifetime; // Digital clocks will drift over time, so the server
|
|
104
|
+
// can misalign with the time reported by the browser.
|
|
105
|
+
// The maxClockSkew allows relaxing the time-based
|
|
106
|
+
// validation of tokens (in seconds, not milliseconds).
|
|
107
|
+
// It currently defaults to 300, because 5 min is the
|
|
108
|
+
// default maximum tolerance allowed by Kerberos.
|
|
109
|
+
// (https://technet.microsoft.com/en-us/library/cc976357.aspx)
|
|
110
|
+
|
|
111
|
+
if (!options.maxClockSkew && options.maxClockSkew !== 0) {
|
|
112
|
+
this.maxClockSkew = _constants.DEFAULT_MAX_CLOCK_SKEW;
|
|
113
|
+
} else {
|
|
114
|
+
this.maxClockSkew = options.maxClockSkew;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=OAuthOptionsConstructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthOptionsConstructor.js","names":["assertValidConfig","args","scopes","Array","isArray","AuthSdkError","issuer","isUrlRegex","RegExp","test","indexOf","createOAuthOptionsConstructor","HttpOptionsConstructor","createHttpOptionsConstructor","OAuthOptionsConstructor","constructor","options","removeTrailingSlash","tokenUrl","authorizeUrl","userinfoUrl","revokeUrl","logoutUrl","pkce","clientId","redirectUri","isBrowser","toAbsoluteUrl","window","location","origin","responseType","responseMode","state","ignoreSignature","codeChallenge","codeChallengeMethod","tokenManager","postLogoutRedirectUri","restoreOriginalUri","transactionManager","enableSharedStorage","clientSecret","setLocation","ignoreLifetime","maxClockSkew","DEFAULT_MAX_CLOCK_SKEW"],"sources":["../../../../lib/oidc/options/OAuthOptionsConstructor.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 { DEFAULT_MAX_CLOCK_SKEW } from '../../constants';\nimport { removeTrailingSlash, toAbsoluteUrl } from '../../util/url';\nimport { isBrowser } from '../../features';\nimport { createHttpOptionsConstructor } from '../../http/options';\nimport {\n OAuthResponseMode,\n OAuthResponseType,\n OktaAuthOAuthInterface,\n OktaAuthOAuthOptions,\n SetLocationFunction,\n TokenManagerOptions,\n TransactionManagerOptions\n} from '../types';\nimport { enableSharedStorage } from './node';\nimport AuthSdkError from '../../errors/AuthSdkError';\n\nfunction assertValidConfig(args) {\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 function createOAuthOptionsConstructor() {\n const HttpOptionsConstructor = createHttpOptionsConstructor();\n return class OAuthOptionsConstructor\n extends HttpOptionsConstructor\n implements Required<OktaAuthOAuthOptions>\n {\n // CustomUrls\n issuer: string;\n authorizeUrl: string;\n userinfoUrl: string;\n tokenUrl: string;\n revokeUrl: string;\n logoutUrl: string;\n \n // TokenParams\n pkce: boolean;\n clientId: string;\n redirectUri: string;\n responseType: OAuthResponseType | OAuthResponseType[];\n responseMode: OAuthResponseMode;\n state: string;\n scopes: string[];\n ignoreSignature: boolean;\n codeChallenge: string;\n codeChallengeMethod: string;\n\n // Additional options\n tokenManager: TokenManagerOptions;\n postLogoutRedirectUri: string;\n restoreOriginalUri: (oktaAuth: OktaAuthOAuthInterface, originalUri?: string) => Promise<void>;\n transactionManager: TransactionManagerOptions;\n\n // For server-side web applications ONLY!\n clientSecret: string;\n setLocation: SetLocationFunction;\n\n // Workaround for bad client time/clock\n ignoreLifetime: boolean;\n maxClockSkew: number;\n\n\n // eslint-disable-next-line max-statements\n constructor(options: any) {\n super(options);\n \n assertValidConfig(options);\n \n this.issuer = removeTrailingSlash(options.issuer);\n this.tokenUrl = removeTrailingSlash(options.tokenUrl);\n this.authorizeUrl = removeTrailingSlash(options.authorizeUrl);\n this.userinfoUrl = removeTrailingSlash(options.userinfoUrl);\n this.revokeUrl = removeTrailingSlash(options.revokeUrl);\n this.logoutUrl = removeTrailingSlash(options.logoutUrl);\n\n this.pkce = options.pkce === false ? false : true; // PKCE defaults to true\n this.clientId = options.clientId;\n this.redirectUri = options.redirectUri;\n if (isBrowser()) {\n this.redirectUri = toAbsoluteUrl(options.redirectUri, window.location.origin); // allow relative URIs\n }\n this.responseType = options.responseType;\n this.responseMode = options.responseMode;\n this.state = options.state;\n this.scopes = options.scopes;\n // Give the developer the ability to disable token signature validation.\n this.ignoreSignature = !!options.ignoreSignature;\n this.codeChallenge = options.codeChallenge;\n this.codeChallengeMethod = options.codeChallengeMethod;\n\n this.tokenManager = options.tokenManager;\n this.postLogoutRedirectUri = options.postLogoutRedirectUri;\n this.restoreOriginalUri = options.restoreOriginalUri;\n this.transactionManager = { enableSharedStorage, ...options.transactionManager };\n \n this.clientSecret = options.clientSecret;\n this.setLocation = options.setLocation;\n \n // As some end user's devices can have their date \n // and time incorrectly set, allow for the disabling\n // of the jwt liftetime validation\n this.ignoreLifetime = !!options.ignoreLifetime;\n\n // Digital clocks will drift over time, so the server\n // can misalign with the time reported by the browser.\n // The maxClockSkew allows relaxing the time-based\n // validation of tokens (in seconds, not milliseconds).\n // It currently defaults to 300, because 5 min is the\n // default maximum tolerance allowed by Kerberos.\n // (https://technet.microsoft.com/en-us/library/cc976357.aspx)\n if (!options.maxClockSkew && options.maxClockSkew !== 0) {\n this.maxClockSkew = DEFAULT_MAX_CLOCK_SKEW;\n } else {\n this.maxClockSkew = options.maxClockSkew;\n }\n\n }\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","names":["enableSharedStorage"],"sources":["../../../../lib/oidc/options/browser.ts"],"sourcesContent":["export const enableSharedStorage = true;\n"],"mappings":";;;AAAO,MAAMA,mBAAmB,GAAG,IAA5B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _OAuthOptionsConstructor = require("./OAuthOptionsConstructor");
|
|
4
|
+
|
|
5
|
+
Object.keys(_OAuthOptionsConstructor).forEach(function (key) {
|
|
6
|
+
if (key === "default" || key === "__esModule") return;
|
|
7
|
+
if (key in exports && exports[key] === _OAuthOptionsConstructor[key]) return;
|
|
8
|
+
Object.defineProperty(exports, key, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _OAuthOptionsConstructor[key];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/oidc/options/index.ts"],"sourcesContent":["export * from './OAuthOptionsConstructor';\n"],"mappings":";;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","names":["enableSharedStorage"],"sources":["../../../../lib/oidc/options/node.ts"],"sourcesContent":["\nexport const enableSharedStorage = false;\n"],"mappings":";;;AACO,MAAMA,mBAAmB,GAAG,KAA5B"}
|
package/cjs/oidc/parseFromUrl.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
exports.cleanOAuthResponseFromUrl = cleanOAuthResponseFromUrl;
|
|
6
4
|
exports.getResponseMode = getResponseMode;
|
|
7
5
|
exports.parseFromUrl = parseFromUrl;
|
|
8
6
|
exports.parseOAuthResponseFromUrl = parseOAuthResponseFromUrl;
|
|
9
7
|
|
|
10
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
11
|
-
|
|
12
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
13
|
-
|
|
14
8
|
var _errors = require("../errors");
|
|
15
9
|
|
|
16
10
|
var _util = require("./util");
|
|
@@ -87,9 +81,9 @@ function parseOAuthResponseFromUrl(sdk, options) {
|
|
|
87
81
|
var paramStr;
|
|
88
82
|
|
|
89
83
|
if (responseMode === 'query') {
|
|
90
|
-
paramStr = url ? url.substring(
|
|
84
|
+
paramStr = url ? url.substring(url.indexOf('?')) : nativeLoc.search;
|
|
91
85
|
} else {
|
|
92
|
-
paramStr = url ? url.substring(
|
|
86
|
+
paramStr = url ? url.substring(url.indexOf('#')) : nativeLoc.hash;
|
|
93
87
|
}
|
|
94
88
|
|
|
95
89
|
if (!paramStr) {
|
|
@@ -119,13 +113,16 @@ async function parseFromUrl(sdk, options) {
|
|
|
119
113
|
const res = parseOAuthResponseFromUrl(sdk, options);
|
|
120
114
|
const state = res.state;
|
|
121
115
|
const oauthParams = sdk.transactionManager.load({
|
|
122
|
-
oauth: true,
|
|
123
|
-
pkce: sdk.options.pkce,
|
|
124
116
|
state
|
|
125
117
|
});
|
|
126
118
|
|
|
127
119
|
if (!oauthParams) {
|
|
128
|
-
|
|
120
|
+
if (sdk.options.pkce) {
|
|
121
|
+
// eslint-disable-next-line max-len
|
|
122
|
+
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);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
throw new _errors.AuthSdkError('Unable to retrieve OAuth redirect params from storage');
|
|
129
126
|
}
|
|
130
127
|
|
|
131
128
|
const urls = oauthParams.urls;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseFromUrl.js","names":["removeHash","sdk","nativeHistory","token","parseFromUrl","_getHistory","nativeDoc","_getDocument","nativeLoc","_getLocation","replaceState","title","pathname","search","hash","removeSearch","getResponseMode","defaultResponseMode","options","pkce","responseMode","parseOAuthResponseFromUrl","isString","url","paramStr","substring","AuthSdkError","urlParamsToObject","cleanOAuthResponseFromUrl","res","state","oauthParams","transactionManager","load","
|
|
1
|
+
{"version":3,"file":"parseFromUrl.js","names":["removeHash","sdk","nativeHistory","token","parseFromUrl","_getHistory","nativeDoc","_getDocument","nativeLoc","_getLocation","replaceState","title","pathname","search","hash","removeSearch","getResponseMode","defaultResponseMode","options","pkce","responseMode","parseOAuthResponseFromUrl","isString","url","paramStr","substring","indexOf","AuthSdkError","urlParamsToObject","cleanOAuthResponseFromUrl","res","state","oauthParams","transactionManager","load","undefined","urls","handleOAuthResponse","catch","err","isInteractionRequiredError","clear","then"],"sources":["../../../lib/oidc/parseFromUrl.ts"],"sourcesContent":["/* eslint-disable complexity */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n *\n */\nimport { AuthSdkError } from '../errors';\nimport { isInteractionRequiredError, urlParamsToObject } from './util';\nimport {\n ParseFromUrlOptions,\n TokenResponse,\n CustomUrls,\n TransactionMeta,\n OAuthResponse\n} from './types';\nimport { isString } from '../util';\nimport { handleOAuthResponse } from './handleOAuthResponse';\n\nfunction removeHash(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.search);\n } else {\n nativeLoc.hash = '';\n }\n}\n\nfunction removeSearch(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.hash);\n } else {\n nativeLoc.search = '';\n }\n}\n\nexport function getResponseMode(sdk): 'query' | 'fragment' {\n // https://openid.net/specs/openid-connect-core-1_0.html#Authentication\n var defaultResponseMode = sdk.options.pkce ? 'query' : 'fragment';\n var responseMode = sdk.options.responseMode || defaultResponseMode;\n return responseMode;\n}\n\nexport function parseOAuthResponseFromUrl(sdk, options: string | ParseFromUrlOptions): OAuthResponse {\n options = options || {};\n if (isString(options)) {\n options = { url: options } as ParseFromUrlOptions;\n } else {\n options = options as ParseFromUrlOptions;\n }\n\n var url = options.url;\n var responseMode = options.responseMode || getResponseMode(sdk);\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n var paramStr;\n\n if (responseMode === 'query') {\n paramStr = url ? url.substring(url.indexOf('?')) : nativeLoc.search;\n } else {\n paramStr = url ? url.substring(url.indexOf('#')) : nativeLoc.hash;\n }\n\n if (!paramStr) {\n throw new AuthSdkError('Unable to parse a token from the url');\n }\n\n return urlParamsToObject(paramStr);\n}\n\nexport function cleanOAuthResponseFromUrl(sdk, options: ParseFromUrlOptions) {\n // Clean hash or search from the url\n const responseMode = options.responseMode || getResponseMode(sdk);\n responseMode === 'query' ? removeSearch(sdk) : removeHash(sdk);\n}\n\nexport async function parseFromUrl(sdk, options?: string | ParseFromUrlOptions): Promise<TokenResponse> {\n options = options || {};\n if (isString(options)) {\n options = { url: options } as ParseFromUrlOptions;\n } else {\n options = options as ParseFromUrlOptions;\n }\n\n const res: OAuthResponse = parseOAuthResponseFromUrl(sdk, options);\n const state = res.state;\n const oauthParams: TransactionMeta = sdk.transactionManager.load({\n state\n });\n if (!oauthParams) {\n if (sdk.options.pkce) {\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 throw new AuthSdkError('Unable to retrieve OAuth redirect params from storage');\n }\n const urls: CustomUrls = oauthParams.urls as CustomUrls;\n delete oauthParams.urls;\n\n if (!options.url) {\n // Clean hash or search from the url\n cleanOAuthResponseFromUrl(sdk, options);\n }\n\n return handleOAuthResponse(sdk, oauthParams, res, urls)\n .catch(err => {\n if (!isInteractionRequiredError(err)) {\n sdk.transactionManager.clear({\n state\n });\n }\n throw err;\n })\n .then(res => {\n sdk.transactionManager.clear({\n state\n });\n return res;\n });\n\n}\n"],"mappings":"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"}
|
package/cjs/oidc/renewToken.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renewToken.js","names":["throwInvalidTokenError","AuthSdkError","getSingleToken","originalToken","tokens","isIDToken","idToken","isAccessToken","accessToken","renewToken","sdk","token","tokenManager","getTokensSync","refreshToken","renewTokensWithRefresh","scopes","responseType","options","pkce","authorizeUrl","userinfoUrl","issuer","getWithoutPrompt","then","res"],"sources":["../../../lib/oidc/renewToken.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 { AuthSdkError } from '../errors';\nimport {
|
|
1
|
+
{"version":3,"file":"renewToken.js","names":["throwInvalidTokenError","AuthSdkError","getSingleToken","originalToken","tokens","isIDToken","idToken","isAccessToken","accessToken","renewToken","sdk","token","tokenManager","getTokensSync","refreshToken","renewTokensWithRefresh","scopes","responseType","options","pkce","authorizeUrl","userinfoUrl","issuer","getWithoutPrompt","then","res"],"sources":["../../../lib/oidc/renewToken.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 { AuthSdkError } from '../errors';\nimport { OktaAuthOAuthInterface, Token, Tokens, isAccessToken, AccessToken, IDToken, isIDToken } from './types';\nimport { getWithoutPrompt } from './getWithoutPrompt';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh';\n\nfunction throwInvalidTokenError() {\n throw new AuthSdkError(\n 'Renew must be passed a token with an array of scopes and an accessToken or idToken'\n );\n}\n\n// Multiple tokens may have come back. Return only the token which was requested.\nfunction getSingleToken(originalToken: Token, tokens: Tokens) {\n if (isIDToken(originalToken)) {\n return tokens.idToken;\n }\n if (isAccessToken(originalToken)) {\n return tokens.accessToken;\n }\n throwInvalidTokenError();\n}\n\n// If we have a refresh token, renew using that, otherwise getWithoutPrompt\nexport async function renewToken(sdk: OktaAuthOAuthInterface, token: Token): Promise<Token | undefined> {\n if (!isIDToken(token) && !isAccessToken(token)) {\n throwInvalidTokenError();\n }\n\n let tokens = sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n tokens = await renewTokensWithRefresh(sdk, {\n scopes: token.scopes,\n }, tokens.refreshToken);\n return getSingleToken(token, tokens);\n }\n\n var responseType;\n if (sdk.options.pkce) {\n responseType = 'code';\n } else if (isAccessToken(token)) {\n responseType = 'token';\n } else {\n responseType = 'id_token';\n }\n\n const { scopes, authorizeUrl, userinfoUrl, issuer } = token as (AccessToken & IDToken);\n return getWithoutPrompt(sdk, {\n responseType,\n scopes,\n authorizeUrl,\n userinfoUrl,\n issuer\n })\n .then(function (res) {\n return getSingleToken(token, res.tokens);\n });\n}\n"],"mappings":";;;;AAYA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,sBAAT,GAAkC;EAChC,MAAM,IAAIC,oBAAJ,CACJ,oFADI,CAAN;AAGD,C,CAED;;;AACA,SAASC,cAAT,CAAwBC,aAAxB,EAA8CC,MAA9C,EAA8D;EAC5D,IAAI,IAAAC,gBAAA,EAAUF,aAAV,CAAJ,EAA8B;IAC5B,OAAOC,MAAM,CAACE,OAAd;EACD;;EACD,IAAI,IAAAC,oBAAA,EAAcJ,aAAd,CAAJ,EAAkC;IAChC,OAAOC,MAAM,CAACI,WAAd;EACD;;EACDR,sBAAsB;AACvB,C,CAED;;;AACO,eAAeS,UAAf,CAA0BC,GAA1B,EAAuDC,KAAvD,EAAiG;EACtG,IAAI,CAAC,IAAAN,gBAAA,EAAUM,KAAV,CAAD,IAAqB,CAAC,IAAAJ,oBAAA,EAAcI,KAAd,CAA1B,EAAgD;IAC9CX,sBAAsB;EACvB;;EAED,IAAII,MAAM,GAAGM,GAAG,CAACE,YAAJ,CAAiBC,aAAjB,EAAb;;EACA,IAAIT,MAAM,CAACU,YAAX,EAAyB;IACvBV,MAAM,GAAG,MAAM,IAAAW,8CAAA,EAAuBL,GAAvB,EAA4B;MACzCM,MAAM,EAAEL,KAAK,CAACK;IAD2B,CAA5B,EAEZZ,MAAM,CAACU,YAFK,CAAf;IAGA,OAAOZ,cAAc,CAACS,KAAD,EAAQP,MAAR,CAArB;EACD;;EAED,IAAIa,YAAJ;;EACA,IAAIP,GAAG,CAACQ,OAAJ,CAAYC,IAAhB,EAAsB;IACpBF,YAAY,GAAG,MAAf;EACD,CAFD,MAEO,IAAI,IAAAV,oBAAA,EAAcI,KAAd,CAAJ,EAA0B;IAC/BM,YAAY,GAAG,OAAf;EACD,CAFM,MAEA;IACLA,YAAY,GAAG,UAAf;EACD;;EAED,MAAM;IAAED,MAAF;IAAUI,YAAV;IAAwBC,WAAxB;IAAqCC;EAArC,IAAgDX,KAAtD;EACA,OAAO,IAAAY,kCAAA,EAAiBb,GAAjB,EAAsB;IAC3BO,YAD2B;IAE3BD,MAF2B;IAG3BI,YAH2B;IAI3BC,WAJ2B;IAK3BC;EAL2B,CAAtB,EAOJE,IAPI,CAOC,UAAUC,GAAV,EAAe;IACnB,OAAOvB,cAAc,CAACS,KAAD,EAAQc,GAAG,CAACrB,MAAZ,CAArB;EACD,CATI,CAAP;AAUD"}
|
package/cjs/oidc/renewTokens.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
exports.renewTokens = renewTokens;
|
|
6
4
|
|
|
7
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
8
|
-
|
|
9
5
|
var _errors = require("../errors");
|
|
10
6
|
|
|
11
7
|
var _getWithoutPrompt = require("./getWithoutPrompt");
|
|
@@ -56,7 +52,7 @@ async function renewTokens(sdk, options) {
|
|
|
56
52
|
const userinfoUrl = accessToken.userinfoUrl || sdk.options.userinfoUrl;
|
|
57
53
|
const issuer = idToken.issuer || sdk.options.issuer; // Get tokens using the SSO cookie
|
|
58
54
|
|
|
59
|
-
options =
|
|
55
|
+
options = Object.assign({
|
|
60
56
|
scopes,
|
|
61
57
|
authorizeUrl,
|
|
62
58
|
userinfoUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renewTokens.js","names":["renewTokens","sdk","options","tokens","tokenManager","getTokensSync","refreshToken","renewTokensWithRefresh","accessToken","idToken","AuthSdkError","scopes","authorizeUrl","userinfoUrl","issuer","pkce","responseType","getDefaultTokenParams","getWithoutPrompt","then","res"],"sources":["../../../lib/oidc/renewTokens.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 { AuthSdkError } from '../errors';\nimport { TokenParams, Tokens } from '
|
|
1
|
+
{"version":3,"file":"renewTokens.js","names":["renewTokens","sdk","options","tokens","tokenManager","getTokensSync","refreshToken","renewTokensWithRefresh","accessToken","idToken","AuthSdkError","scopes","authorizeUrl","userinfoUrl","issuer","Object","assign","pkce","responseType","getDefaultTokenParams","getWithoutPrompt","then","res"],"sources":["../../../lib/oidc/renewTokens.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 { AuthSdkError } from '../errors';\nimport { TokenParams, Tokens } from './types';\nimport { getWithoutPrompt } from './getWithoutPrompt';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh';\nimport { getDefaultTokenParams } from './util';\n\n// If we have a refresh token, renew using that, otherwise getWithoutPrompt\n// eslint-disable-next-line complexity\nexport async function renewTokens(sdk, options?: TokenParams): Promise<Tokens> {\n const tokens = sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n return renewTokensWithRefresh(sdk, options || {}, tokens.refreshToken);\n }\n\n if (!tokens.accessToken && !tokens.idToken) {\n throw new AuthSdkError('renewTokens() was called but there is no existing token');\n }\n\n const accessToken = tokens.accessToken || {};\n const idToken = tokens.idToken || {};\n const scopes = accessToken.scopes || idToken.scopes;\n if (!scopes) {\n throw new AuthSdkError('renewTokens: invalid tokens: could not read scopes');\n }\n const authorizeUrl = accessToken.authorizeUrl || idToken.authorizeUrl;\n if (!authorizeUrl) {\n throw new AuthSdkError('renewTokens: invalid tokens: could not read authorizeUrl');\n }\n const userinfoUrl = accessToken.userinfoUrl || sdk.options.userinfoUrl;\n const issuer = idToken.issuer || sdk.options.issuer;\n\n // Get tokens using the SSO cookie\n options = Object.assign({\n scopes,\n authorizeUrl,\n userinfoUrl,\n issuer\n }, options);\n\n if (sdk.options.pkce) {\n options.responseType = 'code';\n } else {\n const { responseType } = getDefaultTokenParams(sdk);\n options.responseType = responseType;\n }\n\n return getWithoutPrompt(sdk, options)\n .then(res => res.tokens);\n \n}\n"],"mappings":";;;;AAYA;;AAEA;;AACA;;AACA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACO,eAAeA,WAAf,CAA2BC,GAA3B,EAAgCC,OAAhC,EAAwE;EAC7E,MAAMC,MAAM,GAAGF,GAAG,CAACG,YAAJ,CAAiBC,aAAjB,EAAf;;EACA,IAAIF,MAAM,CAACG,YAAX,EAAyB;IACvB,OAAO,IAAAC,8CAAA,EAAuBN,GAAvB,EAA4BC,OAAO,IAAI,EAAvC,EAA2CC,MAAM,CAACG,YAAlD,CAAP;EACD;;EAED,IAAI,CAACH,MAAM,CAACK,WAAR,IAAuB,CAACL,MAAM,CAACM,OAAnC,EAA4C;IAC1C,MAAM,IAAIC,oBAAJ,CAAiB,yDAAjB,CAAN;EACD;;EAED,MAAMF,WAAW,GAAGL,MAAM,CAACK,WAAP,IAAsB,EAA1C;EACA,MAAMC,OAAO,GAAGN,MAAM,CAACM,OAAP,IAAkB,EAAlC;EACA,MAAME,MAAM,GAAGH,WAAW,CAACG,MAAZ,IAAsBF,OAAO,CAACE,MAA7C;;EACA,IAAI,CAACA,MAAL,EAAa;IACX,MAAM,IAAID,oBAAJ,CAAiB,oDAAjB,CAAN;EACD;;EACD,MAAME,YAAY,GAAGJ,WAAW,CAACI,YAAZ,IAA4BH,OAAO,CAACG,YAAzD;;EACA,IAAI,CAACA,YAAL,EAAmB;IACjB,MAAM,IAAIF,oBAAJ,CAAiB,0DAAjB,CAAN;EACD;;EACD,MAAMG,WAAW,GAAGL,WAAW,CAACK,WAAZ,IAA2BZ,GAAG,CAACC,OAAJ,CAAYW,WAA3D;EACA,MAAMC,MAAM,GAAGL,OAAO,CAACK,MAAR,IAAkBb,GAAG,CAACC,OAAJ,CAAYY,MAA7C,CArB6E,CAuB7E;;EACAZ,OAAO,GAAGa,MAAM,CAACC,MAAP,CAAc;IACtBL,MADsB;IAEtBC,YAFsB;IAGtBC,WAHsB;IAItBC;EAJsB,CAAd,EAKPZ,OALO,CAAV;;EAOA,IAAID,GAAG,CAACC,OAAJ,CAAYe,IAAhB,EAAsB;IACpBf,OAAO,CAACgB,YAAR,GAAuB,MAAvB;EACD,CAFD,MAEO;IACL,MAAM;MAAEA;IAAF,IAAmB,IAAAC,2BAAA,EAAsBlB,GAAtB,CAAzB;IACAC,OAAO,CAACgB,YAAR,GAAuBA,YAAvB;EACD;;EAED,OAAO,IAAAE,kCAAA,EAAiBnB,GAAjB,EAAsBC,OAAtB,EACJmB,IADI,CACCC,GAAG,IAAIA,GAAG,CAACnB,MADZ,CAAP;AAGD"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
exports.renewTokensWithRefresh = renewTokensWithRefresh;
|
|
6
4
|
|
|
7
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
8
|
-
|
|
9
5
|
var _errors = require("../errors");
|
|
10
6
|
|
|
11
7
|
var _oauth = require("./util/oauth");
|
|
@@ -40,7 +36,7 @@ async function renewTokensWithRefresh(sdk, tokenParams, refreshTokenObject) {
|
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
try {
|
|
43
|
-
const renewTokenParams =
|
|
39
|
+
const renewTokenParams = Object.assign({}, tokenParams, {
|
|
44
40
|
clientId
|
|
45
41
|
});
|
|
46
42
|
const tokenResponse = await (0, _token.postRefreshToken)(sdk, renewTokenParams, refreshTokenObject);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renewTokensWithRefresh.js","names":["renewTokensWithRefresh","sdk","tokenParams","refreshTokenObject","clientId","options","AuthSdkError","renewTokenParams","tokenResponse","postRefreshToken","urls","getOAuthUrls","tokens","handleOAuthResponse","refreshToken","isSameRefreshToken","tokenManager","updateRefreshToken","err","isRefreshTokenInvalidError","removeRefreshToken"],"sources":["../../../lib/oidc/renewTokensWithRefresh.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 { AuthSdkError } from '../errors';\nimport { getOAuthUrls } from './util/oauth';\nimport { isSameRefreshToken } from './util/refreshToken';\nimport {
|
|
1
|
+
{"version":3,"file":"renewTokensWithRefresh.js","names":["renewTokensWithRefresh","sdk","tokenParams","refreshTokenObject","clientId","options","AuthSdkError","renewTokenParams","Object","assign","tokenResponse","postRefreshToken","urls","getOAuthUrls","tokens","handleOAuthResponse","refreshToken","isSameRefreshToken","tokenManager","updateRefreshToken","err","isRefreshTokenInvalidError","removeRefreshToken"],"sources":["../../../lib/oidc/renewTokensWithRefresh.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 { AuthSdkError } from '../errors';\nimport { getOAuthUrls } from './util/oauth';\nimport { isSameRefreshToken } from './util/refreshToken';\nimport { OktaAuthOAuthInterface, TokenParams, RefreshToken, Tokens } from './types';\nimport { handleOAuthResponse } from './handleOAuthResponse';\nimport { postRefreshToken } from './endpoints/token';\nimport { isRefreshTokenInvalidError } from './util/errors';\n\nexport async function renewTokensWithRefresh(\n sdk: OktaAuthOAuthInterface,\n tokenParams: TokenParams,\n refreshTokenObject: RefreshToken\n): Promise<Tokens> {\n const { clientId } = sdk.options;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to renew tokens');\n }\n\n try {\n const renewTokenParams: TokenParams = Object.assign({}, tokenParams, {\n clientId,\n });\n const tokenResponse = await postRefreshToken(sdk, renewTokenParams, refreshTokenObject);\n const urls = getOAuthUrls(sdk, tokenParams);\n const { tokens } = await handleOAuthResponse(sdk, renewTokenParams, tokenResponse, urls);\n\n // Support rotating refresh tokens\n const { refreshToken } = tokens;\n if (refreshToken && !isSameRefreshToken(refreshToken, refreshTokenObject)) {\n sdk.tokenManager.updateRefreshToken(refreshToken);\n }\n\n return tokens;\n }\n catch (err) {\n if (isRefreshTokenInvalidError(err)) {\n // if the refresh token is invalid, remove it from storage\n sdk.tokenManager.removeRefreshToken();\n }\n throw err;\n }\n}\n"],"mappings":";;;;AAYA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,eAAeA,sBAAf,CACLC,GADK,EAELC,WAFK,EAGLC,kBAHK,EAIY;EACjB,MAAM;IAAEC;EAAF,IAAeH,GAAG,CAACI,OAAzB;;EACA,IAAI,CAACD,QAAL,EAAe;IACb,MAAM,IAAIE,oBAAJ,CAAiB,0EAAjB,CAAN;EACD;;EAED,IAAI;IACF,MAAMC,gBAA6B,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBP,WAAlB,EAA+B;MACnEE;IADmE,CAA/B,CAAtC;IAGA,MAAMM,aAAa,GAAG,MAAM,IAAAC,uBAAA,EAAiBV,GAAjB,EAAsBM,gBAAtB,EAAwCJ,kBAAxC,CAA5B;IACA,MAAMS,IAAI,GAAG,IAAAC,mBAAA,EAAaZ,GAAb,EAAkBC,WAAlB,CAAb;IACA,MAAM;MAAEY;IAAF,IAAa,MAAM,IAAAC,wCAAA,EAAoBd,GAApB,EAAyBM,gBAAzB,EAA2CG,aAA3C,EAA0DE,IAA1D,CAAzB,CANE,CAQF;;IACA,MAAM;MAAEI;IAAF,IAAmBF,MAAzB;;IACA,IAAIE,YAAY,IAAI,CAAC,IAAAC,gCAAA,EAAmBD,YAAnB,EAAiCb,kBAAjC,CAArB,EAA2E;MACzEF,GAAG,CAACiB,YAAJ,CAAiBC,kBAAjB,CAAoCH,YAApC;IACD;;IAED,OAAOF,MAAP;EACD,CAfD,CAgBA,OAAOM,GAAP,EAAY;IACV,IAAI,IAAAC,mCAAA,EAA2BD,GAA3B,CAAJ,EAAqC;MACnC;MACAnB,GAAG,CAACiB,YAAJ,CAAiBI,kBAAjB;IACD;;IACD,MAAMF,GAAN;EACD;AACF"}
|
package/cjs/oidc/revokeToken.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.revokeToken = revokeToken;
|
|
6
6
|
|
|
7
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
8
|
-
|
|
9
7
|
var _http = require("../http");
|
|
10
8
|
|
|
11
9
|
var _util = require("../util");
|
|
@@ -32,8 +30,6 @@ var _AuthSdkError = _interopRequireDefault(require("../errors/AuthSdkError"));
|
|
|
32
30
|
/* eslint complexity:[0,8] */
|
|
33
31
|
// refresh tokens have precedence to be revoked if no token is specified
|
|
34
32
|
async function revokeToken(sdk, token) {
|
|
35
|
-
var _context;
|
|
36
|
-
|
|
37
33
|
let accessToken = '';
|
|
38
34
|
let refreshToken = '';
|
|
39
35
|
|
|
@@ -55,11 +51,11 @@ async function revokeToken(sdk, token) {
|
|
|
55
51
|
|
|
56
52
|
|
|
57
53
|
var revokeUrl = (0, _oauth.getOAuthUrls)(sdk).revokeUrl;
|
|
58
|
-
var args = (0,
|
|
54
|
+
var args = (0, _util.toQueryString)({
|
|
59
55
|
// eslint-disable-next-line camelcase
|
|
60
56
|
token_type_hint: refreshToken ? 'refresh_token' : 'access_token',
|
|
61
57
|
token: refreshToken || accessToken
|
|
62
|
-
})
|
|
58
|
+
}).slice(1);
|
|
63
59
|
var creds = clientSecret ? (0, _crypto.btoa)(`${clientId}:${clientSecret}`) : (0, _crypto.btoa)(clientId);
|
|
64
60
|
return (0, _http.post)(sdk, revokeUrl, args, {
|
|
65
61
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeToken.js","names":["revokeToken","sdk","token","accessToken","refreshToken","AuthSdkError","clientId","options","clientSecret","revokeUrl","getOAuthUrls","args","toQueryString","token_type_hint","creds","btoa","post","headers"],"sources":["../../../lib/oidc/revokeToken.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\n/* eslint complexity:[0,8] */\nimport { post } from '../http';\nimport { toQueryString } from '../util';\nimport {\n getOAuthUrls,\n} from './util/oauth';\nimport { btoa } from '../crypto';\nimport AuthSdkError from '../errors/AuthSdkError';\nimport {\n
|
|
1
|
+
{"version":3,"file":"revokeToken.js","names":["revokeToken","sdk","token","accessToken","refreshToken","AuthSdkError","clientId","options","clientSecret","revokeUrl","getOAuthUrls","args","toQueryString","token_type_hint","slice","creds","btoa","post","headers"],"sources":["../../../lib/oidc/revokeToken.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\n/* eslint complexity:[0,8] */\nimport { post } from '../http';\nimport { toQueryString } from '../util';\nimport {\n getOAuthUrls,\n} from './util/oauth';\nimport { btoa } from '../crypto';\nimport AuthSdkError from '../errors/AuthSdkError';\nimport {\n OktaAuthOAuthInterface,\n RevocableToken,\n AccessToken,\n RefreshToken\n} from './types';\n\n// refresh tokens have precedence to be revoked if no token is specified\nexport async function revokeToken(sdk: OktaAuthOAuthInterface, token: RevocableToken): Promise<any> {\n let accessToken = '';\n let refreshToken = '';\n if (token) { \n accessToken = (token as AccessToken).accessToken;\n refreshToken = (token as RefreshToken).refreshToken; \n }\n if(!accessToken && !refreshToken) { \n throw new AuthSdkError('A valid access or refresh token object is required');\n }\n var clientId = sdk.options.clientId;\n var clientSecret = sdk.options.clientSecret;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to revoke a token');\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var revokeUrl = getOAuthUrls(sdk).revokeUrl!;\n var args = toQueryString({\n // eslint-disable-next-line camelcase\n token_type_hint: refreshToken ? 'refresh_token' : 'access_token', \n token: refreshToken || accessToken,\n }).slice(1);\n var creds = clientSecret ? btoa(`${clientId}:${clientSecret}`) : btoa(clientId);\n return post(sdk, revokeUrl, args, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Basic ' + creds\n }\n });\n}\n"],"mappings":";;;;;;AAcA;;AACA;;AACA;;AAGA;;AACA;;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAeA;AACO,eAAeA,WAAf,CAA2BC,GAA3B,EAAwDC,KAAxD,EAA6F;EAClG,IAAIC,WAAW,GAAG,EAAlB;EACA,IAAIC,YAAY,GAAG,EAAnB;;EACA,IAAIF,KAAJ,EAAW;IACPC,WAAW,GAAID,KAAD,CAAuBC,WAArC;IACAC,YAAY,GAAIF,KAAD,CAAwBE,YAAvC;EACH;;EACD,IAAG,CAACD,WAAD,IAAgB,CAACC,YAApB,EAAkC;IAChC,MAAM,IAAIC,qBAAJ,CAAiB,oDAAjB,CAAN;EACD;;EACD,IAAIC,QAAQ,GAAGL,GAAG,CAACM,OAAJ,CAAYD,QAA3B;EACA,IAAIE,YAAY,GAAGP,GAAG,CAACM,OAAJ,CAAYC,YAA/B;;EACA,IAAI,CAACF,QAAL,EAAe;IACb,MAAM,IAAID,qBAAJ,CAAiB,4EAAjB,CAAN;EACD,CAdiG,CAelG;;;EACA,IAAII,SAAS,GAAG,IAAAC,mBAAA,EAAaT,GAAb,EAAkBQ,SAAlC;EACA,IAAIE,IAAI,GAAG,IAAAC,mBAAA,EAAc;IACvB;IACAC,eAAe,EAAET,YAAY,GAAG,eAAH,GAAqB,cAF3B;IAGvBF,KAAK,EAAEE,YAAY,IAAID;EAHA,CAAd,EAIRW,KAJQ,CAIF,CAJE,CAAX;EAKA,IAAIC,KAAK,GAAGP,YAAY,GAAG,IAAAQ,YAAA,EAAM,GAAEV,QAAS,IAAGE,YAAa,EAAjC,CAAH,GAAyC,IAAAQ,YAAA,EAAKV,QAAL,CAAjE;EACA,OAAO,IAAAW,UAAA,EAAKhB,GAAL,EAAUQ,SAAV,EAAqBE,IAArB,EAA2B;IAChCO,OAAO,EAAE;MACP,gBAAgB,mCADT;MAEP,iBAAiB,WAAWH;IAFrB;EADuB,CAA3B,CAAP;AAMD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.createOAuthStorageManager = createOAuthStorageManager;
|
|
4
|
+
|
|
5
|
+
var _BaseStorageManager = require("../storage/BaseStorageManager");
|
|
6
|
+
|
|
7
|
+
var _storage = require("../storage");
|
|
8
|
+
|
|
9
|
+
var _constants = require("../constants");
|
|
10
|
+
|
|
11
|
+
function createOAuthStorageManager() {
|
|
12
|
+
return class OAuthStorageManager extends _BaseStorageManager.BaseStorageManager {
|
|
13
|
+
constructor(storageManagerOptions, cookieOptions, storageUtil) {
|
|
14
|
+
super(storageManagerOptions, cookieOptions, storageUtil);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getTransactionStorage(options) {
|
|
18
|
+
options = this.getOptionsForSection('transaction', options);
|
|
19
|
+
(0, _BaseStorageManager.logServerSideMemoryStorageWarning)(options);
|
|
20
|
+
const storage = this.getStorage(options);
|
|
21
|
+
const storageKey = options.storageKey || _constants.TRANSACTION_STORAGE_NAME;
|
|
22
|
+
return new _storage.SavedObject(storage, storageKey);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getSharedTansactionStorage(options) {
|
|
26
|
+
options = this.getOptionsForSection('shared-transaction', options);
|
|
27
|
+
(0, _BaseStorageManager.logServerSideMemoryStorageWarning)(options);
|
|
28
|
+
const storage = this.getStorage(options);
|
|
29
|
+
const storageKey = options.storageKey || _constants.SHARED_TRANSACTION_STORAGE_NAME;
|
|
30
|
+
return new _storage.SavedObject(storage, storageKey);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getOriginalUriStorage(options) {
|
|
34
|
+
options = this.getOptionsForSection('original-uri', options);
|
|
35
|
+
(0, _BaseStorageManager.logServerSideMemoryStorageWarning)(options);
|
|
36
|
+
const storage = this.getStorage(options);
|
|
37
|
+
const storageKey = options.storageKey || _constants.ORIGINAL_URI_STORAGE_NAME;
|
|
38
|
+
return new _storage.SavedObject(storage, storageKey);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","names":["createOAuthStorageManager","OAuthStorageManager","BaseStorageManager","constructor","storageManagerOptions","cookieOptions","storageUtil","getTransactionStorage","options","getOptionsForSection","logServerSideMemoryStorageWarning","storage","getStorage","storageKey","TRANSACTION_STORAGE_NAME","SavedObject","getSharedTansactionStorage","SHARED_TRANSACTION_STORAGE_NAME","getOriginalUriStorage","ORIGINAL_URI_STORAGE_NAME"],"sources":["../../../lib/oidc/storage.ts"],"sourcesContent":["import {\n CookieOptions,\n StorageManagerOptions,\n StorageOptions,\n StorageUtil\n} from '../storage/types';\nimport { BaseStorageManager, logServerSideMemoryStorageWarning } from '../storage/BaseStorageManager';\nimport { TransactionStorage, OAuthTransactionMeta, OAuthStorageManagerInterface, PKCETransactionMeta } from './types';\nimport { SavedObject } from '../storage';\nimport { ORIGINAL_URI_STORAGE_NAME, SHARED_TRANSACTION_STORAGE_NAME, TRANSACTION_STORAGE_NAME } from '../constants';\n\n\nexport function createOAuthStorageManager<M extends OAuthTransactionMeta = PKCETransactionMeta>()\n{\n return class OAuthStorageManager\n extends BaseStorageManager\n implements OAuthStorageManagerInterface<M>\n {\n constructor(storageManagerOptions: StorageManagerOptions, cookieOptions: CookieOptions, storageUtil: StorageUtil) {\n super(storageManagerOptions, cookieOptions, storageUtil);\n }\n\n getTransactionStorage(options?: StorageOptions): TransactionStorage<M> {\n options = this.getOptionsForSection('transaction', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || TRANSACTION_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n\n getSharedTansactionStorage(options?: StorageOptions): TransactionStorage<M> {\n options = this.getOptionsForSection('shared-transaction', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || SHARED_TRANSACTION_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n\n getOriginalUriStorage(options?: StorageOptions): TransactionStorage<M> {\n options = this.getOptionsForSection('original-uri', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || ORIGINAL_URI_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n };\n\n}\n"],"mappings":";;;;AAMA;;AAEA;;AACA;;AAGO,SAASA,yBAAT,GACP;EACE,OAAO,MAAMC,mBAAN,SACGC,sCADH,CAGP;IACEC,WAAW,CAACC,qBAAD,EAA+CC,aAA/C,EAA6EC,WAA7E,EAAuG;MAChH,MAAMF,qBAAN,EAA6BC,aAA7B,EAA4CC,WAA5C;IACD;;IAEDC,qBAAqB,CAACC,OAAD,EAAkD;MACrEA,OAAO,GAAG,KAAKC,oBAAL,CAA0B,aAA1B,EAAyCD,OAAzC,CAAV;MACA,IAAAE,qDAAA,EAAkCF,OAAlC;MACA,MAAMG,OAAO,GAAG,KAAKC,UAAL,CAAgBJ,OAAhB,CAAhB;MACA,MAAMK,UAAU,GAAGL,OAAO,CAACK,UAAR,IAAsBC,mCAAzC;MACA,OAAO,IAAIC,oBAAJ,CAAgBJ,OAAhB,EAAyBE,UAAzB,CAAP;IACD;;IAEDG,0BAA0B,CAACR,OAAD,EAAkD;MAC1EA,OAAO,GAAG,KAAKC,oBAAL,CAA0B,oBAA1B,EAAgDD,OAAhD,CAAV;MACA,IAAAE,qDAAA,EAAkCF,OAAlC;MACA,MAAMG,OAAO,GAAG,KAAKC,UAAL,CAAgBJ,OAAhB,CAAhB;MACA,MAAMK,UAAU,GAAGL,OAAO,CAACK,UAAR,IAAsBI,0CAAzC;MACA,OAAO,IAAIF,oBAAJ,CAAgBJ,OAAhB,EAAyBE,UAAzB,CAAP;IACD;;IAEDK,qBAAqB,CAACV,OAAD,EAAkD;MACrEA,OAAO,GAAG,KAAKC,oBAAL,CAA0B,cAA1B,EAA0CD,OAA1C,CAAV;MACA,IAAAE,qDAAA,EAAkCF,OAAlC;MACA,MAAMG,OAAO,GAAG,KAAKC,UAAL,CAAgBJ,OAAhB,CAAhB;MACA,MAAMK,UAAU,GAAGL,OAAO,CAACK,UAAR,IAAsBM,oCAAzC;MACA,OAAO,IAAIJ,oBAAJ,CAAgBJ,OAAhB,EAAyBE,UAAzB,CAAP;IACD;;EA3BH,CAHA;AAiCD"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JWT.js","names":[],"sources":["../../../../lib/oidc/types/JWT.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 { UserClaims } from './UserClaims';\n\nexport interface JWTHeader {\n alg: string;\n typ?: string;\n kid?: string;\n jku?: string;\n x5u?: string;\n x5t?: string;\n}\n\nexport type JWTPayload = UserClaims & {\n scp?: string[];\n}\n\nexport interface JWTObject {\n header: JWTHeader;\n payload: JWTPayload;\n signature: string;\n}\n"],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Token.js","names":["isToken","obj","accessToken","idToken","refreshToken","Array","isArray","scopes","isAccessToken","isIDToken","isRefreshToken"],"sources":["../../../../lib/oidc/types/Token.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 { UserClaims } from './UserClaims';\n\nexport interface AbstractToken {\n expiresAt: number;\n authorizeUrl: string;\n scopes: string[];\n pendingRemove?: boolean;\n}\n\nexport interface AccessToken extends AbstractToken {\n accessToken: string;\n claims: UserClaims;\n tokenType: string;\n userinfoUrl: string;\n}\n\nexport interface RefreshToken extends AbstractToken {\n refreshToken: string;\n tokenUrl: string;\n issuer: string;\n}\n\nexport interface IDToken extends AbstractToken {\n idToken: string;\n claims: UserClaims;\n issuer: string;\n clientId: string;\n}\n\nexport type Token = AccessToken | IDToken | RefreshToken;\nexport type RevocableToken = AccessToken | RefreshToken;\n\nexport type TokenType = 'accessToken' | 'idToken' | 'refreshToken';\n\nexport function isToken(obj: any): obj is Token {\n if (obj &&\n (obj.accessToken || obj.idToken || obj.refreshToken) &&\n Array.isArray(obj.scopes)) {\n return true;\n }\n return false;\n}\n\nexport function isAccessToken(obj: any): obj is AccessToken {\n return obj && obj.accessToken;\n}\n\nexport function isIDToken(obj: any): obj is IDToken {\n return obj && obj.idToken;\n}\n\nexport function isRefreshToken(obj: any): obj is RefreshToken {\n return obj && obj.refreshToken;\n}\n\nexport interface Tokens {\n accessToken?: AccessToken;\n idToken?: IDToken;\n refreshToken?: RefreshToken;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoCO,SAASA,OAAT,CAAiBC,GAAjB,EAAyC;EAC9C,IAAIA,GAAG,KACFA,GAAG,CAACC,WAAJ,IAAmBD,GAAG,CAACE,OAAvB,IAAkCF,GAAG,CAACG,YADpC,CAAH,IAEAC,KAAK,CAACC,OAAN,CAAcL,GAAG,CAACM,MAAlB,CAFJ,EAE+B;IAC7B,OAAO,IAAP;EACD;;EACD,OAAO,KAAP;AACD;;AAEM,SAASC,aAAT,CAAuBP,GAAvB,EAAqD;EAC1D,OAAOA,GAAG,IAAIA,GAAG,CAACC,WAAlB;AACD;;AAEM,SAASO,SAAT,CAAmBR,GAAnB,EAA6C;EAClD,OAAOA,GAAG,IAAIA,GAAG,CAACE,OAAlB;AACD;;AAEM,SAASO,cAAT,CAAwBT,GAAxB,EAAuD;EAC5D,OAAOA,GAAG,IAAIA,GAAG,CAACG,YAAlB;AACD"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenManager.js","names":["EVENT_EXPIRED","EVENT_RENEWED","EVENT_ADDED","EVENT_REMOVED","EVENT_ERROR","EVENT_SET_STORAGE"],"sources":["../../../../lib/oidc/types/TokenManager.ts"],"sourcesContent":["/* eslint-disable max-len */\nimport { StorageProvider } from '../../storage/types';\nimport { TokenManagerOptions } from './options';\nimport { AccessToken, IDToken, RefreshToken, Token, Tokens, TokenType } from './Token';\n\nexport interface TokenManagerError {\n errorSummary: string;\n errorCode: string;\n message: string;\n name: string;\n tokenKey: string;\n}\n\nexport declare type AccessTokenCallback = (key: string, token: AccessToken) => void;\nexport declare type IDTokenCallback = (key: string, token: IDToken) => void;\nexport declare type RefreshTokenCallback = (key: string, token: RefreshToken) => void;\n\nexport const EVENT_EXPIRED = 'expired';\nexport const EVENT_RENEWED = 'renewed';\nexport const EVENT_ADDED = 'added';\nexport const EVENT_REMOVED = 'removed';\nexport const EVENT_ERROR = 'error';\nexport const EVENT_SET_STORAGE = 'set_storage';\n\nexport declare type TokenManagerErrorEventHandler = (error: TokenManagerError) => void;\nexport declare type TokenManagerEventHandler = (key: string, token: Token) => void;\nexport declare type TokenManagerRenewEventHandler = (key: string, token: Token, oldtoken: Token) => void;\nexport declare type TokenManagerSetStorageEventHandler = (storage: Tokens) => void;\n\nexport declare type TokenManagerAnyEventHandler = TokenManagerErrorEventHandler | TokenManagerRenewEventHandler | TokenManagerSetStorageEventHandler | TokenManagerEventHandler;\nexport declare type TokenManagerAnyEvent = typeof EVENT_RENEWED | typeof EVENT_ERROR | typeof EVENT_SET_STORAGE | typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED;\n\n// only add methods needed internally\nexport interface TokenManagerInterface {\n on(event: typeof EVENT_RENEWED, handler: TokenManagerRenewEventHandler, context?: object): void;\n on(event: typeof EVENT_ERROR, handler: TokenManagerErrorEventHandler, context?: object): void;\n on(event: typeof EVENT_SET_STORAGE, handler: TokenManagerSetStorageEventHandler, context?: object): void;\n on(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler: TokenManagerEventHandler, context?: object): void;\n\n off(event: typeof EVENT_RENEWED, handler?: TokenManagerRenewEventHandler): void;\n off(event: typeof EVENT_ERROR, handler?: TokenManagerErrorEventHandler): void;\n off(event: typeof EVENT_SET_STORAGE, handler?: TokenManagerSetStorageEventHandler): void;\n off(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler?: TokenManagerEventHandler): void;\n\n clear(): void;\n setExpireEventTimeout(key: string, token: Token): void;\n clearExpireEventTimeout(key: string): void;\n clearExpireEventTimeoutAll(): void;\n emitAdded(key: string, token: Token): void;\n emitError(error: Error): void;\n emitRemoved(key: string, token: Token): void;\n emitRenewed(key: string, token: Token, oldToken?: Token): void;\n renew(key: string): Promise<Token | undefined>;\n remove(key: string): void;\n hasExpired(token: Token): boolean;\n getExpireTime(token: Token): number;\n\n get(key): Promise<Token>;\n getSync(key): Token;\n getTokens(): Promise<Tokens>;\n getTokensSync(): Tokens;\n setTokens({ accessToken, idToken, refreshToken }: Tokens, accessTokenCb?: AccessTokenCallback, idTokenCb?: IDTokenCallback, refreshTokenCb?: RefreshTokenCallback): void;\n getStorageKeyByType(type: TokenType): string;\n add(key: any, token: Token): void;\n updateRefreshToken(token: RefreshToken);\n removeRefreshToken(): void;\n clearPendingRemoveTokens(): void;\n\n getOptions(): TokenManagerOptions;\n getStorage(): StorageProvider;\n\n start();\n stop();\n}\n"],"mappings":";;;;AAAA;AAiBO,MAAMA,aAAa,GAAG,SAAtB;;AACA,MAAMC,aAAa,GAAG,SAAtB;;AACA,MAAMC,WAAW,GAAG,OAApB;;AACA,MAAMC,aAAa,GAAG,SAAtB;;AACA,MAAMC,WAAW,GAAG,OAApB;;AACA,MAAMC,iBAAiB,GAAG,aAA1B"}
|