@okta/okta-auth-js 7.0.1 → 7.1.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/README.md +2 -0
- package/cjs/authn/AuthnTransactionImpl.js +6 -8
- package/cjs/authn/AuthnTransactionImpl.js.map +1 -1
- package/cjs/authn/api.js +3 -18
- package/cjs/authn/api.js.map +1 -1
- package/cjs/authn/factory.js +1 -7
- package/cjs/authn/factory.js.map +1 -1
- package/cjs/authn/index.js +0 -5
- package/cjs/authn/index.js.map +1 -1
- package/cjs/authn/mixin.js +14 -22
- package/cjs/authn/mixin.js.map +1 -1
- package/cjs/authn/util/flattenEmbedded.js +5 -12
- package/cjs/authn/util/flattenEmbedded.js.map +1 -1
- package/cjs/authn/util/link2fn.js +0 -22
- package/cjs/authn/util/link2fn.js.map +1 -1
- package/cjs/authn/util/links2fns.js +0 -12
- package/cjs/authn/util/links2fns.js.map +1 -1
- package/cjs/authn/util/poll.js +9 -27
- package/cjs/authn/util/poll.js.map +1 -1
- package/cjs/authn/util/stateToken.js +3 -4
- package/cjs/authn/util/stateToken.js.map +1 -1
- package/cjs/base/factory.js +6 -14
- package/cjs/base/factory.js.map +1 -1
- package/cjs/base/index.js +0 -5
- package/cjs/base/index.js.map +1 -1
- package/cjs/base/options.js +1 -2
- package/cjs/base/options.js.map +1 -1
- package/cjs/browser/browserStorage.js +15 -43
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/browser/fingerprint.js +3 -15
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/clock.js +5 -7
- package/cjs/clock.js.map +1 -1
- package/cjs/constants.js +4 -3
- package/cjs/constants.js.map +1 -1
- package/cjs/core/AuthStateManager.js +24 -48
- package/cjs/core/AuthStateManager.js.map +1 -1
- package/cjs/core/ServiceManager/browser.js +13 -33
- package/cjs/core/ServiceManager/browser.js.map +1 -1
- package/cjs/core/ServiceManager/index.js +0 -1
- package/cjs/core/ServiceManager/index.js.map +1 -1
- package/cjs/core/ServiceManager/node.js +3 -9
- package/cjs/core/ServiceManager/node.js.map +1 -1
- package/cjs/core/factory.js +0 -7
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/index.js +0 -13
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/mixin.js +16 -20
- package/cjs/core/mixin.js.map +1 -1
- package/cjs/core/options.js +1 -3
- package/cjs/core/options.js.map +1 -1
- package/cjs/core/storage.js +0 -2
- package/cjs/core/storage.js.map +1 -1
- package/cjs/core/types/index.js +0 -5
- package/cjs/core/types/index.js.map +1 -1
- package/cjs/crypto/base64.js +9 -22
- package/cjs/crypto/base64.js.map +1 -1
- package/cjs/crypto/browser.js +0 -4
- package/cjs/crypto/browser.js.map +1 -1
- package/cjs/crypto/index.js +0 -9
- package/cjs/crypto/index.js.map +1 -1
- package/cjs/crypto/node.js +0 -13
- package/cjs/crypto/node.js.map +1 -1
- package/cjs/crypto/oidcHash.js +1 -4
- package/cjs/crypto/oidcHash.js.map +1 -1
- package/cjs/crypto/verifyToken.js +6 -7
- package/cjs/crypto/verifyToken.js.map +1 -1
- package/cjs/crypto/webcrypto.js +0 -1
- package/cjs/crypto/webcrypto.js.map +1 -1
- package/cjs/errors/AuthApiError.js +1 -7
- package/cjs/errors/AuthApiError.js.map +1 -1
- package/cjs/errors/AuthPollStopError.js +1 -5
- package/cjs/errors/AuthPollStopError.js.map +1 -1
- package/cjs/errors/AuthSdkError.js +1 -6
- package/cjs/errors/AuthSdkError.js.map +1 -1
- package/cjs/errors/CustomError.js +1 -4
- package/cjs/errors/CustomError.js.map +1 -1
- package/cjs/errors/OAuthError.js +4 -7
- package/cjs/errors/OAuthError.js.map +1 -1
- package/cjs/errors/index.js +1 -9
- package/cjs/errors/index.js.map +1 -1
- package/cjs/exports/authn.js +0 -9
- package/cjs/exports/authn.js.map +1 -1
- package/cjs/exports/cdn/authn.js +0 -2
- package/cjs/exports/cdn/authn.js.map +1 -1
- package/cjs/exports/cdn/core.js +0 -2
- package/cjs/exports/cdn/core.js.map +1 -1
- package/cjs/exports/cdn/default.js +0 -2
- package/cjs/exports/cdn/default.js.map +1 -1
- package/cjs/exports/cdn/idx.js +0 -2
- package/cjs/exports/cdn/idx.js.map +1 -1
- package/cjs/exports/cdn/myaccount.js +0 -2
- package/cjs/exports/cdn/myaccount.js.map +1 -1
- package/cjs/exports/common.js +0 -22
- package/cjs/exports/common.js.map +1 -1
- package/cjs/exports/core.js +0 -9
- package/cjs/exports/core.js.map +1 -1
- package/cjs/exports/default.js +2 -12
- package/cjs/exports/default.js.map +1 -1
- package/cjs/exports/idx.js +3 -7
- package/cjs/exports/idx.js.map +1 -1
- package/cjs/exports/myaccount.js +0 -9
- package/cjs/exports/myaccount.js.map +1 -1
- package/cjs/features.js +1 -18
- package/cjs/features.js.map +1 -1
- package/cjs/fetch/fetchRequest.js +6 -20
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/OktaUserAgent.js +3 -11
- package/cjs/http/OktaUserAgent.js.map +1 -1
- package/cjs/http/headers.js +1 -1
- package/cjs/http/headers.js.map +1 -1
- package/cjs/http/index.js +0 -11
- package/cjs/http/index.js.map +1 -1
- package/cjs/http/mixin.js +2 -10
- package/cjs/http/mixin.js.map +1 -1
- package/cjs/http/options.js +1 -5
- package/cjs/http/options.js.map +1 -1
- package/cjs/http/request.js +75 -57
- package/cjs/http/request.js.map +1 -1
- package/cjs/idx/IdxTransactionManager.js +2 -22
- package/cjs/idx/IdxTransactionManager.js.map +1 -1
- package/cjs/idx/authenticate.js +3 -5
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +2 -4
- package/cjs/idx/authenticator/Authenticator.js.map +1 -1
- package/cjs/idx/authenticator/OktaPassword.js +2 -10
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
- package/cjs/idx/authenticator/OktaVerifyTotp.js +0 -6
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +0 -10
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +1 -10
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +2 -10
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnEnrollment.js +0 -8
- package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnVerification.js +0 -8
- package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
- package/cjs/idx/authenticator/getAuthenticator.js +0 -15
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/index.js +0 -15
- package/cjs/idx/authenticator/index.js.map +1 -1
- package/cjs/idx/authenticator/util.js +8 -18
- package/cjs/idx/authenticator/util.js.map +1 -1
- package/cjs/idx/cancel.js +3 -4
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/emailVerify.js +5 -13
- package/cjs/idx/emailVerify.js.map +1 -1
- package/cjs/idx/factory/OktaAuthIdx.js +0 -3
- package/cjs/idx/factory/OktaAuthIdx.js.map +1 -1
- package/cjs/idx/factory/api.js +1 -17
- package/cjs/idx/factory/api.js.map +1 -1
- package/cjs/idx/factory/index.js +0 -3
- package/cjs/idx/factory/index.js.map +1 -1
- package/cjs/idx/flow/AccountUnlockFlow.js +1 -2
- package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +1 -2
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js +2 -13
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/PasswordRecoveryFlow.js +1 -2
- package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js +1 -2
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js +0 -11
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/handleInteractionCodeRedirect.js +7 -12
- package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/cjs/idx/idxState/index.js +1 -11
- package/cjs/idx/idxState/index.js.map +1 -1
- package/cjs/idx/idxState/v1/actionParser.js +1 -12
- package/cjs/idx/idxState/v1/actionParser.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js +10 -15
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +7 -23
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js +2 -10
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/idxState/v1/parsers.js +0 -2
- package/cjs/idx/idxState/v1/parsers.js.map +1 -1
- package/cjs/idx/idxState/v1/remediationParser.js +2 -4
- package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
- package/cjs/idx/index.js +0 -26
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +18 -18
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +5 -14
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/mixin.js +0 -9
- package/cjs/idx/mixin.js.map +1 -1
- package/cjs/idx/options.js +2 -3
- package/cjs/idx/options.js.map +1 -1
- package/cjs/idx/poll.js +1 -10
- package/cjs/idx/poll.js.map +1 -1
- package/cjs/idx/proceed.js +3 -9
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/recoverPassword.js +3 -4
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js +5 -11
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +24 -45
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +7 -16
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +7 -15
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -22
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +38 -67
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +13 -30
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +5 -13
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengeAuthenticator.js +1 -5
- package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengePoll.js +1 -6
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollAuthenticator.js +1 -5
- package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +5 -12
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js +8 -30
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +5 -13
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js +13 -19
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/index.js +0 -1
- package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/util.js +19 -31
- package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -1
- package/cjs/idx/remediators/Identify.js +3 -12
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +3 -10
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/RedirectIdp.js +1 -7
- package/cjs/idx/remediators/RedirectIdp.js.map +1 -1
- package/cjs/idx/remediators/ResetAuthenticator.js +1 -5
- package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +3 -11
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +1 -5
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +6 -15
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollProfile.js +1 -6
- package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +5 -16
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +1 -6
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +0 -39
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js +1 -7
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +37 -52
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js +1 -2
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/storage.js +3 -22
- package/cjs/idx/storage.js.map +1 -1
- package/cjs/idx/transactionMeta.js +24 -42
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/api.js +1 -9
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/idx-js.js +3 -3
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +0 -7
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/types/meta.js.map +1 -1
- package/cjs/idx/types/options.js.map +1 -1
- package/cjs/idx/unlockAccount.js +7 -11
- package/cjs/idx/unlockAccount.js.map +1 -1
- package/cjs/idx/util.js +24 -76
- package/cjs/idx/util.js.map +1 -1
- package/cjs/idx/webauthn.js +13 -18
- package/cjs/idx/webauthn.js.map +1 -1
- package/cjs/myaccount/api.js +0 -5
- package/cjs/myaccount/api.js.map +1 -1
- package/cjs/myaccount/emailApi.js +6 -21
- package/cjs/myaccount/emailApi.js.map +1 -1
- package/cjs/myaccount/factory.js +0 -3
- package/cjs/myaccount/factory.js.map +1 -1
- package/cjs/myaccount/index.js +0 -7
- package/cjs/myaccount/index.js.map +1 -1
- package/cjs/myaccount/mixin.js +0 -5
- package/cjs/myaccount/mixin.js.map +1 -1
- package/cjs/myaccount/phoneApi.js +5 -18
- package/cjs/myaccount/phoneApi.js.map +1 -1
- package/cjs/myaccount/profileApi.js +2 -9
- package/cjs/myaccount/profileApi.js.map +1 -1
- package/cjs/myaccount/request.js +12 -78
- package/cjs/myaccount/request.js.map +1 -1
- package/cjs/myaccount/transactions/Base.js +5 -7
- package/cjs/myaccount/transactions/Base.js.map +1 -1
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js +5 -10
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/EmailStatusTransaction.js +2 -7
- package/cjs/myaccount/transactions/EmailStatusTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/EmailTransaction.js +5 -13
- package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/PhoneTransaction.js +5 -12
- package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js +0 -5
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/ProfileTransaction.js +0 -5
- package/cjs/myaccount/transactions/ProfileTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/index.js +0 -8
- package/cjs/myaccount/transactions/index.js.map +1 -1
- package/cjs/myaccount/types.js +0 -5
- package/cjs/myaccount/types.js.map +1 -1
- package/cjs/oidc/TokenManager.js +39 -100
- package/cjs/oidc/TokenManager.js.map +1 -1
- package/cjs/oidc/TransactionManager.js +19 -26
- package/cjs/oidc/TransactionManager.js.map +1 -1
- package/cjs/oidc/decodeToken.js +1 -5
- package/cjs/oidc/decodeToken.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +9 -13
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/endpoints/index.js +0 -5
- package/cjs/oidc/endpoints/index.js.map +1 -1
- package/cjs/oidc/endpoints/token.js +5 -17
- package/cjs/oidc/endpoints/token.js.map +1 -1
- package/cjs/oidc/endpoints/well-known.js +7 -14
- package/cjs/oidc/endpoints/well-known.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js +7 -12
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/oidc/factory/OktaAuthOAuth.js +0 -6
- package/cjs/oidc/factory/OktaAuthOAuth.js.map +1 -1
- package/cjs/oidc/factory/api.js +6 -20
- package/cjs/oidc/factory/api.js.map +1 -1
- package/cjs/oidc/factory/index.js +0 -3
- package/cjs/oidc/factory/index.js.map +1 -1
- package/cjs/oidc/getToken.js +18 -30
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getUserInfo.js +1 -15
- package/cjs/oidc/getUserInfo.js.map +1 -1
- package/cjs/oidc/getWithPopup.js +4 -8
- package/cjs/oidc/getWithPopup.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js +1 -8
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/getWithoutPrompt.js +1 -5
- package/cjs/oidc/getWithoutPrompt.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js +23 -40
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/index.js +0 -32
- package/cjs/oidc/index.js.map +1 -1
- package/cjs/oidc/mixin/browser.js +6 -18
- package/cjs/oidc/mixin/browser.js.map +1 -1
- package/cjs/oidc/mixin/index.js +37 -89
- package/cjs/oidc/mixin/index.js.map +1 -1
- package/cjs/oidc/mixin/node.js +2 -9
- package/cjs/oidc/mixin/node.js.map +1 -1
- package/cjs/oidc/options/OAuthOptionsConstructor.js +17 -24
- package/cjs/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/cjs/oidc/options/browser.js.map +1 -1
- package/cjs/oidc/options/index.js +0 -1
- package/cjs/oidc/options/index.js.map +1 -1
- package/cjs/oidc/options/node.js.map +1 -1
- package/cjs/oidc/parseFromUrl.js +1 -32
- package/cjs/oidc/parseFromUrl.js.map +1 -1
- package/cjs/oidc/renewToken.js +5 -16
- package/cjs/oidc/renewToken.js.map +1 -1
- package/cjs/oidc/renewTokens.js +3 -15
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/renewTokensWithRefresh.js +3 -13
- package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
- package/cjs/oidc/revokeToken.js +3 -14
- package/cjs/oidc/revokeToken.js.map +1 -1
- package/cjs/oidc/storage.js +0 -8
- package/cjs/oidc/storage.js.map +1 -1
- package/cjs/oidc/types/Token.js +1 -5
- package/cjs/oidc/types/Token.js.map +1 -1
- package/cjs/oidc/types/TokenManager.js +1 -1
- package/cjs/oidc/types/TokenManager.js.map +1 -1
- package/cjs/oidc/types/Transaction.js +1 -12
- package/cjs/oidc/types/Transaction.js.map +1 -1
- package/cjs/oidc/types/UserClaims.js.map +1 -1
- package/cjs/oidc/types/api.js.map +1 -1
- package/cjs/oidc/types/index.js +0 -21
- package/cjs/oidc/types/index.js.map +1 -1
- package/cjs/oidc/types/meta.js.map +1 -1
- package/cjs/oidc/types/options.js.map +1 -1
- package/cjs/oidc/types/proto.js.map +1 -1
- package/cjs/oidc/util/browser.js +4 -13
- package/cjs/oidc/util/browser.js.map +1 -1
- package/cjs/oidc/util/defaultTokenParams.js +5 -5
- package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
- package/cjs/oidc/util/errors.js +3 -8
- package/cjs/oidc/util/errors.js.map +1 -1
- package/cjs/oidc/util/index.js +0 -24
- package/cjs/oidc/util/index.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +11 -25
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/oauth.js +3 -12
- package/cjs/oidc/util/oauth.js.map +1 -1
- package/cjs/oidc/util/oauthMeta.js +5 -6
- package/cjs/oidc/util/oauthMeta.js.map +1 -1
- package/cjs/oidc/util/pkce.js +1 -12
- package/cjs/oidc/util/pkce.js.map +1 -1
- package/cjs/oidc/util/prepareTokenParams.js +13 -26
- package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
- package/cjs/oidc/util/refreshToken.js +0 -7
- package/cjs/oidc/util/refreshToken.js.map +1 -1
- package/cjs/oidc/util/sharedStorage.js +0 -8
- package/cjs/oidc/util/sharedStorage.js.map +1 -1
- package/cjs/oidc/util/urlParams.js +9 -12
- package/cjs/oidc/util/urlParams.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js +9 -17
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/util/validateToken.js +1 -6
- package/cjs/oidc/util/validateToken.js.map +1 -1
- package/cjs/oidc/verifyToken.js +13 -23
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/server/serverStorage.js +9 -27
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/AutoRenewService.js +1 -17
- package/cjs/services/AutoRenewService.js.map +1 -1
- package/cjs/services/LeaderElectionService.js +1 -23
- package/cjs/services/LeaderElectionService.js.map +1 -1
- package/cjs/services/SyncStorageService.js +3 -37
- package/cjs/services/SyncStorageService.js.map +1 -1
- package/cjs/services/index.js +0 -5
- package/cjs/services/index.js.map +1 -1
- package/cjs/session/api.js +1 -12
- package/cjs/session/api.js.map +1 -1
- package/cjs/session/factory.js +0 -2
- package/cjs/session/factory.js.map +1 -1
- package/cjs/session/index.js +0 -7
- package/cjs/session/index.js.map +1 -1
- package/cjs/session/mixin.js +2 -6
- package/cjs/session/mixin.js.map +1 -1
- package/cjs/storage/BaseStorageManager.js +13 -25
- package/cjs/storage/BaseStorageManager.js.map +1 -1
- package/cjs/storage/SavedObject.js +7 -19
- package/cjs/storage/SavedObject.js.map +1 -1
- package/cjs/storage/index.js +0 -9
- package/cjs/storage/index.js.map +1 -1
- package/cjs/storage/mixin.js +2 -4
- package/cjs/storage/mixin.js.map +1 -1
- package/cjs/storage/options/StorageOptionsConstructor.js +3 -6
- package/cjs/storage/options/StorageOptionsConstructor.js.map +1 -1
- package/cjs/storage/options/browser.js +7 -15
- package/cjs/storage/options/browser.js.map +1 -1
- package/cjs/storage/options/node.js +3 -6
- package/cjs/storage/options/node.js.map +1 -1
- package/cjs/util/PromiseQueue.js +7 -15
- package/cjs/util/PromiseQueue.js.map +1 -1
- package/cjs/util/console.js +3 -7
- package/cjs/util/console.js.map +1 -1
- package/cjs/util/index.js +0 -11
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/misc.js +3 -8
- package/cjs/util/misc.js.map +1 -1
- package/cjs/util/object.js +9 -23
- package/cjs/util/object.js.map +1 -1
- package/cjs/util/types.js +1 -5
- package/cjs/util/types.js.map +1 -1
- package/cjs/util/url.js +5 -14
- package/cjs/util/url.js.map +1 -1
- package/dist/okta-auth-js.authn.min.analyzer.html +3 -3
- package/dist/okta-auth-js.authn.min.js +1 -1
- package/dist/okta-auth-js.authn.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.authn.min.js.map +1 -1
- package/dist/okta-auth-js.core.min.analyzer.html +3 -3
- package/dist/okta-auth-js.core.min.js +1 -1
- package/dist/okta-auth-js.core.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.core.min.js.map +1 -1
- package/dist/okta-auth-js.idx.min.analyzer.html +3 -3
- package/dist/okta-auth-js.idx.min.js +1 -1
- package/dist/okta-auth-js.idx.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.idx.min.js.map +1 -1
- package/dist/okta-auth-js.min.analyzer.html +3 -3
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.myaccount.min.analyzer.html +3 -3
- package/dist/okta-auth-js.myaccount.min.js +1 -1
- package/dist/okta-auth-js.myaccount.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.myaccount.min.js.map +1 -1
- package/dist/okta-auth-js.polyfill.js +1 -1
- package/dist/okta-auth-js.polyfill.js.map +1 -1
- package/esm/browser/http/OktaUserAgent.js +2 -2
- package/esm/browser/http/request.js +56 -23
- package/esm/browser/http/request.js.map +1 -1
- package/esm/browser/idx/interact.js +2 -2
- package/esm/browser/idx/interact.js.map +1 -1
- package/esm/browser/idx/run.js +2 -1
- package/esm/browser/idx/run.js.map +1 -1
- package/esm/browser/idx/transactionMeta.js +3 -2
- package/esm/browser/idx/transactionMeta.js.map +1 -1
- package/esm/browser/myaccount/request.js +2 -43
- package/esm/browser/myaccount/request.js.map +1 -1
- package/esm/browser/oidc/endpoints/authorize.js +1 -0
- package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
- package/esm/browser/oidc/exchangeCodeForTokens.js +2 -1
- package/esm/browser/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/browser/oidc/handleOAuthResponse.js +17 -16
- package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js +2 -0
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/esm/browser/oidc/util/defaultTokenParams.js +3 -1
- package/esm/browser/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/browser/oidc/util/oauthMeta.js +1 -0
- package/esm/browser/oidc/util/oauthMeta.js.map +1 -1
- package/esm/browser/oidc/util/validateClaims.js +9 -4
- package/esm/browser/oidc/util/validateClaims.js.map +1 -1
- package/esm/browser/oidc/verifyToken.js +2 -2
- package/esm/browser/oidc/verifyToken.js.map +1 -1
- package/esm/browser/package.json +1 -1
- package/esm/node/http/OktaUserAgent.js +2 -2
- package/esm/node/http/request.js +56 -23
- package/esm/node/http/request.js.map +1 -1
- package/esm/node/idx/interact.js +2 -2
- package/esm/node/idx/interact.js.map +1 -1
- package/esm/node/idx/run.js +2 -1
- package/esm/node/idx/run.js.map +1 -1
- package/esm/node/idx/transactionMeta.js +3 -2
- package/esm/node/idx/transactionMeta.js.map +1 -1
- package/esm/node/myaccount/request.js +2 -43
- package/esm/node/myaccount/request.js.map +1 -1
- package/esm/node/oidc/endpoints/authorize.js +1 -0
- package/esm/node/oidc/endpoints/authorize.js.map +1 -1
- package/esm/node/oidc/exchangeCodeForTokens.js +2 -1
- package/esm/node/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/node/oidc/handleOAuthResponse.js +17 -16
- package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/node/oidc/options/OAuthOptionsConstructor.js +2 -0
- package/esm/node/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/esm/node/oidc/util/defaultTokenParams.js +3 -1
- package/esm/node/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/node/oidc/util/oauthMeta.js +1 -0
- package/esm/node/oidc/util/oauthMeta.js.map +1 -1
- package/esm/node/oidc/util/validateClaims.js +9 -4
- package/esm/node/oidc/util/validateClaims.js.map +1 -1
- package/esm/node/oidc/verifyToken.js +2 -2
- package/esm/node/oidc/verifyToken.js.map +1 -1
- package/esm/node/package.json +1 -1
- package/package.json +12 -13
- package/polyfill/index.js +8 -5
- package/types/lib/core/options.d.ts +2 -0
- package/types/lib/idx/interact.d.ts +1 -0
- package/types/lib/idx/options.d.ts +2 -0
- package/types/lib/idx/types/meta.d.ts +1 -0
- package/types/lib/idx/types/options.d.ts +1 -0
- package/types/lib/oidc/options/OAuthOptionsConstructor.d.ts +2 -0
- package/types/lib/oidc/types/UserClaims.d.ts +1 -0
- package/types/lib/oidc/types/api.d.ts +1 -0
- package/types/lib/oidc/types/meta.d.ts +1 -1
- package/types/lib/oidc/types/options.d.ts +2 -1
- package/types/lib/oidc/types/proto.d.ts +1 -0
- package/umd/authn.js +1 -1
- package/umd/authn.js.LICENSE.txt +2 -0
- package/umd/authn.js.map +1 -1
- package/umd/core.js +1 -1
- package/umd/core.js.LICENSE.txt +2 -0
- package/umd/core.js.map +1 -1
- package/umd/default.js +1 -1
- package/umd/default.js.LICENSE.txt +2 -0
- package/umd/default.js.map +1 -1
- package/umd/idx.js +1 -1
- package/umd/idx.js.LICENSE.txt +2 -0
- package/umd/idx.js.map +1 -1
- package/umd/myaccount.js +1 -1
- package/umd/myaccount.js.LICENSE.txt +2 -0
- package/umd/myaccount.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyAuthenticator.js","names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getAuthenticator","getNextStep","authClient","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator<T extends VerifyAuthenticatorValues = VerifyAuthenticatorValues>\n extends Remediator<T> {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(authClient, context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {} as T);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerifyAuthenticator.js","names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getAuthenticator","getNextStep","authClient","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator<T extends VerifyAuthenticatorValues = VerifyAuthenticatorValues>\n extends Remediator<T> {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(authClient, context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {} as T);\n }\n}\n"],"mappings":";;;AAaA;AACA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,MAAMA,mBAAmB,SACtBC,sBAAU,CAAI;EAItBC,WAAW,CAACC,WAA2B,EAAEC,MAAS,GAAG,CAAC,CAAM,EAAE;IAC5D,KAAK,CAACD,WAAW,EAAEC,MAAM,CAAC;IAC1B,IAAI,CAACC,aAAa,GAAG,IAAAC,+BAAgB,EAACH,WAAW,CAAC;EACpD;EAEAI,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;IAAA;IAC5E,MAAMC,QAAQ,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACvD,MAAME,wBAAwB,GAAGF,OAAO,aAAPA,OAAO,gDAAPA,OAAO,CAAEE,wBAAwB,0DAAjC,sBAAmCC,KAAK;IAEzE,OAAO;MACL,GAAGF,QAAQ;MACXC;IACF,CAAC;EACH;EAEAE,YAAY,GAAG;IACb,OAAO,IAAI,CAACR,aAAa,CAACS,SAAS,CAAC,IAAI,CAACV,MAAM,CAAC;EAClD;EAEAW,cAAc,GAAG;IACf,OAAO,IAAI,CAACV,aAAa,CAACU,cAAc,CAAC,IAAI,CAACX,MAAM,CAAC;EACvD;EAEAY,mBAAmB,CAACC,KAAK,EAAE;IACzB,OAAO,IAAI,CAACZ,aAAa,CAACa,SAAS,CAACD,KAAK,CAAC;EAC5C;EAEAE,qBAAqB,GAAM;IACzB,IAAI,CAACf,MAAM,GAAG,KAAK,CAACe,qBAAqB,EAAE;IAC3C,IAAIC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAAClB,MAAM,CAAC,CAACmB,MAAM,CAACC,QAAQ,IAAIA,QAAQ,KAAK,aAAa,CAAC;IAC3F,OAAOJ,aAAa,CAACK,MAAM,CAAC,CAACrB,MAAM,EAAEoB,QAAQ,MAAM;MAAC,GAAGpB,MAAM;MAAE,CAACoB,QAAQ,GAAG,IAAI,CAACpB,MAAM,CAACoB,QAAQ;IAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAM;EAC9G;AACF;AAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.ChallengeAuthenticator = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _VerifyAuthenticator = require("./Base/VerifyAuthenticator");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,8 +15,8 @@ var _VerifyAuthenticator = require("./Base/VerifyAuthenticator");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
22
|
-
class ChallengeAuthenticator extends _VerifyAuthenticator.VerifyAuthenticator {}
|
|
23
18
|
|
|
19
|
+
class ChallengeAuthenticator extends _VerifyAuthenticator.VerifyAuthenticator {}
|
|
24
20
|
exports.ChallengeAuthenticator = ChallengeAuthenticator;
|
|
25
21
|
(0, _defineProperty2.default)(ChallengeAuthenticator, "remediationName", 'challenge-authenticator');
|
|
26
22
|
//# sourceMappingURL=ChallengeAuthenticator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChallengeAuthenticator.js","names":["ChallengeAuthenticator","VerifyAuthenticator"],"sources":["../../../../lib/idx/remediators/ChallengeAuthenticator.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 { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type ChallengeAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class ChallengeAuthenticator extends VerifyAuthenticator<ChallengeAuthenticatorValues> {\n static remediationName = 'challenge-authenticator';\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChallengeAuthenticator.js","names":["ChallengeAuthenticator","VerifyAuthenticator"],"sources":["../../../../lib/idx/remediators/ChallengeAuthenticator.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 { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type ChallengeAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class ChallengeAuthenticator extends VerifyAuthenticator<ChallengeAuthenticatorValues> {\n static remediationName = 'challenge-authenticator';\n}\n"],"mappings":";;;;;AAYA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,sBAAsB,SAASC,wCAAmB,CAA+B;AAE7F;AAAA,8BAFYD,sBAAsB,qBACR,yBAAyB"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.ChallengePoll = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _EnrollPoll = require("./EnrollPoll");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,13 +15,12 @@ var _EnrollPoll = require("./EnrollPoll");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
18
|
+
|
|
22
19
|
class ChallengePoll extends _EnrollPoll.EnrollPoll {
|
|
23
20
|
canRemediate() {
|
|
24
21
|
return !!this.values.startPolling || this.options.step === 'challenge-poll';
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
exports.ChallengePoll = ChallengePoll;
|
|
30
25
|
(0, _defineProperty2.default)(ChallengePoll, "remediationName", 'challenge-poll');
|
|
31
26
|
//# sourceMappingURL=ChallengePoll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChallengePoll.js","names":["ChallengePoll","EnrollPoll","canRemediate","values","startPolling","options","step"],"sources":["../../../../lib/idx/remediators/ChallengePoll.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 { EnrollPoll } from './EnrollPoll';\n\nexport class ChallengePoll extends EnrollPoll{\n static remediationName = 'challenge-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'challenge-poll';\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChallengePoll.js","names":["ChallengePoll","EnrollPoll","canRemediate","values","startPolling","options","step"],"sources":["../../../../lib/idx/remediators/ChallengePoll.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 { EnrollPoll } from './EnrollPoll';\n\nexport class ChallengePoll extends EnrollPoll{\n static remediationName = 'challenge-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'challenge-poll';\n }\n}\n"],"mappings":";;;;;AAYA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,aAAa,SAASC,sBAAU;EAG3CC,YAAY,GAAG;IACb,OAAO,CAAC,CAAC,IAAI,CAACC,MAAM,CAACC,YAAY,IAAI,IAAI,CAACC,OAAO,CAACC,IAAI,KAAK,gBAAgB;EAC7E;AACF;AAAC;AAAA,8BANYN,aAAa,qBACC,gBAAgB"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.EnrollAuthenticator = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _VerifyAuthenticator = require("./Base/VerifyAuthenticator");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,8 +15,8 @@ var _VerifyAuthenticator = require("./Base/VerifyAuthenticator");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
22
|
-
class EnrollAuthenticator extends _VerifyAuthenticator.VerifyAuthenticator {}
|
|
23
18
|
|
|
19
|
+
class EnrollAuthenticator extends _VerifyAuthenticator.VerifyAuthenticator {}
|
|
24
20
|
exports.EnrollAuthenticator = EnrollAuthenticator;
|
|
25
21
|
(0, _defineProperty2.default)(EnrollAuthenticator, "remediationName", 'enroll-authenticator');
|
|
26
22
|
//# sourceMappingURL=EnrollAuthenticator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollAuthenticator.js","names":["EnrollAuthenticator","VerifyAuthenticator"],"sources":["../../../../lib/idx/remediators/EnrollAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type EnrollAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class EnrollAuthenticator extends VerifyAuthenticator<EnrollAuthenticatorValues> {\n static remediationName = 'enroll-authenticator';\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnrollAuthenticator.js","names":["EnrollAuthenticator","VerifyAuthenticator"],"sources":["../../../../lib/idx/remediators/EnrollAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type EnrollAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class EnrollAuthenticator extends VerifyAuthenticator<EnrollAuthenticatorValues> {\n static remediationName = 'enroll-authenticator';\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,MAAMA,mBAAmB,SAASC,wCAAmB,CAA4B;AAEvF;AAAA,8BAFYD,mBAAmB,qBACL,sBAAsB"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.EnrollPoll = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _Remediator = require("./Base/Remediator");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,20 +15,19 @@ var _Remediator = require("./Base/Remediator");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
18
|
+
|
|
22
19
|
class EnrollPoll extends _Remediator.Remediator {
|
|
23
20
|
canRemediate() {
|
|
24
21
|
return !!this.values.startPolling || this.options.step === 'enroll-poll';
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
getNextStep(authClient, context) {
|
|
28
24
|
const common = super.getNextStep(authClient, context);
|
|
29
25
|
let authenticator = this.getAuthenticator();
|
|
30
|
-
|
|
31
26
|
if (!authenticator && context !== null && context !== void 0 && context.currentAuthenticator) {
|
|
32
27
|
authenticator = context.currentAuthenticator.value;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
return {
|
|
30
|
+
...common,
|
|
36
31
|
authenticator,
|
|
37
32
|
poll: {
|
|
38
33
|
required: true,
|
|
@@ -40,16 +35,14 @@ class EnrollPoll extends _Remediator.Remediator {
|
|
|
40
35
|
}
|
|
41
36
|
};
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
getValuesAfterProceed() {
|
|
45
39
|
let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');
|
|
46
|
-
return trimmedValues.reduce((values, valueKey) => ({
|
|
40
|
+
return trimmedValues.reduce((values, valueKey) => ({
|
|
41
|
+
...values,
|
|
47
42
|
[valueKey]: this.values[valueKey]
|
|
48
43
|
}), {});
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
}
|
|
52
|
-
|
|
53
46
|
exports.EnrollPoll = EnrollPoll;
|
|
54
47
|
(0, _defineProperty2.default)(EnrollPoll, "remediationName", 'enroll-poll');
|
|
55
48
|
//# sourceMappingURL=EnrollPoll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollPoll.js","names":["EnrollPoll","Remediator","canRemediate","values","startPolling","options","step","getNextStep","authClient","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep, OktaAuthIdxInterface } from '../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator<EnrollPollValues> {\n static remediationName = 'enroll-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const common = super.getNextStep(authClient, context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnrollPoll.js","names":["EnrollPoll","Remediator","canRemediate","values","startPolling","options","step","getNextStep","authClient","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep, OktaAuthIdxInterface } from '../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator<EnrollPollValues> {\n static remediationName = 'enroll-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const common = super.getNextStep(authClient, context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,MAAMA,UAAU,SAASC,sBAAU,CAAmB;EAG3DC,YAAY,GAAG;IACb,OAAO,CAAC,CAAC,IAAI,CAACC,MAAM,CAACC,YAAY,IAAI,IAAI,CAACC,OAAO,CAACC,IAAI,KAAK,aAAa;EAC1E;EAEAC,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;IAC5E,MAAMC,MAAM,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACrD,IAAIE,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;IAC3C,IAAI,CAACD,aAAa,IAAIF,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEI,oBAAoB,EAAE;MACnDF,aAAa,GAAGF,OAAO,CAACI,oBAAoB,CAACC,KAAK;IACpD;IACA,OAAO;MACL,GAAGJ,MAAM;MACTC,aAAa;MACbI,IAAI,EAAE;QACJC,QAAQ,EAAE,IAAI;QACdC,OAAO,EAAE,IAAI,CAACC,WAAW,CAACD;MAC5B;IACF,CAAC;EACH;EAEAE,qBAAqB,GAAqB;IACxC,IAAIC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACnB,MAAM,CAAC,CAACoB,MAAM,CAACC,QAAQ,IAAIA,QAAQ,KAAK,cAAc,CAAC;IAC5F,OAAOJ,aAAa,CAACK,MAAM,CAAC,CAACtB,MAAM,EAAEqB,QAAQ,MAAM;MAAC,GAAGrB,MAAM;MAAE,CAACqB,QAAQ,GAAG,IAAI,CAACrB,MAAM,CAACqB,QAAQ;IAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzG;AACF;AAAC;AAAA,8BA3BYxB,UAAU,qBACI,aAAa"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.EnrollProfile = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _Remediator = require("./Base/Remediator");
|
|
10
|
-
|
|
11
7
|
var _authenticator = require("../authenticator");
|
|
12
|
-
|
|
13
8
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
14
|
-
|
|
15
9
|
/*!
|
|
16
10
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
17
11
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -23,33 +17,30 @@ var _authenticator = require("../authenticator");
|
|
|
23
17
|
*
|
|
24
18
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
25
19
|
*/
|
|
20
|
+
|
|
26
21
|
class EnrollProfile extends _Remediator.Remediator {
|
|
27
22
|
constructor(remediation, values = {}, options = {}) {
|
|
28
|
-
super(remediation, values, options);
|
|
23
|
+
super(remediation, values, options);
|
|
24
|
+
|
|
25
|
+
// credentials are only required when Profile Enrollment policy requires them
|
|
29
26
|
// if credentials are included in the remediation, they are considered required
|
|
30
27
|
// otherwise it will be omitted
|
|
31
|
-
|
|
32
28
|
(0, _defineProperty2.default)(this, "authenticator", null);
|
|
33
29
|
const credentials = this.getCredentialsFromRemediation();
|
|
34
|
-
|
|
35
30
|
if (credentials) {
|
|
36
31
|
this.authenticator = this.authenticator = new _authenticator.OktaPassword({});
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
canRemediate() {
|
|
41
35
|
// ensure credentials can be verified, if required
|
|
42
36
|
if (this.authenticator && !this.authenticator.canVerify(this.values)) {
|
|
43
37
|
return false;
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
const userProfileFromValues = this.getData().userProfile;
|
|
47
|
-
|
|
48
40
|
if (!userProfileFromValues) {
|
|
49
41
|
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line max-len
|
|
53
44
|
const userProfileFromRemediation = this.remediation.value.find(({
|
|
54
45
|
name
|
|
55
46
|
}) => name === 'userProfile');
|
|
@@ -57,17 +48,14 @@ class EnrollProfile extends _Remediator.Remediator {
|
|
|
57
48
|
if (curr.required) {
|
|
58
49
|
canRemediate = canRemediate && !!userProfileFromValues[curr.name];
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
return canRemediate;
|
|
62
52
|
}, true);
|
|
63
53
|
}
|
|
64
|
-
|
|
65
54
|
getCredentialsFromRemediation() {
|
|
66
55
|
return this.remediation.value.find(({
|
|
67
56
|
name
|
|
68
57
|
}) => name === 'credentials');
|
|
69
58
|
}
|
|
70
|
-
|
|
71
59
|
mapUserProfile({
|
|
72
60
|
form: {
|
|
73
61
|
value: profileAttributes
|
|
@@ -76,47 +64,37 @@ class EnrollProfile extends _Remediator.Remediator {
|
|
|
76
64
|
const attributeNames = profileAttributes.map(({
|
|
77
65
|
name
|
|
78
66
|
}) => name);
|
|
79
|
-
const data = attributeNames.reduce((attributeValues, attributeName) => this.values[attributeName] ? {
|
|
67
|
+
const data = attributeNames.reduce((attributeValues, attributeName) => this.values[attributeName] ? {
|
|
68
|
+
...attributeValues,
|
|
80
69
|
[attributeName]: this.values[attributeName]
|
|
81
70
|
} : attributeValues, {});
|
|
82
|
-
|
|
83
71
|
if (Object.keys(data).length === 0) {
|
|
84
72
|
return;
|
|
85
73
|
}
|
|
86
|
-
|
|
87
74
|
return data;
|
|
88
75
|
}
|
|
89
|
-
|
|
90
76
|
mapCredentials() {
|
|
91
77
|
const val = this.authenticator && this.authenticator.mapCredentials(this.values);
|
|
92
|
-
|
|
93
78
|
if (!val) {
|
|
94
79
|
return;
|
|
95
80
|
}
|
|
96
|
-
|
|
97
81
|
return val;
|
|
98
82
|
}
|
|
99
|
-
|
|
100
83
|
getInputUserProfile(input) {
|
|
101
84
|
return [...input.form.value];
|
|
102
85
|
}
|
|
103
|
-
|
|
104
86
|
getInputCredentials(input) {
|
|
105
87
|
return [...input.form.value];
|
|
106
88
|
}
|
|
107
|
-
|
|
108
89
|
getErrorMessages(errorRemediation) {
|
|
109
90
|
return errorRemediation.value[0].form.value.reduce((errors, field) => {
|
|
110
91
|
if (field.messages) {
|
|
111
92
|
errors.push(field.messages.value[0].message);
|
|
112
93
|
}
|
|
113
|
-
|
|
114
94
|
return errors;
|
|
115
95
|
}, []);
|
|
116
96
|
}
|
|
117
|
-
|
|
118
97
|
}
|
|
119
|
-
|
|
120
98
|
exports.EnrollProfile = EnrollProfile;
|
|
121
99
|
(0, _defineProperty2.default)(EnrollProfile, "remediationName", 'enroll-profile');
|
|
122
100
|
//# sourceMappingURL=EnrollProfile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollProfile.js","names":["EnrollProfile","Remediator","constructor","remediation","values","options","credentials","getCredentialsFromRemediation","authenticator","OktaPassword","canRemediate","canVerify","userProfileFromValues","getData","userProfile","userProfileFromRemediation","value","find","name","form","reduce","curr","required","mapUserProfile","profileAttributes","attributeNames","map","data","attributeValues","attributeName","Object","keys","length","mapCredentials","val","getInputUserProfile","input","getInputCredentials","getErrorMessages","errorRemediation","errors","field","messages","push","message"],"sources":["../../../../lib/idx/remediators/EnrollProfile.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\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\n\nimport { IdxRemediation, IdxRemediationValue, IdxAuthenticator } from '../types/idx-js';\nimport { RemediateOptions } from '../types';\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { Authenticator, Credentials, OktaPassword } from '../authenticator';\n\nexport interface EnrollProfileValues extends RemediationValues {\n firstName?: string;\n lastName?: string;\n email?: string;\n credentials?: Credentials;\n password?: string;\n passcode?: string;\n}\n\nexport class EnrollProfile extends Remediator<EnrollProfileValues> {\n static remediationName = 'enroll-profile';\n\n authenticator: Authenticator<any> | null = null;\n\n constructor(\n remediation: IdxRemediation,\n values: EnrollProfileValues = {},\n options: RemediateOptions = {}\n ) {\n super(remediation, values, options);\n\n // credentials are only required when Profile Enrollment policy requires them\n // if credentials are included in the remediation, they are considered required\n // otherwise it will be omitted\n const credentials = this.getCredentialsFromRemediation();\n if (credentials) {\n this.authenticator = this.authenticator = new OktaPassword({} as IdxAuthenticator);\n }\n }\n\n canRemediate() {\n // ensure credentials can be verified, if required\n if (this.authenticator && !this.authenticator.canVerify(this.values)) {\n return false;\n }\n\n const userProfileFromValues = this.getData().userProfile;\n if (!userProfileFromValues) {\n return false;\n }\n // eslint-disable-next-line max-len\n const userProfileFromRemediation = this.remediation.value!.find(({ name }) => name === 'userProfile') as IdxRemediationValue;\n return userProfileFromRemediation.form!.value.reduce((canRemediate, curr) => {\n if (curr.required) {\n canRemediate = canRemediate && !!userProfileFromValues[curr.name];\n }\n return canRemediate;\n }, true);\n }\n\n getCredentialsFromRemediation () {\n return this.remediation.value!.find(({ name }) => name === 'credentials');\n }\n\n mapUserProfile({form: { value: profileAttributes }}) {\n const attributeNames = profileAttributes.map(({name}) => name);\n const data = attributeNames.reduce((attributeValues, attributeName) => (\n this.values[attributeName] ? {\n ...attributeValues,\n [attributeName]: this.values[attributeName]\n } : attributeValues), {});\n if (Object.keys(data).length === 0) {\n return;\n }\n return data;\n }\n\n mapCredentials() {\n const val = this.authenticator && this.authenticator.mapCredentials(this.values);\n if (!val) {\n return;\n }\n return val;\n }\n\n getInputUserProfile(input) {\n return [...input.form.value];\n }\n\n getInputCredentials(input) {\n return [...input.form.value];\n }\n\n getErrorMessages(errorRemediation) {\n return errorRemediation.value[0].form.value.reduce((errors, field) => {\n if (field.messages) {\n errors.push(field.messages.value[0].message);\n }\n return errors;\n }, []);\n }\n}"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnrollProfile.js","names":["EnrollProfile","Remediator","constructor","remediation","values","options","credentials","getCredentialsFromRemediation","authenticator","OktaPassword","canRemediate","canVerify","userProfileFromValues","getData","userProfile","userProfileFromRemediation","value","find","name","form","reduce","curr","required","mapUserProfile","profileAttributes","attributeNames","map","data","attributeValues","attributeName","Object","keys","length","mapCredentials","val","getInputUserProfile","input","getInputCredentials","getErrorMessages","errorRemediation","errors","field","messages","push","message"],"sources":["../../../../lib/idx/remediators/EnrollProfile.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\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\n\nimport { IdxRemediation, IdxRemediationValue, IdxAuthenticator } from '../types/idx-js';\nimport { RemediateOptions } from '../types';\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { Authenticator, Credentials, OktaPassword } from '../authenticator';\n\nexport interface EnrollProfileValues extends RemediationValues {\n firstName?: string;\n lastName?: string;\n email?: string;\n credentials?: Credentials;\n password?: string;\n passcode?: string;\n}\n\nexport class EnrollProfile extends Remediator<EnrollProfileValues> {\n static remediationName = 'enroll-profile';\n\n authenticator: Authenticator<any> | null = null;\n\n constructor(\n remediation: IdxRemediation,\n values: EnrollProfileValues = {},\n options: RemediateOptions = {}\n ) {\n super(remediation, values, options);\n\n // credentials are only required when Profile Enrollment policy requires them\n // if credentials are included in the remediation, they are considered required\n // otherwise it will be omitted\n const credentials = this.getCredentialsFromRemediation();\n if (credentials) {\n this.authenticator = this.authenticator = new OktaPassword({} as IdxAuthenticator);\n }\n }\n\n canRemediate() {\n // ensure credentials can be verified, if required\n if (this.authenticator && !this.authenticator.canVerify(this.values)) {\n return false;\n }\n\n const userProfileFromValues = this.getData().userProfile;\n if (!userProfileFromValues) {\n return false;\n }\n // eslint-disable-next-line max-len\n const userProfileFromRemediation = this.remediation.value!.find(({ name }) => name === 'userProfile') as IdxRemediationValue;\n return userProfileFromRemediation.form!.value.reduce((canRemediate, curr) => {\n if (curr.required) {\n canRemediate = canRemediate && !!userProfileFromValues[curr.name];\n }\n return canRemediate;\n }, true);\n }\n\n getCredentialsFromRemediation () {\n return this.remediation.value!.find(({ name }) => name === 'credentials');\n }\n\n mapUserProfile({form: { value: profileAttributes }}) {\n const attributeNames = profileAttributes.map(({name}) => name);\n const data = attributeNames.reduce((attributeValues, attributeName) => (\n this.values[attributeName] ? {\n ...attributeValues,\n [attributeName]: this.values[attributeName]\n } : attributeValues), {});\n if (Object.keys(data).length === 0) {\n return;\n }\n return data;\n }\n\n mapCredentials() {\n const val = this.authenticator && this.authenticator.mapCredentials(this.values);\n if (!val) {\n return;\n }\n return val;\n }\n\n getInputUserProfile(input) {\n return [...input.form.value];\n }\n\n getInputCredentials(input) {\n return [...input.form.value];\n }\n\n getErrorMessages(errorRemediation) {\n return errorRemediation.value[0].form.value.reduce((errors, field) => {\n if (field.messages) {\n errors.push(field.messages.value[0].message);\n }\n return errors;\n }, []);\n }\n}"],"mappings":";;;;;AAgBA;AACA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBO,MAAMA,aAAa,SAASC,sBAAU,CAAsB;EAKjEC,WAAW,CACTC,WAA2B,EAC3BC,MAA2B,GAAG,CAAC,CAAC,EAChCC,OAAyB,GAAG,CAAC,CAAC,EAC9B;IACA,KAAK,CAACF,WAAW,EAAEC,MAAM,EAAEC,OAAO,CAAC;;IAEnC;IACA;IACA;IAAA,qDAXyC,IAAI;IAY7C,MAAMC,WAAW,GAAG,IAAI,CAACC,6BAA6B,EAAE;IACxD,IAAID,WAAW,EAAE;MACf,IAAI,CAACE,aAAa,GAAG,IAAI,CAACA,aAAa,GAAG,IAAIC,2BAAY,CAAC,CAAC,CAAC,CAAqB;IACpF;EACF;EAEAC,YAAY,GAAG;IACb;IACA,IAAI,IAAI,CAACF,aAAa,IAAI,CAAC,IAAI,CAACA,aAAa,CAACG,SAAS,CAAC,IAAI,CAACP,MAAM,CAAC,EAAE;MACpE,OAAO,KAAK;IACd;IAEA,MAAMQ,qBAAqB,GAAG,IAAI,CAACC,OAAO,EAAE,CAACC,WAAW;IACxD,IAAI,CAACF,qBAAqB,EAAE;MAC1B,OAAO,KAAK;IACd;IACA;IACA,MAAMG,0BAA0B,GAAG,IAAI,CAACZ,WAAW,CAACa,KAAK,CAAEC,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,KAAK,aAAa,CAAwB;IAC5H,OAAOH,0BAA0B,CAACI,IAAI,CAAEH,KAAK,CAACI,MAAM,CAAC,CAACV,YAAY,EAAEW,IAAI,KAAK;MAC3E,IAAIA,IAAI,CAACC,QAAQ,EAAE;QACjBZ,YAAY,GAAGA,YAAY,IAAI,CAAC,CAACE,qBAAqB,CAACS,IAAI,CAACH,IAAI,CAAC;MACnE;MACA,OAAOR,YAAY;IACrB,CAAC,EAAE,IAAI,CAAC;EACV;EAEAH,6BAA6B,GAAI;IAC/B,OAAO,IAAI,CAACJ,WAAW,CAACa,KAAK,CAAEC,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,KAAK,aAAa,CAAC;EAC3E;EAEAK,cAAc,CAAC;IAACJ,IAAI,EAAE;MAAEH,KAAK,EAAEQ;IAAkB;EAAC,CAAC,EAAE;IACnD,MAAMC,cAAc,GAAGD,iBAAiB,CAACE,GAAG,CAAC,CAAC;MAACR;IAAI,CAAC,KAAKA,IAAI,CAAC;IAC9D,MAAMS,IAAI,GAAGF,cAAc,CAACL,MAAM,CAAC,CAACQ,eAAe,EAAEC,aAAa,KAChE,IAAI,CAACzB,MAAM,CAACyB,aAAa,CAAC,GAAG;MAC7B,GAAGD,eAAe;MAClB,CAACC,aAAa,GAAG,IAAI,CAACzB,MAAM,CAACyB,aAAa;IAC5C,CAAC,GAAGD,eAAgB,EAAE,CAAC,CAAC,CAAC;IACzB,IAAIE,MAAM,CAACC,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAM,KAAK,CAAC,EAAE;MAClC;IACF;IACA,OAAOL,IAAI;EACb;EAEAM,cAAc,GAAG;IACf,MAAMC,GAAG,GAAG,IAAI,CAAC1B,aAAa,IAAI,IAAI,CAACA,aAAa,CAACyB,cAAc,CAAC,IAAI,CAAC7B,MAAM,CAAC;IAChF,IAAI,CAAC8B,GAAG,EAAE;MACR;IACF;IACA,OAAOA,GAAG;EACZ;EAEAC,mBAAmB,CAACC,KAAK,EAAE;IACzB,OAAO,CAAC,GAAGA,KAAK,CAACjB,IAAI,CAACH,KAAK,CAAC;EAC9B;EAEAqB,mBAAmB,CAACD,KAAK,EAAE;IACzB,OAAO,CAAC,GAAGA,KAAK,CAACjB,IAAI,CAACH,KAAK,CAAC;EAC9B;EAEAsB,gBAAgB,CAACC,gBAAgB,EAAE;IACjC,OAAOA,gBAAgB,CAACvB,KAAK,CAAC,CAAC,CAAC,CAACG,IAAI,CAACH,KAAK,CAACI,MAAM,CAAC,CAACoB,MAAM,EAAEC,KAAK,KAAK;MACpE,IAAIA,KAAK,CAACC,QAAQ,EAAE;QAClBF,MAAM,CAACG,IAAI,CAACF,KAAK,CAACC,QAAQ,CAAC1B,KAAK,CAAC,CAAC,CAAC,CAAC4B,OAAO,CAAC;MAC9C;MACA,OAAOJ,MAAM;IACf,CAAC,EAAE,EAAE,CAAC;EACR;AACF;AAAC;AAAA,8BAlFYxC,aAAa,qBACC,gBAAgB"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.EnrollmentChannelData = void 0;
|
|
6
|
-
|
|
7
5
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
|
-
|
|
9
6
|
var _Remediator = require("./Base/Remediator");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,6 +15,7 @@ var _Remediator = require("./Base/Remediator");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
18
|
+
|
|
22
19
|
class EnrollmentChannelData extends _Remediator.Remediator {
|
|
23
20
|
getInputEmail() {
|
|
24
21
|
return [{
|
|
@@ -28,7 +25,6 @@ class EnrollmentChannelData extends _Remediator.Remediator {
|
|
|
28
25
|
label: 'Email'
|
|
29
26
|
}];
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
getInputPhoneNumber() {
|
|
33
29
|
return [{
|
|
34
30
|
name: 'phoneNumber',
|
|
@@ -37,19 +33,17 @@ class EnrollmentChannelData extends _Remediator.Remediator {
|
|
|
37
33
|
label: 'Phone Number'
|
|
38
34
|
}];
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
canRemediate() {
|
|
42
37
|
return Boolean(this.values.email || this.values.phoneNumber);
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
getNextStep(authClient, context) {
|
|
46
40
|
const common = super.getNextStep(authClient, context);
|
|
47
41
|
const authenticator = context.currentAuthenticator.value;
|
|
48
|
-
return {
|
|
42
|
+
return {
|
|
43
|
+
...common,
|
|
49
44
|
authenticator
|
|
50
45
|
};
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
getData() {
|
|
54
48
|
return {
|
|
55
49
|
stateHandle: this.values.stateHandle,
|
|
@@ -57,16 +51,14 @@ class EnrollmentChannelData extends _Remediator.Remediator {
|
|
|
57
51
|
phoneNumber: this.values.phoneNumber
|
|
58
52
|
};
|
|
59
53
|
}
|
|
60
|
-
|
|
61
54
|
getValuesAfterProceed() {
|
|
62
55
|
let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));
|
|
63
|
-
return trimmedValues.reduce((values, valueKey) => ({
|
|
56
|
+
return trimmedValues.reduce((values, valueKey) => ({
|
|
57
|
+
...values,
|
|
64
58
|
[valueKey]: this.values[valueKey]
|
|
65
59
|
}), {});
|
|
66
60
|
}
|
|
67
|
-
|
|
68
61
|
}
|
|
69
|
-
|
|
70
62
|
exports.EnrollmentChannelData = EnrollmentChannelData;
|
|
71
63
|
(0, _defineProperty2.default)(EnrollmentChannelData, "remediationName", 'enrollment-channel-data');
|
|
72
64
|
//# sourceMappingURL=EnrollmentChannelData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollmentChannelData.js","names":["EnrollmentChannelData","Remediator","getInputEmail","name","type","required","label","getInputPhoneNumber","canRemediate","Boolean","values","email","phoneNumber","getNextStep","authClient","context","common","authenticator","currentAuthenticator","value","getData","stateHandle","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","includes","reduce"],"sources":["../../../../lib/idx/remediators/EnrollmentChannelData.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxContext } from '../types/idx-js';\nimport { OktaAuthIdxInterface } from '../types';\n\n\nexport type EnrollmentChannelDataValues = RemediationValues & {\n email?: string;\n phoneNumber?: string;\n};\n\nexport class EnrollmentChannelData extends Remediator<EnrollmentChannelDataValues> {\n static remediationName = 'enrollment-channel-data';\n\n getInputEmail() {\n return [\n { name: 'email', type: 'string', required: true, label: 'Email' },\n ];\n }\n\n getInputPhoneNumber() {\n return [\n { name: 'phoneNumber', type: 'string', required: true, label: 'Phone Number' },\n ];\n }\n\n canRemediate() {\n return Boolean(this.values.email || this.values.phoneNumber);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context: IdxContext) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n return {\n stateHandle: this.values.stateHandle,\n email: this.values.email,\n phoneNumber: this.values.phoneNumber\n };\n }\n\n getValuesAfterProceed(): EnrollmentChannelDataValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnrollmentChannelData.js","names":["EnrollmentChannelData","Remediator","getInputEmail","name","type","required","label","getInputPhoneNumber","canRemediate","Boolean","values","email","phoneNumber","getNextStep","authClient","context","common","authenticator","currentAuthenticator","value","getData","stateHandle","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","includes","reduce"],"sources":["../../../../lib/idx/remediators/EnrollmentChannelData.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxContext } from '../types/idx-js';\nimport { OktaAuthIdxInterface } from '../types';\n\n\nexport type EnrollmentChannelDataValues = RemediationValues & {\n email?: string;\n phoneNumber?: string;\n};\n\nexport class EnrollmentChannelData extends Remediator<EnrollmentChannelDataValues> {\n static remediationName = 'enrollment-channel-data';\n\n getInputEmail() {\n return [\n { name: 'email', type: 'string', required: true, label: 'Email' },\n ];\n }\n\n getInputPhoneNumber() {\n return [\n { name: 'phoneNumber', type: 'string', required: true, label: 'Phone Number' },\n ];\n }\n\n canRemediate() {\n return Boolean(this.values.email || this.values.phoneNumber);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context: IdxContext) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n return {\n stateHandle: this.values.stateHandle,\n email: this.values.email,\n phoneNumber: this.values.phoneNumber\n };\n }\n\n getValuesAfterProceed(): EnrollmentChannelDataValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,MAAMA,qBAAqB,SAASC,sBAAU,CAA8B;EAGjFC,aAAa,GAAG;IACd,OAAO,CACL;MAAEC,IAAI,EAAE,OAAO;MAAEC,IAAI,EAAE,QAAQ;MAAEC,QAAQ,EAAE,IAAI;MAAEC,KAAK,EAAE;IAAQ,CAAC,CAClE;EACH;EAEAC,mBAAmB,GAAG;IACpB,OAAO,CACL;MAAEJ,IAAI,EAAE,aAAa;MAAEC,IAAI,EAAE,QAAQ;MAAEC,QAAQ,EAAE,IAAI;MAAEC,KAAK,EAAE;IAAe,CAAC,CAC/E;EACH;EAEAE,YAAY,GAAG;IACb,OAAOC,OAAO,CAAC,IAAI,CAACC,MAAM,CAACC,KAAK,IAAI,IAAI,CAACD,MAAM,CAACE,WAAW,CAAC;EAC9D;EAEAC,WAAW,CAACC,UAAgC,EAAEC,OAAmB,EAAE;IACjE,MAAMC,MAAM,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACrD,MAAME,aAAa,GAAGF,OAAO,CAACG,oBAAoB,CAACC,KAAK;IACxD,OAAO;MACL,GAAGH,MAAM;MACTC;IACF,CAAC;EACH;EAEAG,OAAO,GAAG;IACR,OAAO;MACLC,WAAW,EAAE,IAAI,CAACX,MAAM,CAACW,WAAW;MACpCV,KAAK,EAAE,IAAI,CAACD,MAAM,CAACC,KAAK;MACxBC,WAAW,EAAE,IAAI,CAACF,MAAM,CAACE;IAC3B,CAAC;EACH;EAEAU,qBAAqB,GAAgC;IACnD,IAAIC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACf,MAAM,CAAC,CAACgB,MAAM,CAACC,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,CAACC,QAAQ,CAACD,QAAQ,CAAC,CAAC;IAC7G,OAAOJ,aAAa,CAACM,MAAM,CAAC,CAACnB,MAAM,EAAEiB,QAAQ,MAAM;MAAC,GAAGjB,MAAM;MAAE,CAACiB,QAAQ,GAAG,IAAI,CAACjB,MAAM,CAACiB,QAAQ;IAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzG;AACF;AAAC;AAAA,8BAxCY3B,qBAAqB,qBACP,yBAAyB"}
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.GenericRemediator = void 0;
|
|
4
|
-
|
|
5
4
|
var _Remediator = require("../Base/Remediator");
|
|
6
|
-
|
|
7
5
|
var _util = require("./util");
|
|
8
|
-
|
|
9
6
|
class GenericRemediator extends _Remediator.Remediator {
|
|
10
7
|
canRemediate() {
|
|
11
8
|
// only handle remediations that are able to submit form (xhr)
|
|
12
9
|
if (typeof this.remediation.action !== 'function') {
|
|
13
10
|
return false;
|
|
14
|
-
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// DO NOT REMOVE - bring it back when enable client side validation for GenericRemediator - OKTA-512003
|
|
15
14
|
// const inputs = this.getInputs();
|
|
16
15
|
// const res = inputs.reduce((acc, input) => {
|
|
17
16
|
// return acc && hasValidInputValue(input, this.values);
|
|
18
17
|
// }, true);
|
|
19
18
|
// return res;
|
|
20
19
|
|
|
21
|
-
|
|
22
20
|
if (this.remediation.name === 'poll' || this.remediation.name.endsWith('-poll')) {
|
|
23
21
|
return true;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
if (this.options.step) {
|
|
27
24
|
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
25
|
+
}
|
|
30
26
|
|
|
27
|
+
// disable auto proceed for unknown remediations
|
|
31
28
|
return false;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
getData() {
|
|
35
31
|
const data = this.getInputs().reduce((acc, {
|
|
36
32
|
name
|
|
@@ -40,13 +36,12 @@ class GenericRemediator extends _Remediator.Remediator {
|
|
|
40
36
|
}, {});
|
|
41
37
|
return data;
|
|
42
38
|
}
|
|
43
|
-
|
|
44
39
|
getNextStep(authClient, _context) {
|
|
45
40
|
const name = this.getName();
|
|
46
41
|
const inputs = this.getInputs();
|
|
42
|
+
|
|
47
43
|
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
|
|
48
44
|
// excludes transformed fields
|
|
49
|
-
|
|
50
45
|
const {
|
|
51
46
|
// http metas have been transformed to action
|
|
52
47
|
href,
|
|
@@ -61,10 +56,11 @@ class GenericRemediator extends _Remediator.Remediator {
|
|
|
61
56
|
...rest
|
|
62
57
|
} = this.remediation;
|
|
63
58
|
/* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */
|
|
64
|
-
// step to handle form submission
|
|
65
59
|
|
|
60
|
+
// step to handle form submission
|
|
66
61
|
if (action) {
|
|
67
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
...rest,
|
|
68
64
|
...(!!inputs.length && {
|
|
69
65
|
inputs
|
|
70
66
|
}),
|
|
@@ -75,13 +71,13 @@ class GenericRemediator extends _Remediator.Remediator {
|
|
|
75
71
|
});
|
|
76
72
|
}
|
|
77
73
|
};
|
|
78
|
-
}
|
|
79
|
-
|
|
74
|
+
}
|
|
80
75
|
|
|
81
|
-
return
|
|
76
|
+
// return whole remediation data for other steps, eg "redirect-idp"
|
|
77
|
+
return {
|
|
78
|
+
...this.remediation
|
|
82
79
|
};
|
|
83
80
|
}
|
|
84
|
-
|
|
85
81
|
getInputs() {
|
|
86
82
|
return (this.remediation.value || []).filter(({
|
|
87
83
|
name
|
|
@@ -91,8 +87,6 @@ class GenericRemediator extends _Remediator.Remediator {
|
|
|
91
87
|
return input;
|
|
92
88
|
});
|
|
93
89
|
}
|
|
94
|
-
|
|
95
90
|
}
|
|
96
|
-
|
|
97
91
|
exports.GenericRemediator = GenericRemediator;
|
|
98
92
|
//# sourceMappingURL=GenericRemediator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericRemediator.js","names":["GenericRemediator","Remediator","canRemediate","remediation","action","name","endsWith","options","step","getData","data","getInputs","reduce","acc","values","getNextStep","authClient","_context","getName","inputs","href","method","rel","accepts","produces","value","rest","length","params","idx","proceed","filter","map","unwrapFormValue","input","type"],"sources":["../../../../../lib/idx/remediators/GenericRemediator/GenericRemediator.ts"],"sourcesContent":["import { OktaAuthIdxInterface, IdxContext, NextStep, Input } from '../../types';\nimport { Remediator } from '../Base/Remediator';\nimport { unwrapFormValue } from './util';\n\nexport class GenericRemediator extends Remediator {\n canRemediate(): boolean {\n // only handle remediations that are able to submit form (xhr)\n if (typeof this.remediation.action !== 'function') {\n return false;\n }\n\n // DO NOT REMOVE - bring it back when enable client side validation for GenericRemediator - OKTA-512003\n // const inputs = this.getInputs();\n // const res = inputs.reduce((acc, input) => {\n // return acc && hasValidInputValue(input, this.values);\n // }, true);\n // return res;\n\n if (this.remediation.name === 'poll' || this.remediation.name.endsWith('-poll')) {\n return true;\n }\n\n if (this.options.step) {\n return true;\n }\n \n // disable auto proceed for unknown remediations\n return false;\n }\n\n getData() {\n const data = this.getInputs().reduce((acc, { name }) => {\n acc[name] = this.values[name];\n return acc;\n }, {});\n return data;\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, _context?: IdxContext): NextStep {\n const name = this.getName();\n const inputs = this.getInputs();\n \n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n // excludes transformed fields\n const { \n // http metas have been transformed to action\n href, \n method, \n rel, \n accepts, \n produces, \n // value has been transform to inputs\n value,\n // will be transformed to a function that resolves IdxTransaction\n action,\n ...rest \n } = this.remediation;\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n\n // step to handle form submission\n if (action) {\n return { \n ...rest,\n ...(!!inputs.length && { inputs }),\n action: async (params?) => {\n return authClient.idx.proceed({\n step: name,\n ...params\n });\n }\n };\n }\n\n // return whole remediation data for other steps, eg \"redirect-idp\"\n return { ...this.remediation } as NextStep;\n \n }\n\n getInputs(): Input[] {\n return (this.remediation.value || [])\n .filter(({ name }) => name !== 'stateHandle')\n .map(unwrapFormValue)\n .map(input => {\n // use string as default input type\n input.type = input.type || 'string';\n return input;\n });\n }\n\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenericRemediator.js","names":["GenericRemediator","Remediator","canRemediate","remediation","action","name","endsWith","options","step","getData","data","getInputs","reduce","acc","values","getNextStep","authClient","_context","getName","inputs","href","method","rel","accepts","produces","value","rest","length","params","idx","proceed","filter","map","unwrapFormValue","input","type"],"sources":["../../../../../lib/idx/remediators/GenericRemediator/GenericRemediator.ts"],"sourcesContent":["import { OktaAuthIdxInterface, IdxContext, NextStep, Input } from '../../types';\nimport { Remediator } from '../Base/Remediator';\nimport { unwrapFormValue } from './util';\n\nexport class GenericRemediator extends Remediator {\n canRemediate(): boolean {\n // only handle remediations that are able to submit form (xhr)\n if (typeof this.remediation.action !== 'function') {\n return false;\n }\n\n // DO NOT REMOVE - bring it back when enable client side validation for GenericRemediator - OKTA-512003\n // const inputs = this.getInputs();\n // const res = inputs.reduce((acc, input) => {\n // return acc && hasValidInputValue(input, this.values);\n // }, true);\n // return res;\n\n if (this.remediation.name === 'poll' || this.remediation.name.endsWith('-poll')) {\n return true;\n }\n\n if (this.options.step) {\n return true;\n }\n \n // disable auto proceed for unknown remediations\n return false;\n }\n\n getData() {\n const data = this.getInputs().reduce((acc, { name }) => {\n acc[name] = this.values[name];\n return acc;\n }, {});\n return data;\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, _context?: IdxContext): NextStep {\n const name = this.getName();\n const inputs = this.getInputs();\n \n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n // excludes transformed fields\n const { \n // http metas have been transformed to action\n href, \n method, \n rel, \n accepts, \n produces, \n // value has been transform to inputs\n value,\n // will be transformed to a function that resolves IdxTransaction\n action,\n ...rest \n } = this.remediation;\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n\n // step to handle form submission\n if (action) {\n return { \n ...rest,\n ...(!!inputs.length && { inputs }),\n action: async (params?) => {\n return authClient.idx.proceed({\n step: name,\n ...params\n });\n }\n };\n }\n\n // return whole remediation data for other steps, eg \"redirect-idp\"\n return { ...this.remediation } as NextStep;\n \n }\n\n getInputs(): Input[] {\n return (this.remediation.value || [])\n .filter(({ name }) => name !== 'stateHandle')\n .map(unwrapFormValue)\n .map(input => {\n // use string as default input type\n input.type = input.type || 'string';\n return input;\n });\n }\n\n}\n"],"mappings":";;;AACA;AACA;AAEO,MAAMA,iBAAiB,SAASC,sBAAU,CAAC;EAChDC,YAAY,GAAY;IACtB;IACA,IAAI,OAAO,IAAI,CAACC,WAAW,CAACC,MAAM,KAAK,UAAU,EAAE;MACjD,OAAO,KAAK;IACd;;IAEA;IACA;IACA;IACA;IACA;IACA;;IAEA,IAAI,IAAI,CAACD,WAAW,CAACE,IAAI,KAAK,MAAM,IAAI,IAAI,CAACF,WAAW,CAACE,IAAI,CAACC,QAAQ,CAAC,OAAO,CAAC,EAAE;MAC/E,OAAO,IAAI;IACb;IAEA,IAAI,IAAI,CAACC,OAAO,CAACC,IAAI,EAAE;MACrB,OAAO,IAAI;IACb;;IAEA;IACA,OAAO,KAAK;EACd;EAEAC,OAAO,GAAG;IACR,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,EAAE,CAACC,MAAM,CAAC,CAACC,GAAG,EAAE;MAAER;IAAK,CAAC,KAAK;MACtDQ,GAAG,CAACR,IAAI,CAAC,GAAG,IAAI,CAACS,MAAM,CAACT,IAAI,CAAC;MAC7B,OAAOQ,GAAG;IACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IACN,OAAOH,IAAI;EACb;EAEAK,WAAW,CAACC,UAAgC,EAAEC,QAAqB,EAAY;IAC7E,MAAMZ,IAAI,GAAG,IAAI,CAACa,OAAO,EAAE;IAC3B,MAAMC,MAAM,GAAG,IAAI,CAACR,SAAS,EAAE;;IAE/B;IACA;IACA,MAAM;MACJ;MACAS,IAAI;MACJC,MAAM;MACNC,GAAG;MACHC,OAAO;MACPC,QAAQ;MACR;MACAC,KAAK;MACL;MACArB,MAAM;MACN,GAAGsB;IACL,CAAC,GAAG,IAAI,CAACvB,WAAW;IACpB;;IAEA;IACA,IAAIC,MAAM,EAAE;MACV,OAAO;QACL,GAAGsB,IAAI;QACP,IAAI,CAAC,CAACP,MAAM,CAACQ,MAAM,IAAI;UAAER;QAAO,CAAC,CAAC;QAClCf,MAAM,EAAE,MAAOwB,MAAO,IAAK;UACzB,OAAOZ,UAAU,CAACa,GAAG,CAACC,OAAO,CAAC;YAC5BtB,IAAI,EAAEH,IAAI;YACV,GAAGuB;UACL,CAAC,CAAC;QACJ;MACF,CAAC;IACH;;IAEA;IACA,OAAO;MAAE,GAAG,IAAI,CAACzB;IAAY,CAAC;EAEhC;EAEAQ,SAAS,GAAY;IACnB,OAAO,CAAC,IAAI,CAACR,WAAW,CAACsB,KAAK,IAAI,EAAE,EACjCM,MAAM,CAAC,CAAC;MAAE1B;IAAK,CAAC,KAAKA,IAAI,KAAK,aAAa,CAAC,CAC5C2B,GAAG,CAACC,qBAAe,CAAC,CACpBD,GAAG,CAACE,KAAK,IAAI;MACZ;MACAA,KAAK,CAACC,IAAI,GAAGD,KAAK,CAACC,IAAI,IAAI,QAAQ;MACnC,OAAOD,KAAK;IACd,CAAC,CAAC;EACN;AAEF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../lib/idx/remediators/GenericRemediator/index.ts"],"sourcesContent":["export * from './GenericRemediator';"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../lib/idx/remediators/GenericRemediator/index.ts"],"sourcesContent":["export * from './GenericRemediator';"],"mappings":";;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|