@okta/okta-auth-js 5.8.0 → 5.10.1
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 +45 -0
- package/README.md +12 -2
- package/cjs/OktaAuth.js +34 -13
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/OktaUserAgent.js.map +1 -1
- package/cjs/TokenManager.js +24 -2
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/TransactionManager.js +6 -2
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/features.js +1 -1
- package/cjs/features.js.map +1 -1
- package/cjs/idx/authenticate.js +3 -18
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +14 -0
- package/cjs/idx/authenticator/Authenticator.js.map +1 -0
- package/cjs/idx/authenticator/OktaPassword.js +31 -0
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js +17 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +50 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +31 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +34 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/getAuthenticator.js +42 -0
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/index.js +80 -0
- package/cjs/idx/authenticator/index.js.map +1 -0
- package/cjs/idx/cancel.js +5 -0
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +32 -0
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
- package/cjs/idx/flow/FlowSpecification.js +39 -0
- package/cjs/idx/flow/FlowSpecification.js.map +1 -0
- package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
- package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
- package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +16 -12
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
- package/cjs/idx/flow/RemediationFlow.js +2 -0
- package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
- package/cjs/idx/flow/index.js +67 -0
- package/cjs/idx/flow/index.js.map +1 -0
- package/cjs/idx/index.js +39 -0
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +8 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/poll.js +59 -0
- package/cjs/idx/poll.js.map +1 -0
- package/cjs/idx/proceed.js +49 -0
- package/cjs/idx/proceed.js.map +1 -0
- package/cjs/idx/recoverPassword.js +3 -17
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js +22 -20
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +40 -93
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +9 -12
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +6 -9
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +43 -32
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +51 -20
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +16 -16
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +8 -28
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/{esm/idx/remediators/RedirectIdp.js → cjs/idx/remediators/ChallengePoll.js} +13 -25
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -0
- package/cjs/idx/remediators/EnrollPoll.js +56 -0
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -0
- package/cjs/idx/remediators/Identify.js +4 -36
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +23 -2
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +7 -0
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +26 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/run.js +18 -20
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js +2 -0
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/transactionMeta.js +67 -42
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/FlowIdentifier.js +2 -0
- package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +18 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +4 -1
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/types/Token.js.map +1 -1
- package/cjs/types/Transaction.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.umd.js +1 -1
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/index.js +8580 -16
- package/esm/index.js.map +1 -1
- package/lib/TokenManager.d.ts +2 -0
- package/lib/TransactionManager.d.ts +1 -0
- package/lib/idx/authenticator/Authenticator.d.ts +12 -0
- package/lib/idx/authenticator/OktaPassword.d.ts +11 -0
- package/lib/idx/authenticator/OktaVerifyTotp.d.ts +9 -0
- package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +28 -0
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +14 -0
- package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +10 -0
- package/lib/idx/authenticator/getAuthenticator.d.ts +3 -0
- package/lib/idx/authenticator/index.d.ts +6 -0
- package/{esm/crypto/webcrypto.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -4
- package/lib/idx/flow/FlowSpecification.d.ts +8 -0
- package/{esm/oidc/endpoints/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -5
- package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
- package/{esm/crypto/index.js → lib/idx/flow/RemediationFlow.d.ts} +3 -6
- package/lib/idx/{flowMonitors → flow}/index.d.ts +5 -4
- package/lib/idx/index.d.ts +3 -0
- package/lib/idx/interact.d.ts +1 -0
- package/lib/idx/poll.d.ts +13 -0
- package/lib/idx/proceed.d.ts +21 -0
- package/lib/idx/register.d.ts +1 -1
- package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +9 -5
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +0 -1
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +8 -3
- package/lib/idx/remediators/Base/Remediator.d.ts +9 -6
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +5 -4
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +8 -4
- package/lib/idx/remediators/ChallengePoll.d.ts +15 -0
- package/{esm/tx/util.js → lib/idx/remediators/EnrollPoll.d.ts} +11 -13
- package/lib/idx/remediators/Identify.d.ts +1 -3
- package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +6 -2
- package/lib/idx/remediators/Skip.d.ts +3 -0
- package/lib/idx/remediators/index.d.ts +2 -0
- package/lib/idx/run.d.ts +8 -10
- package/lib/idx/transactionMeta.d.ts +24 -1
- package/lib/idx/types/FlowIdentifier.d.ts +1 -0
- package/lib/idx/types/idx-js.d.ts +52 -1
- package/lib/idx/types/index.d.ts +16 -3
- package/lib/types/OktaAuthOptions.d.ts +3 -0
- package/lib/types/Token.d.ts +1 -0
- package/lib/types/Transaction.d.ts +2 -0
- package/lib/types/api.d.ts +15 -2
- package/package.json +16 -8
- package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -45
- package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
- package/cjs/idx/flowMonitors/FlowMonitor.js +0 -69
- package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
- package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -55
- package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
- package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js +0 -35
- package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
- package/cjs/idx/flowMonitors/index.js +0 -54
- package/cjs/idx/flowMonitors/index.js.map +0 -1
- package/esm/AuthStateManager.js +0 -214
- package/esm/AuthStateManager.js.map +0 -1
- package/esm/OktaAuth.js +0 -705
- package/esm/OktaAuth.js.map +0 -1
- package/esm/OktaUserAgent.js +0 -49
- package/esm/OktaUserAgent.js.map +0 -1
- package/esm/PromiseQueue.js +0 -71
- package/esm/PromiseQueue.js.map +0 -1
- package/esm/SavedObject.js +0 -91
- package/esm/SavedObject.js.map +0 -1
- package/esm/StorageManager.js +0 -190
- package/esm/StorageManager.js.map +0 -1
- package/esm/TokenManager.js +0 -455
- package/esm/TokenManager.js.map +0 -1
- package/esm/TransactionManager.js +0 -324
- package/esm/TransactionManager.js.map +0 -1
- package/esm/browser/browserStorage.js +0 -256
- package/esm/browser/browserStorage.js.map +0 -1
- package/esm/browser/fingerprint.js +0 -74
- package/esm/browser/fingerprint.js.map +0 -1
- package/esm/builderUtil.js +0 -56
- package/esm/builderUtil.js.map +0 -1
- package/esm/clock.js +0 -32
- package/esm/clock.js.map +0 -1
- package/esm/constants.js +0 -36
- package/esm/constants.js.map +0 -1
- package/esm/crypto/base64.js +0 -66
- package/esm/crypto/base64.js.map +0 -1
- package/esm/crypto/browser.js.map +0 -1
- package/esm/crypto/index.js.map +0 -1
- package/esm/crypto/node.js +0 -54
- package/esm/crypto/node.js.map +0 -1
- package/esm/crypto/oidcHash.js +0 -27
- package/esm/crypto/oidcHash.js.map +0 -1
- package/esm/crypto/verifyToken.js +0 -39
- package/esm/crypto/verifyToken.js.map +0 -1
- package/esm/crypto/webcrypto.js.map +0 -1
- package/esm/errors/AuthApiError.js +0 -30
- package/esm/errors/AuthApiError.js.map +0 -1
- package/esm/errors/AuthPollStopError.js +0 -20
- package/esm/errors/AuthPollStopError.js.map +0 -1
- package/esm/errors/AuthSdkError.js +0 -29
- package/esm/errors/AuthSdkError.js.map +0 -1
- package/esm/errors/CustomError.js +0 -21
- package/esm/errors/CustomError.js.map +0 -1
- package/esm/errors/OAuthError.js +0 -22
- package/esm/errors/OAuthError.js.map +0 -1
- package/esm/errors/index.js +0 -22
- package/esm/errors/index.js.map +0 -1
- package/esm/features.js +0 -64
- package/esm/features.js.map +0 -1
- package/esm/fetch/fetchRequest.js +0 -92
- package/esm/fetch/fetchRequest.js.map +0 -1
- package/esm/http/headers.js +0 -17
- package/esm/http/headers.js.map +0 -1
- package/esm/http/index.js +0 -3
- package/esm/http/index.js.map +0 -1
- package/esm/http/request.js +0 -145
- package/esm/http/request.js.map +0 -1
- package/esm/idx/authenticate.js +0 -47
- package/esm/idx/authenticate.js.map +0 -1
- package/esm/idx/cancel.js +0 -32
- package/esm/idx/cancel.js.map +0 -1
- package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
- package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
- package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
- package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
- package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
- package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
- package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
- package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
- package/esm/idx/flowMonitors/index.js +0 -16
- package/esm/idx/flowMonitors/index.js.map +0 -1
- package/esm/idx/handleInteractionCodeRedirect.js +0 -64
- package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
- package/esm/idx/headers.js +0 -39
- package/esm/idx/headers.js.map +0 -1
- package/esm/idx/index.js +0 -20
- package/esm/idx/index.js.map +0 -1
- package/esm/idx/interact.js +0 -86
- package/esm/idx/interact.js.map +0 -1
- package/esm/idx/introspect.js +0 -61
- package/esm/idx/introspect.js.map +0 -1
- package/esm/idx/recoverPassword.js +0 -46
- package/esm/idx/recoverPassword.js.map +0 -1
- package/esm/idx/register.js +0 -63
- package/esm/idx/register.js.map +0 -1
- package/esm/idx/remediate.js +0 -302
- package/esm/idx/remediate.js.map +0 -1
- package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
- package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
- package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
- package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
- package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
- package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
- package/esm/idx/remediators/Base/Remediator.js +0 -221
- package/esm/idx/remediators/Base/Remediator.js.map +0 -1
- package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
- package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
- package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -65
- package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
- package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
- package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
- package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
- package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
- package/esm/idx/remediators/EnrollProfile.js +0 -79
- package/esm/idx/remediators/EnrollProfile.js.map +0 -1
- package/esm/idx/remediators/Identify.js +0 -87
- package/esm/idx/remediators/Identify.js.map +0 -1
- package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
- package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
- package/esm/idx/remediators/RedirectIdp.js.map +0 -1
- package/esm/idx/remediators/ResetAuthenticator.js +0 -18
- package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
- package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
- package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
- package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
- package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
- package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
- package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
- package/esm/idx/remediators/Skip.js +0 -23
- package/esm/idx/remediators/Skip.js.map +0 -1
- package/esm/idx/remediators/index.js +0 -26
- package/esm/idx/remediators/index.js.map +0 -1
- package/esm/idx/remediators/util.js +0 -35
- package/esm/idx/remediators/util.js.map +0 -1
- package/esm/idx/run.js +0 -222
- package/esm/idx/run.js.map +0 -1
- package/esm/idx/startTransaction.js +0 -27
- package/esm/idx/startTransaction.js.map +0 -1
- package/esm/idx/transactionMeta.js +0 -125
- package/esm/idx/transactionMeta.js.map +0 -1
- package/esm/idx/types/idx-js.js +0 -20
- package/esm/idx/types/idx-js.js.map +0 -1
- package/esm/idx/types/index.js +0 -44
- package/esm/idx/types/index.js.map +0 -1
- package/esm/oidc/decodeToken.js +0 -31
- package/esm/oidc/decodeToken.js.map +0 -1
- package/esm/oidc/endpoints/authorize.js +0 -61
- package/esm/oidc/endpoints/authorize.js.map +0 -1
- package/esm/oidc/endpoints/index.js.map +0 -1
- package/esm/oidc/endpoints/token.js +0 -97
- package/esm/oidc/endpoints/token.js.map +0 -1
- package/esm/oidc/endpoints/well-known.js +0 -58
- package/esm/oidc/endpoints/well-known.js.map +0 -1
- package/esm/oidc/exchangeCodeForTokens.js +0 -69
- package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
- package/esm/oidc/getToken.js +0 -180
- package/esm/oidc/getToken.js.map +0 -1
- package/esm/oidc/getUserInfo.js +0 -82
- package/esm/oidc/getUserInfo.js.map +0 -1
- package/esm/oidc/getWithPopup.js +0 -34
- package/esm/oidc/getWithPopup.js.map +0 -1
- package/esm/oidc/getWithRedirect.js +0 -61
- package/esm/oidc/getWithRedirect.js.map +0 -1
- package/esm/oidc/getWithoutPrompt.js +0 -29
- package/esm/oidc/getWithoutPrompt.js.map +0 -1
- package/esm/oidc/handleOAuthResponse.js +0 -148
- package/esm/oidc/handleOAuthResponse.js.map +0 -1
- package/esm/oidc/index.js +0 -29
- package/esm/oidc/index.js.map +0 -1
- package/esm/oidc/parseFromUrl.js +0 -144
- package/esm/oidc/parseFromUrl.js.map +0 -1
- package/esm/oidc/renewToken.js +0 -85
- package/esm/oidc/renewToken.js.map +0 -1
- package/esm/oidc/renewTokens.js +0 -74
- package/esm/oidc/renewTokens.js.map +0 -1
- package/esm/oidc/renewTokensWithRefresh.js +0 -55
- package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
- package/esm/oidc/revokeToken.js +0 -57
- package/esm/oidc/revokeToken.js.map +0 -1
- package/esm/oidc/util/browser.js +0 -74
- package/esm/oidc/util/browser.js.map +0 -1
- package/esm/oidc/util/defaultTokenParams.js +0 -42
- package/esm/oidc/util/defaultTokenParams.js.map +0 -1
- package/esm/oidc/util/errors.js +0 -31
- package/esm/oidc/util/errors.js.map +0 -1
- package/esm/oidc/util/index.js +0 -25
- package/esm/oidc/util/index.js.map +0 -1
- package/esm/oidc/util/loginRedirect.js +0 -88
- package/esm/oidc/util/loginRedirect.js.map +0 -1
- package/esm/oidc/util/oauth.js +0 -70
- package/esm/oidc/util/oauth.js.map +0 -1
- package/esm/oidc/util/pkce.js +0 -55
- package/esm/oidc/util/pkce.js.map +0 -1
- package/esm/oidc/util/prepareTokenParams.js +0 -75
- package/esm/oidc/util/prepareTokenParams.js.map +0 -1
- package/esm/oidc/util/refreshToken.js +0 -24
- package/esm/oidc/util/refreshToken.js.map +0 -1
- package/esm/oidc/util/urlParams.js +0 -54
- package/esm/oidc/util/urlParams.js.map +0 -1
- package/esm/oidc/util/validateClaims.js +0 -53
- package/esm/oidc/util/validateClaims.js.map +0 -1
- package/esm/oidc/util/validateToken.js +0 -21
- package/esm/oidc/util/validateToken.js.map +0 -1
- package/esm/oidc/verifyToken.js +0 -78
- package/esm/oidc/verifyToken.js.map +0 -1
- package/esm/options.js +0 -144
- package/esm/options.js.map +0 -1
- package/esm/server/serverStorage.js +0 -111
- package/esm/server/serverStorage.js.map +0 -1
- package/esm/services/TokenService.js +0 -103
- package/esm/services/TokenService.js.map +0 -1
- package/esm/session.js +0 -81
- package/esm/session.js.map +0 -1
- package/esm/tx/AuthTransaction.js +0 -213
- package/esm/tx/AuthTransaction.js.map +0 -1
- package/esm/tx/TransactionState.js.map +0 -1
- package/esm/tx/api.js +0 -87
- package/esm/tx/api.js.map +0 -1
- package/esm/tx/index.js +0 -18
- package/esm/tx/index.js.map +0 -1
- package/esm/tx/poll.js +0 -124
- package/esm/tx/poll.js.map +0 -1
- package/esm/tx/util.js.map +0 -1
- package/esm/types/AuthState.js +0 -3
- package/esm/types/Cookies.js +0 -3
- package/esm/types/EventEmitter.js +0 -3
- package/esm/types/EventEmitter.js.map +0 -1
- package/esm/types/JWT.js +0 -3
- package/esm/types/JWT.js.map +0 -1
- package/esm/types/OAuth.js +0 -3
- package/esm/types/OAuth.js.map +0 -1
- package/esm/types/OktaAuthOptions.js +0 -3
- package/esm/types/OktaAuthOptions.js.map +0 -1
- package/esm/types/Storage.js +0 -3
- package/esm/types/Storage.js.map +0 -1
- package/esm/types/Token.js +0 -29
- package/esm/types/Token.js.map +0 -1
- package/esm/types/TokenManager.js +0 -3
- package/esm/types/TokenManager.js.map +0 -1
- package/esm/types/Transaction.js +0 -57
- package/esm/types/Transaction.js.map +0 -1
- package/esm/types/UserClaims.js +0 -3
- package/esm/types/UserClaims.js.map +0 -1
- package/esm/types/api.js +0 -3
- package/esm/types/api.js.map +0 -1
- package/esm/types/http.js +0 -3
- package/esm/types/http.js.map +0 -1
- package/esm/types/index.js +0 -27
- package/esm/types/index.js.map +0 -1
- package/esm/util/console.js +0 -53
- package/esm/util/console.js.map +0 -1
- package/esm/util/emailVerify.js +0 -21
- package/esm/util/emailVerify.js.map +0 -1
- package/esm/util/index.js +0 -18
- package/esm/util/index.js.map +0 -1
- package/esm/util/misc.js +0 -33
- package/esm/util/misc.js.map +0 -1
- package/esm/util/object.js +0 -117
- package/esm/util/object.js.map +0 -1
- package/esm/util/sharedStorage.js +0 -43
- package/esm/util/sharedStorage.js.map +0 -1
- package/esm/util/types.js +0 -27
- package/esm/util/types.js.map +0 -1
- package/esm/util/url.js +0 -64
- package/esm/util/url.js.map +0 -1
- package/lib/idx/flowMonitors/AuthenticationFlowMonitor.d.ts +0 -15
- package/lib/idx/flowMonitors/FlowMonitor.d.ts +0 -23
- package/lib/idx/flowMonitors/PasswordRecoveryFlowMonitor.d.ts +0 -16
- package/lib/idx/flowMonitors/RegistrationFlowMonitor.d.ts +0 -15
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
-
*
|
|
12
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
*
|
|
17
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { getTransactionMeta, saveTransactionMeta } from '../transactionMeta';
|
|
20
|
-
export class FlowMonitor {
|
|
21
|
-
constructor(authClient) {
|
|
22
|
-
this.authClient = authClient;
|
|
23
|
-
} // detect in-memory loop
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
loopDetected(remediator) {
|
|
27
|
-
if (!this.previousRemediator) {
|
|
28
|
-
this.previousRemediator = remediator;
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (this.previousRemediator.getName() === remediator.getName()) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
this.previousRemediator = remediator;
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
isRemediatorCandidate( // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
41
|
-
remediator, remediations, values) {
|
|
42
|
-
var remediatorName = remediator.getName();
|
|
43
|
-
|
|
44
|
-
if (!values.skip && remediatorName === 'skip') {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (values.skip && remediatorName !== 'skip') {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
trackRemediations(name) {
|
|
56
|
-
var _this = this;
|
|
57
|
-
|
|
58
|
-
return _asyncToGenerator(function* () {
|
|
59
|
-
var meta = yield getTransactionMeta(_this.authClient);
|
|
60
|
-
var remediations = meta.remediations || [];
|
|
61
|
-
meta = _objectSpread(_objectSpread({}, meta), {}, {
|
|
62
|
-
remediations: [...remediations, name]
|
|
63
|
-
});
|
|
64
|
-
saveTransactionMeta(_this.authClient, meta);
|
|
65
|
-
})();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
isFinished() {
|
|
69
|
-
return Promise.resolve(true);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=FlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flowMonitors/FlowMonitor.ts"],"names":["getTransactionMeta","saveTransactionMeta","FlowMonitor","constructor","authClient","loopDetected","remediator","previousRemediator","getName","isRemediatorCandidate","remediations","values","remediatorName","skip","trackRemediations","name","meta","isFinished","Promise","resolve"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,SAASA,kBAAT,EAA6BC,mBAA7B,QAAwD,oBAAxD;AAGA,OAAO,MAAMC,WAAN,CAAkB;AAIvBC,EAAAA,WAAW,CAACC,UAAD,EAAa;AACtB,SAAKA,UAAL,GAAkBA,UAAlB;AACD,GANsB,CAQvB;;;AACAC,EAAAA,YAAY,CAACC,UAAD,EAAkC;AAC5C,QAAI,CAAC,KAAKC,kBAAV,EAA8B;AAC5B,WAAKA,kBAAL,GAA0BD,UAA1B;AACA,aAAO,KAAP;AACD;;AAED,QAAI,KAAKC,kBAAL,CAAwBC,OAAxB,OAAsCF,UAAU,CAACE,OAAX,EAA1C,EAAgE;AAC9D,aAAO,IAAP;AACD;;AAED,SAAKD,kBAAL,GAA0BD,UAA1B;AACA,WAAO,KAAP;AACD;;AAEDG,EAAAA,qBAAqB,EACnB;AACAH,EAAAA,UAFmB,EAEKI,YAFL,EAEsCC,MAFtC,EAGV;AACT,QAAMC,cAAc,GAAGN,UAAU,CAACE,OAAX,EAAvB;;AACA,QAAI,CAACG,MAAM,CAACE,IAAR,IAAgBD,cAAc,KAAK,MAAvC,EAA+C;AAC7C,aAAO,KAAP;AACD;;AACD,QAAID,MAAM,CAACE,IAAP,IAAeD,cAAc,KAAK,MAAtC,EAA8C;AAC5C,aAAO,KAAP;AACD;;AACD,WAAO,IAAP;AACD;;AAEKE,EAAAA,iBAAiB,CAACC,IAAD,EAAe;AAAA;;AAAA;AACpC,UAAIC,IAAI,SAAShB,kBAAkB,CAAC,KAAI,CAACI,UAAN,CAAnC;AACA,UAAMM,YAAY,GAAGM,IAAI,CAACN,YAAL,IAAqB,EAA1C;AACAM,MAAAA,IAAI,mCACCA,IADD;AAEFN,QAAAA,YAAY,EAAE,CAAC,GAAGA,YAAJ,EAAkBK,IAAlB;AAFZ,QAAJ;AAIAd,MAAAA,mBAAmB,CAAC,KAAI,CAACG,UAAN,EAAkBY,IAAlB,CAAnB;AAPoC;AAQrC;;AAEDC,EAAAA,UAAU,GAAqB;AAC7B,WAAOC,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;AACD;;AAjDsB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { OktaAuth } from '../../types';\nimport { Remediator, RemediationValues, SkipValues } from '../remediators';\nimport { getTransactionMeta, saveTransactionMeta } from '../transactionMeta';\nimport { IdxRemediation } from '../types/idx-js';\n\nexport class FlowMonitor {\n previousRemediator: Remediator;\n authClient: OktaAuth;\n\n constructor(authClient) {\n this.authClient = authClient;\n }\n\n // detect in-memory loop\n loopDetected(remediator: Remediator): boolean {\n if (!this.previousRemediator) {\n this.previousRemediator = remediator;\n return false;\n }\n\n if (this.previousRemediator.getName() === remediator.getName()) {\n return true;\n }\n\n this.previousRemediator = remediator;\n return false;\n }\n\n isRemediatorCandidate(\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n remediator: Remediator, remediations?: IdxRemediation[], values?: RemediationValues & SkipValues\n ): boolean {\n const remediatorName = remediator.getName();\n if (!values.skip && remediatorName === 'skip') {\n return false;\n }\n if (values.skip && remediatorName !== 'skip') {\n return false;\n }\n return true;\n }\n\n async trackRemediations(name: string) {\n let meta = await getTransactionMeta(this.authClient);\n const remediations = meta.remediations || [];\n meta = { \n ...meta, \n remediations: [...remediations, name]\n };\n saveTransactionMeta(this.authClient, meta);\n }\n\n isFinished(): Promise<boolean> {\n return Promise.resolve(true);\n }\n}\n"],"file":"FlowMonitor.js"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
-
*
|
|
7
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
*
|
|
12
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
import { FlowMonitor } from './FlowMonitor';
|
|
15
|
-
import { getTransactionMeta } from '../transactionMeta';
|
|
16
|
-
export class PasswordRecoveryFlowMonitor extends FlowMonitor {
|
|
17
|
-
isRemediatorCandidate(remediator, remediations, values) {
|
|
18
|
-
var _this$previousRemedia;
|
|
19
|
-
|
|
20
|
-
var prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
|
|
21
|
-
var remediatorName = remediator.getName();
|
|
22
|
-
|
|
23
|
-
if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate', 'reenroll-authenticator'].includes(prevRemediatorName)) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (remediatorName === 'select-authenticator-authenticate' && remediations.some(_ref => {
|
|
28
|
-
var {
|
|
29
|
-
name
|
|
30
|
-
} = _ref;
|
|
31
|
-
return name === 'challenge-authenticator';
|
|
32
|
-
})) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return super.isRemediatorCandidate(remediator, remediations, values);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
isFinished() {
|
|
40
|
-
var _superprop_getIsFinished = () => super.isFinished,
|
|
41
|
-
_this = this;
|
|
42
|
-
|
|
43
|
-
return _asyncToGenerator(function* () {
|
|
44
|
-
var {
|
|
45
|
-
remediations
|
|
46
|
-
} = yield getTransactionMeta(_this.authClient);
|
|
47
|
-
|
|
48
|
-
if (!remediations.includes('reset-authenticator')) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return yield _superprop_getIsFinished().call(_this);
|
|
53
|
-
})();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=PasswordRecoveryFlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flowMonitors/PasswordRecoveryFlowMonitor.ts"],"names":["FlowMonitor","getTransactionMeta","PasswordRecoveryFlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name","isFinished","authClient"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,WAAT,QAA4B,eAA5B;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA,OAAO,MAAMC,2BAAN,SAA0CF,WAA1C,CAAsD;AAC3DG,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,QAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,QAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AAEA,QAAIC,cAAc,KAAK,mCAAnB,IACC,CACD,mCADC,EAED,wBAFC,EAGDC,QAHC,CAGQJ,kBAHR,CADL,EAIkC;AAChC,aAAO,KAAP;AACD;;AAED,QAAIG,cAAc,KAAK,mCAAnB,IACCL,YAAY,CAACO,IAAb,CAAkB;AAAA,UAAC;AAAEC,QAAAA;AAAF,OAAD;AAAA,aAAcA,IAAI,KAAK,yBAAvB;AAAA,KAAlB,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,WAAO,MAAMV,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAEKQ,EAAAA,UAAU,GAAG;AAAA;AAAA;;AAAA;AACjB,UAAM;AAAET,QAAAA;AAAF,gBAA0BJ,kBAAkB,CAAC,KAAI,CAACc,UAAN,CAAlD;;AACA,UAAI,CAACV,YAAY,CAACM,QAAb,CAAsB,qBAAtB,CAAL,EAAmD;AACjD,eAAO,KAAP;AACD;;AAED,mBAAa,sCAAb;AANiB;AAOlB;;AA5B0D","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { FlowMonitor } from './FlowMonitor';\nimport { getTransactionMeta } from '../transactionMeta';\n\nexport class PasswordRecoveryFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n \n if (remediatorName === 'select-authenticator-authenticate' \n && [\n 'select-authenticator-authenticate',\n 'reenroll-authenticator'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-authenticate' \n && remediations.some(({ name }) => name === 'challenge-authenticator')) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n\n async isFinished() {\n const { remediations } = await getTransactionMeta(this.authClient);\n if (!remediations.includes('reset-authenticator')) {\n return false;\n }\n\n return await super.isFinished();\n }\n}\n"],"file":"PasswordRecoveryFlowMonitor.js"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
-
*
|
|
5
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
-
*
|
|
10
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { FlowMonitor } from './FlowMonitor';
|
|
13
|
-
export class RegistrationFlowMonitor extends FlowMonitor {
|
|
14
|
-
isRemediatorCandidate(remediator, remediations, values) {
|
|
15
|
-
var _this$previousRemedia;
|
|
16
|
-
|
|
17
|
-
var prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
|
|
18
|
-
var remediatorName = remediator.getName();
|
|
19
|
-
|
|
20
|
-
if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return super.isRemediatorCandidate(remediator, remediations, values);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=RegistrationFlowMonitor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flowMonitors/RegistrationFlowMonitor.ts"],"names":["FlowMonitor","RegistrationFlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,uBAAN,SAAsCD,WAAtC,CAAkD;AACvDE,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,QAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,QAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AACA,QAAIC,cAAc,KAAK,6BAAnB,IACC,CACC,6BADD,EAEC,+BAFD,EAGCC,QAHD,CAGUJ,kBAHV,CADL,EAIoC;AAClC,aAAO,KAAP;AACD;;AAED,WAAO,MAAMJ,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAbsD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { FlowMonitor } from './FlowMonitor';\n\nexport class RegistrationFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n if (remediatorName === 'select-authenticator-enroll' \n && [\n 'select-authenticator-enroll', \n 'authenticator-enrollment-data'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n}\n"],"file":"RegistrationFlowMonitor.js"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
-
*
|
|
5
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
-
*
|
|
10
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
export * from './FlowMonitor';
|
|
13
|
-
export * from './RegistrationFlowMonitor';
|
|
14
|
-
export * from './AuthenticationFlowMonitor';
|
|
15
|
-
export * from './PasswordRecoveryFlowMonitor';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../lib/idx/flowMonitors/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,eAAd;AACA,cAAc,2BAAd;AACA,cAAc,6BAAd;AACA,cAAc,+BAAd","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './FlowMonitor';\nexport * from './RegistrationFlowMonitor';\nexport * from './AuthenticationFlowMonitor';\nexport * from './PasswordRecoveryFlowMonitor';\n"],"file":"index.js"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
-
*
|
|
7
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
*
|
|
12
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
import { AuthSdkError, OAuthError } from '../errors';
|
|
15
|
-
export function handleInteractionCodeRedirect(_x, _x2) {
|
|
16
|
-
return _handleInteractionCodeRedirect.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function _handleInteractionCodeRedirect() {
|
|
20
|
-
_handleInteractionCodeRedirect = _asyncToGenerator(function* (authClient, url) {
|
|
21
|
-
var meta = authClient.transactionManager.load();
|
|
22
|
-
|
|
23
|
-
if (!meta) {
|
|
24
|
-
throw new AuthSdkError('No transaction data was found in storage');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var {
|
|
28
|
-
codeVerifier,
|
|
29
|
-
state: savedState
|
|
30
|
-
} = meta;
|
|
31
|
-
var {
|
|
32
|
-
searchParams // URL API has been added to the polyfill
|
|
33
|
-
// eslint-disable-next-line compat/compat
|
|
34
|
-
|
|
35
|
-
} = new URL(url);
|
|
36
|
-
var state = searchParams.get('state');
|
|
37
|
-
var interactionCode = searchParams.get('interaction_code'); // Error handling
|
|
38
|
-
|
|
39
|
-
var error = searchParams.get('error');
|
|
40
|
-
|
|
41
|
-
if (error) {
|
|
42
|
-
throw new OAuthError(error, searchParams.get('error_description'));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (state !== savedState) {
|
|
46
|
-
throw new AuthSdkError('State in redirect uri does not match with transaction state');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!interactionCode) {
|
|
50
|
-
throw new AuthSdkError('Unable to parse interaction_code from the url');
|
|
51
|
-
} // Save tokens to storage
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var {
|
|
55
|
-
tokens
|
|
56
|
-
} = yield authClient.token.exchangeCodeForTokens({
|
|
57
|
-
interactionCode,
|
|
58
|
-
codeVerifier
|
|
59
|
-
});
|
|
60
|
-
authClient.tokenManager.setTokens(tokens);
|
|
61
|
-
});
|
|
62
|
-
return _handleInteractionCodeRedirect.apply(this, arguments);
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=handleInteractionCodeRedirect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/handleInteractionCodeRedirect.ts"],"names":["AuthSdkError","OAuthError","handleInteractionCodeRedirect","authClient","url","meta","transactionManager","load","codeVerifier","state","savedState","searchParams","URL","get","interactionCode","error","tokens","token","exchangeCodeForTokens","tokenManager","setTokens"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,YAAT,EAAuBC,UAAvB,QAAyC,WAAzC;AAIA,gBAAsBC,6BAAtB;AAAA;AAAA;;;qDAAO,WACLC,UADK,EAELC,GAFK,EAGU;AACf,QAAMC,IAAI,GAAGF,UAAU,CAACG,kBAAX,CAA8BC,IAA9B,EAAb;;AACA,QAAI,CAACF,IAAL,EAAW;AACT,YAAM,IAAIL,YAAJ,CAAiB,0CAAjB,CAAN;AACD;;AAED,QAAM;AACJQ,MAAAA,YADI;AAEJC,MAAAA,KAAK,EAAEC;AAFH,QAGFL,IAHJ;AAIA,QAAM;AACJM,MAAAA,YADI,CAEN;AACA;;AAHM,QAIF,IAAIC,GAAJ,CAAQR,GAAR,CAJJ;AAKA,QAAMK,KAAK,GAAGE,YAAY,CAACE,GAAb,CAAiB,OAAjB,CAAd;AACA,QAAMC,eAAe,GAAGH,YAAY,CAACE,GAAb,CAAiB,kBAAjB,CAAxB,CAhBe,CAkBf;;AACA,QAAME,KAAK,GAAGJ,YAAY,CAACE,GAAb,CAAiB,OAAjB,CAAd;;AACA,QAAIE,KAAJ,EAAW;AACT,YAAM,IAAId,UAAJ,CAAec,KAAf,EAAsBJ,YAAY,CAACE,GAAb,CAAiB,mBAAjB,CAAtB,CAAN;AACD;;AACD,QAAIJ,KAAK,KAAKC,UAAd,EAA0B;AACxB,YAAM,IAAIV,YAAJ,CAAiB,6DAAjB,CAAN;AACD;;AACD,QAAI,CAACc,eAAL,EAAsB;AACpB,YAAM,IAAId,YAAJ,CAAiB,+CAAjB,CAAN;AACD,KA5Bc,CA8Bf;;;AACA,QAAM;AAAEgB,MAAAA;AAAF,cAAmBb,UAAU,CAACc,KAAX,CAAiBC,qBAAjB,CAAuC;AAAEJ,MAAAA,eAAF;AAAmBN,MAAAA;AAAnB,KAAvC,CAAzB;AACAL,IAAAA,UAAU,CAACgB,YAAX,CAAwBC,SAAxB,CAAkCJ,MAAlC;AACD,G","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { AuthSdkError, OAuthError } from '../errors';\nimport { OktaAuth } from '..';\nimport {IdxTransactionMeta} from '../types';\n\nexport async function handleInteractionCodeRedirect(\n authClient: OktaAuth, \n url: string\n): Promise<void> {\n const meta = authClient.transactionManager.load() as IdxTransactionMeta;\n if (!meta) {\n throw new AuthSdkError('No transaction data was found in storage');\n }\n\n const { \n codeVerifier,\n state: savedState \n } = meta;\n const { \n searchParams\n // URL API has been added to the polyfill\n // eslint-disable-next-line compat/compat\n } = new URL(url); \n const state = searchParams.get('state');\n const interactionCode = searchParams.get('interaction_code');\n\n // Error handling\n const error = searchParams.get('error');\n if (error) {\n throw new OAuthError(error, searchParams.get('error_description'));\n }\n if (state !== savedState) {\n throw new AuthSdkError('State in redirect uri does not match with transaction state');\n }\n if (!interactionCode) {\n throw new AuthSdkError('Unable to parse interaction_code from the url');\n }\n \n // Save tokens to storage\n const { tokens } = await authClient.token.exchangeCodeForTokens({ interactionCode, codeVerifier });\n authClient.tokenManager.setTokens(tokens);\n}"],"file":"handleInteractionCodeRedirect.js"}
|
package/esm/idx/headers.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
-
*
|
|
11
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
// BETA - SUBJECT TO CHANGE
|
|
20
|
-
// Currently we must modify request headers using the single instance of `idx.client.interceptors` exported from IDX-JS
|
|
21
|
-
// This means that multiple instances of OktaAuth will see the same header modifications
|
|
22
|
-
// TODO: use AuthJS http agent for IDX API requests. OKTA-417473
|
|
23
|
-
import idx from '@okta/okta-idx-js';
|
|
24
|
-
export function setGlobalRequestInterceptor(fn) {
|
|
25
|
-
idx.client.interceptors.request.use(fn);
|
|
26
|
-
} // A factory which returns a function that can be passed to `setGlobalRequestInterceptor`
|
|
27
|
-
|
|
28
|
-
export function createGlobalRequestInterceptor(sdk) {
|
|
29
|
-
return function (requestConfig) {
|
|
30
|
-
// Set user-agent and any other custom headers set in the options
|
|
31
|
-
var oktaUserAgentHeader = sdk._oktaUserAgent.getHttpHeader();
|
|
32
|
-
|
|
33
|
-
var headers = Object.assign(_objectSpread({}, oktaUserAgentHeader), sdk.options.headers);
|
|
34
|
-
Object.keys(headers).forEach(name => {
|
|
35
|
-
requestConfig.headers[name] = headers[name];
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=headers.js.map
|
package/esm/idx/headers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/headers.ts"],"names":["idx","setGlobalRequestInterceptor","fn","client","interceptors","request","use","createGlobalRequestInterceptor","sdk","requestConfig","oktaUserAgentHeader","_oktaUserAgent","getHttpHeader","headers","Object","assign","options","keys","forEach","name"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,OAAOA,GAAP,MAAgB,mBAAhB;AACA,OAAO,SAASC,2BAAT,CAAqCC,EAArC,EAAyC;AAC9CF,EAAAA,GAAG,CAACG,MAAJ,CAAWC,YAAX,CAAwBC,OAAxB,CAAgCC,GAAhC,CAAoCJ,EAApC;AACD,C,CAED;;AACA,OAAO,SAASK,8BAAT,CAAwCC,GAAxC,EAAuD;AAC5D,SAAO,UAAUC,aAAV,EAAyB;AAC9B;AACA,QAAIC,mBAAmB,GAAGF,GAAG,CAACG,cAAJ,CAAmBC,aAAnB,EAA1B;;AACA,QAAMC,OAAO,GAAGC,MAAM,CAACC,MAAP,mBACXL,mBADW,GAEbF,GAAG,CAACQ,OAAJ,CAAYH,OAFC,CAAhB;AAGAC,IAAAA,MAAM,CAACG,IAAP,CAAYJ,OAAZ,EAAqBK,OAArB,CAA6BC,IAAI,IAAI;AACnCV,MAAAA,aAAa,CAACI,OAAd,CAAsBM,IAAtB,IAA8BN,OAAO,CAACM,IAAD,CAArC;AACD,KAFD;AAGD,GATD;AAUD","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// BETA - SUBJECT TO CHANGE\n// Currently we must modify request headers using the single instance of `idx.client.interceptors` exported from IDX-JS\n// This means that multiple instances of OktaAuth will see the same header modifications\n// TODO: use AuthJS http agent for IDX API requests. OKTA-417473\nimport { OktaAuth } from '../types';\nimport idx from '@okta/okta-idx-js';\nexport function setGlobalRequestInterceptor(fn) {\n idx.client.interceptors.request.use(fn);\n}\n\n// A factory which returns a function that can be passed to `setGlobalRequestInterceptor`\nexport function createGlobalRequestInterceptor(sdk: OktaAuth) {\n return function (requestConfig) {\n // Set user-agent and any other custom headers set in the options\n var oktaUserAgentHeader = sdk._oktaUserAgent.getHttpHeader();\n const headers = Object.assign({\n ...oktaUserAgentHeader\n }, sdk.options.headers);\n Object.keys(headers).forEach(name => {\n requestConfig.headers[name] = headers[name];\n });\n };\n}\n"],"file":"headers.js"}
|
package/esm/idx/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
-
*
|
|
5
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
-
*
|
|
10
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
export * from './authenticate';
|
|
13
|
-
export * from './cancel';
|
|
14
|
-
export * from './interact';
|
|
15
|
-
export * from './introspect';
|
|
16
|
-
export * from './register';
|
|
17
|
-
export * from './recoverPassword';
|
|
18
|
-
export * from './handleInteractionCodeRedirect';
|
|
19
|
-
export * from './startTransaction';
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/esm/idx/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,gBAAd;AACA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,mBAAd;AACA,cAAc,iCAAd;AACA,cAAc,oBAAd","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './authenticate';\nexport * from './cancel';\nexport * from './interact';\nexport * from './introspect';\nexport * from './register';\nexport * from './recoverPassword';\nexport * from './handleInteractionCodeRedirect';\nexport * from './startTransaction';\n"],"file":"index.js"}
|
package/esm/idx/interact.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2021, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
-
*
|
|
12
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
*
|
|
17
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import idx from '@okta/okta-idx-js';
|
|
20
|
-
import { getTransactionMeta, saveTransactionMeta } from './transactionMeta';
|
|
21
|
-
import { getOAuthBaseUrl } from '../oidc';
|
|
22
|
-
|
|
23
|
-
function getResponse(meta) {
|
|
24
|
-
return {
|
|
25
|
-
meta,
|
|
26
|
-
interactionHandle: meta.interactionHandle,
|
|
27
|
-
state: meta.state
|
|
28
|
-
};
|
|
29
|
-
} // Begin or resume a transaction. Returns an interaction handle
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export function interact(_x) {
|
|
33
|
-
return _interact.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _interact() {
|
|
37
|
-
_interact = _asyncToGenerator(function* (authClient) {
|
|
38
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39
|
-
var state = options.state || authClient.options.state;
|
|
40
|
-
var meta = yield getTransactionMeta(authClient, {
|
|
41
|
-
state
|
|
42
|
-
}); // Saved transaction, return meta
|
|
43
|
-
|
|
44
|
-
if (meta.interactionHandle) {
|
|
45
|
-
return getResponse(meta);
|
|
46
|
-
} // These properties are always loaded from meta (or calculated fresh)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var {
|
|
50
|
-
codeChallenge,
|
|
51
|
-
codeChallengeMethod
|
|
52
|
-
} = meta; // These properties are defined by global configuration
|
|
53
|
-
|
|
54
|
-
var {
|
|
55
|
-
clientId,
|
|
56
|
-
redirectUri
|
|
57
|
-
} = authClient.options; // These properties can be set in options, but also have a default value in global configuration.
|
|
58
|
-
|
|
59
|
-
state = state || meta.state;
|
|
60
|
-
var scopes = options.scopes || authClient.options.scopes || meta.scopes;
|
|
61
|
-
var baseUrl = getOAuthBaseUrl(authClient);
|
|
62
|
-
return idx.interact({
|
|
63
|
-
// OAuth
|
|
64
|
-
clientId,
|
|
65
|
-
baseUrl,
|
|
66
|
-
scopes,
|
|
67
|
-
state,
|
|
68
|
-
redirectUri,
|
|
69
|
-
// PKCE
|
|
70
|
-
codeChallenge,
|
|
71
|
-
codeChallengeMethod
|
|
72
|
-
}).then(interactionHandle => {
|
|
73
|
-
var newMeta = _objectSpread(_objectSpread({}, meta), {}, {
|
|
74
|
-
interactionHandle,
|
|
75
|
-
state,
|
|
76
|
-
scopes
|
|
77
|
-
}); // Save transaction meta so it can be resumed
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
saveTransactionMeta(authClient, newMeta);
|
|
81
|
-
return getResponse(newMeta);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
return _interact.apply(this, arguments);
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=interact.js.map
|
package/esm/idx/interact.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/interact.ts"],"names":["idx","getTransactionMeta","saveTransactionMeta","getOAuthBaseUrl","getResponse","meta","interactionHandle","state","interact","authClient","options","codeChallenge","codeChallengeMethod","clientId","redirectUri","scopes","baseUrl","then","newMeta"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,GAAP,MAAgB,mBAAhB;AAEA,SAASC,kBAAT,EAA6BC,mBAA7B,QAAwD,mBAAxD;AACA,SAASC,eAAT,QAAgC,SAAhC;;AAaA,SAASC,WAAT,CAAqBC,IAArB,EAAiE;AAC/D,SAAO;AACLA,IAAAA,IADK;AAELC,IAAAA,iBAAiB,EAAED,IAAI,CAACC,iBAFnB;AAGLC,IAAAA,KAAK,EAAEF,IAAI,CAACE;AAHP,GAAP;AAKD,C,CAED;;;AACA,gBAAsBC,QAAtB;AAAA;AAAA;;;gCAAO,WAAyBC,UAAzB,EAAyG;AAAA,QAA1DC,OAA0D,uEAA/B,EAA+B;AAC9G,QAAIH,KAAK,GAAGG,OAAO,CAACH,KAAR,IAAiBE,UAAU,CAACC,OAAX,CAAmBH,KAAhD;AACA,QAAMF,IAAI,SAASJ,kBAAkB,CAACQ,UAAD,EAAa;AAAEF,MAAAA;AAAF,KAAb,CAArC,CAF8G,CAI9G;;AACA,QAAIF,IAAI,CAACC,iBAAT,EAA4B;AAC1B,aAAOF,WAAW,CAACC,IAAD,CAAlB;AACD,KAP6G,CAS9G;;;AACA,QAAM;AAAEM,MAAAA,aAAF;AAAiBC,MAAAA;AAAjB,QAAyCP,IAA/C,CAV8G,CAY9G;;AACA,QAAM;AAAEQ,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA4BL,UAAU,CAACC,OAA7C,CAb8G,CAe9G;;AACAH,IAAAA,KAAK,GAAGA,KAAK,IAAIF,IAAI,CAACE,KAAtB;AACA,QAAMQ,MAAM,GAAGL,OAAO,CAACK,MAAR,IAAkBN,UAAU,CAACC,OAAX,CAAmBK,MAArC,IAA+CV,IAAI,CAACU,MAAnE;AAEA,QAAMC,OAAO,GAAGb,eAAe,CAACM,UAAD,CAA/B;AACA,WAAOT,GAAG,CAACQ,QAAJ,CAAa;AAClB;AACAK,MAAAA,QAFkB;AAGlBG,MAAAA,OAHkB;AAIlBD,MAAAA,MAJkB;AAKlBR,MAAAA,KALkB;AAMlBO,MAAAA,WANkB;AAQlB;AACAH,MAAAA,aATkB;AAUlBC,MAAAA;AAVkB,KAAb,EAWJK,IAXI,CAWCX,iBAAiB,IAAI;AAC3B,UAAMY,OAAO,mCAAQb,IAAR;AAAcC,QAAAA,iBAAd;AAAiCC,QAAAA,KAAjC;AAAwCQ,QAAAA;AAAxC,QAAb,CAD2B,CAE3B;;;AACAb,MAAAA,mBAAmB,CAACO,UAAD,EAAaS,OAAb,CAAnB;AAEA,aAAOd,WAAW,CAACc,OAAD,CAAlB;AACD,KAjBM,CAAP;AAkBD,G","sourcesContent":["/*!\n * Copyright (c) 2021, 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 idx from '@okta/okta-idx-js';\nimport { OktaAuth, IdxTransactionMeta } from '../types';\nimport { getTransactionMeta, saveTransactionMeta } from './transactionMeta';\nimport { getOAuthBaseUrl } from '../oidc';\n\nexport interface InteractOptions {\n state?: string;\n scopes?: string[];\n}\n\nexport interface InteractResponse {\n state?: string;\n interactionHandle: string;\n meta: IdxTransactionMeta;\n}\n\nfunction getResponse(meta: IdxTransactionMeta): InteractResponse {\n return {\n meta,\n interactionHandle: meta.interactionHandle,\n state: meta.state\n };\n}\n\n// Begin or resume a transaction. Returns an interaction handle\nexport async function interact (authClient: OktaAuth, options: InteractOptions = {}): Promise<InteractResponse> {\n let state = options.state || authClient.options.state;\n const meta = await getTransactionMeta(authClient, { state });\n\n // Saved transaction, return meta\n if (meta.interactionHandle) {\n return getResponse(meta);\n }\n\n // These properties are always loaded from meta (or calculated fresh)\n const { codeChallenge, codeChallengeMethod } = meta;\n\n // These properties are defined by global configuration\n const { clientId, redirectUri } = authClient.options;\n\n // These properties can be set in options, but also have a default value in global configuration.\n state = state || meta.state;\n const scopes = options.scopes || authClient.options.scopes || meta.scopes;\n\n const baseUrl = getOAuthBaseUrl(authClient);\n return idx.interact({\n // OAuth\n clientId, \n baseUrl,\n scopes,\n state,\n redirectUri,\n\n // PKCE\n codeChallenge,\n codeChallengeMethod\n }).then(interactionHandle => {\n const newMeta = { ...meta, interactionHandle, state, scopes };\n // Save transaction meta so it can be resumed\n saveTransactionMeta(authClient, newMeta);\n\n return getResponse(newMeta);\n });\n}\n"],"file":"interact.js"}
|
package/esm/idx/introspect.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2021, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
-
*
|
|
12
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
*
|
|
17
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import idx from '@okta/okta-idx-js';
|
|
20
|
-
import { isRawIdxResponse } from './types/idx-js';
|
|
21
|
-
import { getOAuthDomain } from '../oidc';
|
|
22
|
-
import { IDX_API_VERSION } from '../constants';
|
|
23
|
-
export function introspect(_x, _x2) {
|
|
24
|
-
return _introspect.apply(this, arguments);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function _introspect() {
|
|
28
|
-
_introspect = _asyncToGenerator(function* (authClient, options) {
|
|
29
|
-
var useLastResponse = !options.stateTokenExternalId; // email verify callback: must make a new response
|
|
30
|
-
|
|
31
|
-
var rawIdxResponse;
|
|
32
|
-
|
|
33
|
-
if (useLastResponse) {
|
|
34
|
-
// try load from storage first
|
|
35
|
-
rawIdxResponse = authClient.transactionManager.loadIdxResponse();
|
|
36
|
-
} // call idx.introspect if no existing idx response available in storage
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!rawIdxResponse) {
|
|
40
|
-
var version = IDX_API_VERSION;
|
|
41
|
-
var domain = getOAuthDomain(authClient);
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
rawIdxResponse = yield idx.introspect(_objectSpread({
|
|
45
|
-
domain,
|
|
46
|
-
version
|
|
47
|
-
}, options));
|
|
48
|
-
} catch (err) {
|
|
49
|
-
if (isRawIdxResponse(err)) {
|
|
50
|
-
rawIdxResponse = err;
|
|
51
|
-
} else {
|
|
52
|
-
throw err;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return idx.makeIdxState(rawIdxResponse);
|
|
58
|
-
});
|
|
59
|
-
return _introspect.apply(this, arguments);
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=introspect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/introspect.ts"],"names":["idx","isRawIdxResponse","getOAuthDomain","IDX_API_VERSION","introspect","authClient","options","useLastResponse","stateTokenExternalId","rawIdxResponse","transactionManager","loadIdxResponse","version","domain","err","makeIdxState"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,GAAP,MAAgB,mBAAhB;AAEA,SAAsBC,gBAAtB,QAA8D,gBAA9D;AACA,SAASC,cAAT,QAA+B,SAA/B;AACA,SAASC,eAAT,QAAgC,cAAhC;AAQA,gBAAsBC,UAAtB;AAAA;AAAA;;;kCAAO,WAA2BC,UAA3B,EAAiDC,OAAjD,EAAmG;AACxG,QAAMC,eAAe,GAAG,CAACD,OAAO,CAACE,oBAAjC,CADwG,CACjD;;AACvD,QAAIC,cAAJ;;AAEA,QAAIF,eAAJ,EAAqB;AACnB;AACAE,MAAAA,cAAc,GAAGJ,UAAU,CAACK,kBAAX,CAA8BC,eAA9B,EAAjB;AACD,KAPuG,CASxG;;;AACA,QAAI,CAACF,cAAL,EAAqB;AACnB,UAAMG,OAAO,GAAGT,eAAhB;AACA,UAAMU,MAAM,GAAGX,cAAc,CAACG,UAAD,CAA7B;;AACA,UAAI;AACFI,QAAAA,cAAc,SAAST,GAAG,CAACI,UAAJ;AAAiBS,UAAAA,MAAjB;AAAyBD,UAAAA;AAAzB,WAAqCN,OAArC,EAAvB;AACD,OAFD,CAEE,OAAOQ,GAAP,EAAY;AACZ,YAAIb,gBAAgB,CAACa,GAAD,CAApB,EAA2B;AACzBL,UAAAA,cAAc,GAAGK,GAAjB;AACD,SAFD,MAEO;AACL,gBAAMA,GAAN;AACD;AACF;AACF;;AAED,WAAOd,GAAG,CAACe,YAAJ,CAAiBN,cAAjB,CAAP;AACD,G","sourcesContent":["/*!\n * Copyright (c) 2021, 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 idx from '@okta/okta-idx-js';\nimport { OktaAuth } from '../types';\nimport { IdxResponse, isRawIdxResponse, RawIdxResponse } from './types/idx-js';\nimport { getOAuthDomain } from '../oidc';\nimport { IDX_API_VERSION } from '../constants';\n\nexport interface IntrospectOptions {\n interactionHandle?: string;\n stateHandle?: string;\n stateTokenExternalId?: string;\n}\n\nexport async function introspect (authClient: OktaAuth, options: IntrospectOptions): Promise<IdxResponse> {\n const useLastResponse = !options.stateTokenExternalId; // email verify callback: must make a new response\n let rawIdxResponse: RawIdxResponse;\n \n if (useLastResponse) {\n // try load from storage first\n rawIdxResponse = authClient.transactionManager.loadIdxResponse();\n }\n \n // call idx.introspect if no existing idx response available in storage\n if (!rawIdxResponse) {\n const version = IDX_API_VERSION;\n const domain = getOAuthDomain(authClient);\n try {\n rawIdxResponse = await idx.introspect({ domain, version, ...options });\n } catch (err) {\n if (isRawIdxResponse(err)) {\n rawIdxResponse = err;\n } else {\n throw err;\n }\n }\n }\n\n return idx.makeIdxState(rawIdxResponse);\n}\n"],"file":"introspect.js"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
-
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
-
*
|
|
12
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
*
|
|
17
|
-
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { run } from './run';
|
|
20
|
-
import { Identify, SelectAuthenticatorAuthenticate, ChallengeAuthenticator, AuthenticatorVerificationData, ResetAuthenticator, ReEnrollAuthenticator } from './remediators';
|
|
21
|
-
import { PasswordRecoveryFlowMonitor } from './flowMonitors';
|
|
22
|
-
var flow = {
|
|
23
|
-
'identify': Identify,
|
|
24
|
-
'identify-recovery': Identify,
|
|
25
|
-
'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,
|
|
26
|
-
'challenge-authenticator': ChallengeAuthenticator,
|
|
27
|
-
'authenticator-verification-data': AuthenticatorVerificationData,
|
|
28
|
-
'reset-authenticator': ResetAuthenticator,
|
|
29
|
-
'reenroll-authenticator': ReEnrollAuthenticator
|
|
30
|
-
};
|
|
31
|
-
export function recoverPassword(_x, _x2) {
|
|
32
|
-
return _recoverPassword.apply(this, arguments);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _recoverPassword() {
|
|
36
|
-
_recoverPassword = _asyncToGenerator(function* (authClient, options) {
|
|
37
|
-
var flowMonitor = new PasswordRecoveryFlowMonitor(authClient);
|
|
38
|
-
return run(authClient, _objectSpread(_objectSpread({}, options), {}, {
|
|
39
|
-
flow,
|
|
40
|
-
flowMonitor,
|
|
41
|
-
actions: ['currentAuthenticator-recover', 'currentAuthenticatorEnrollment-recover']
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
return _recoverPassword.apply(this, arguments);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=recoverPassword.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/idx/recoverPassword.ts"],"names":["run","Identify","SelectAuthenticatorAuthenticate","ChallengeAuthenticator","AuthenticatorVerificationData","ResetAuthenticator","ReEnrollAuthenticator","PasswordRecoveryFlowMonitor","flow","recoverPassword","authClient","options","flowMonitor","actions"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,GAAT,QAAqC,OAArC;AACA,SACEC,QADF,EAGEC,+BAHF,EAKEC,sBALF,EAOEC,6BAPF,EASEC,kBATF,EAWEC,qBAXF,QAaO,eAbP;AAcA,SAASC,2BAAT,QAA4C,gBAA5C;AAOA,IAAMC,IAAqB,GAAG;AAC5B,cAAYP,QADgB;AAE5B,uBAAqBA,QAFO;AAG5B,uCAAqCC,+BAHT;AAI5B,6BAA2BC,sBAJC;AAK5B,qCAAmCC,6BALP;AAM5B,yBAAuBC,kBANK;AAO5B,4BAA0BC;AAPE,CAA9B;AAkBA,gBAAsBG,eAAtB;AAAA;AAAA;;;uCAAO,WACLC,UADK,EACiBC,OADjB,EAEoB;AACzB,QAAMC,WAAW,GAAG,IAAIL,2BAAJ,CAAgCG,UAAhC,CAApB;AACA,WAAOV,GAAG,CACRU,UADQ,kCAGHC,OAHG;AAINH,MAAAA,IAJM;AAKNI,MAAAA,WALM;AAMNC,MAAAA,OAAO,EAAE,CACP,8BADO,EAEP,wCAFO;AANH,OAAV;AAYD,G","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 { run, RemediationFlow } from './run';\nimport {\n Identify,\n IdentifyValues,\n SelectAuthenticatorAuthenticate,\n SelectAuthenticatorAuthenticateValues,\n ChallengeAuthenticator,\n ChallengeAuthenticatorValues,\n AuthenticatorVerificationData,\n AuthenticatorVerificationDataValues,\n ResetAuthenticator,\n ResetAuthenticatorValues,\n ReEnrollAuthenticator,\n ReEnrollAuthenticatorValues,\n} from './remediators';\nimport { PasswordRecoveryFlowMonitor } from './flowMonitors';\nimport { \n OktaAuth, \n IdxOptions, \n IdxTransaction,\n} from '../types';\n\nconst flow: RemediationFlow = {\n 'identify': Identify,\n 'identify-recovery': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'reset-authenticator': ResetAuthenticator,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n};\n\nexport type PasswordRecoveryOptions = IdxOptions \n & IdentifyValues \n & SelectAuthenticatorAuthenticateValues \n & ChallengeAuthenticatorValues \n & ResetAuthenticatorValues\n & AuthenticatorVerificationDataValues\n & ReEnrollAuthenticatorValues;\n\nexport async function recoverPassword(\n authClient: OktaAuth, options: PasswordRecoveryOptions\n): Promise<IdxTransaction> {\n const flowMonitor = new PasswordRecoveryFlowMonitor(authClient);\n return run(\n authClient, \n { \n ...options,\n flow,\n flowMonitor,\n actions: [\n 'currentAuthenticator-recover', \n 'currentAuthenticatorEnrollment-recover'\n ],\n }\n );\n}\n"],"file":"recoverPassword.js"}
|