@okta/okta-auth-js 5.8.0 → 5.9.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.
Files changed (350) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/cjs/OktaAuth.js +11 -3
  3. package/cjs/OktaAuth.js.map +1 -1
  4. package/cjs/OktaUserAgent.js +2 -2
  5. package/cjs/TransactionManager.js +6 -2
  6. package/cjs/TransactionManager.js.map +1 -1
  7. package/cjs/features.js +1 -1
  8. package/cjs/features.js.map +1 -1
  9. package/cjs/idx/authenticate.js +3 -18
  10. package/cjs/idx/authenticate.js.map +1 -1
  11. package/cjs/idx/flow/AuthenticationFlow.js +30 -0
  12. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
  13. package/cjs/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.js +0 -0
  14. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +1 -0
  15. package/cjs/idx/{flowMonitors → flow}/FlowMonitor.js +0 -0
  16. package/cjs/idx/flow/FlowMonitor.js.map +1 -0
  17. package/cjs/idx/flow/FlowSpecification.js +49 -0
  18. package/cjs/idx/flow/FlowSpecification.js.map +1 -0
  19. package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
  20. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
  21. package/cjs/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.js +0 -0
  22. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +1 -0
  23. package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +15 -12
  24. package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
  25. package/cjs/idx/{flowMonitors → flow}/RegistrationFlowMonitor.js +0 -0
  26. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +1 -0
  27. package/cjs/idx/flow/RemediationFlow.js +2 -0
  28. package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
  29. package/cjs/idx/flow/index.js +119 -0
  30. package/cjs/idx/flow/index.js.map +1 -0
  31. package/cjs/idx/index.js +26 -0
  32. package/cjs/idx/index.js.map +1 -1
  33. package/cjs/idx/interact.js.map +1 -1
  34. package/cjs/idx/proceed.js +49 -0
  35. package/cjs/idx/proceed.js.map +1 -0
  36. package/cjs/idx/recoverPassword.js +3 -17
  37. package/cjs/idx/recoverPassword.js.map +1 -1
  38. package/cjs/idx/register.js +7 -16
  39. package/cjs/idx/register.js.map +1 -1
  40. package/cjs/idx/remediate.js +13 -13
  41. package/cjs/idx/remediate.js.map +1 -1
  42. package/cjs/idx/remediators/Identify.js +2 -1
  43. package/cjs/idx/remediators/Identify.js.map +1 -1
  44. package/cjs/idx/run.js +18 -12
  45. package/cjs/idx/run.js.map +1 -1
  46. package/cjs/idx/startTransaction.js +2 -0
  47. package/cjs/idx/startTransaction.js.map +1 -1
  48. package/cjs/idx/transactionMeta.js +67 -42
  49. package/cjs/idx/transactionMeta.js.map +1 -1
  50. package/cjs/idx/types/FlowIdentifier.js +2 -0
  51. package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
  52. package/cjs/idx/types/idx-js.js.map +1 -1
  53. package/cjs/idx/types/index.js +16 -0
  54. package/cjs/idx/types/index.js.map +1 -1
  55. package/cjs/oidc/endpoints/authorize.js +4 -1
  56. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  57. package/cjs/types/Transaction.js.map +1 -1
  58. package/dist/okta-auth-js.min.js +1 -1
  59. package/dist/okta-auth-js.min.js.map +1 -1
  60. package/dist/okta-auth-js.umd.js +1 -1
  61. package/dist/okta-auth-js.umd.js.map +1 -1
  62. package/esm/index.js +8368 -16
  63. package/esm/index.js.map +1 -1
  64. package/lib/TransactionManager.d.ts +1 -0
  65. package/{esm/crypto/webcrypto.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -4
  66. package/lib/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.d.ts +0 -0
  67. package/lib/idx/{flowMonitors → flow}/FlowMonitor.d.ts +0 -0
  68. package/lib/idx/flow/FlowSpecification.d.ts +10 -0
  69. package/{esm/oidc/endpoints/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -5
  70. package/lib/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.d.ts +0 -0
  71. package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
  72. package/lib/idx/{flowMonitors → flow}/RegistrationFlowMonitor.d.ts +0 -0
  73. package/{esm/crypto/index.js → lib/idx/flow/RemediationFlow.d.ts} +3 -6
  74. package/lib/idx/{flowMonitors → flow}/index.d.ts +7 -2
  75. package/lib/idx/index.d.ts +2 -0
  76. package/{esm/errors/AuthPollStopError.js → lib/idx/proceed.d.ts} +9 -9
  77. package/lib/idx/remediators/Identify.d.ts +1 -0
  78. package/lib/idx/run.d.ts +9 -10
  79. package/lib/idx/transactionMeta.d.ts +24 -1
  80. package/lib/idx/types/FlowIdentifier.d.ts +1 -0
  81. package/lib/idx/types/idx-js.d.ts +3 -0
  82. package/lib/idx/types/index.d.ts +8 -1
  83. package/lib/types/OktaAuthOptions.d.ts +2 -0
  84. package/lib/types/Transaction.d.ts +2 -0
  85. package/lib/types/api.d.ts +12 -1
  86. package/package.json +18 -7
  87. package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  88. package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
  89. package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  90. package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  91. package/cjs/idx/flowMonitors/index.js +0 -54
  92. package/cjs/idx/flowMonitors/index.js.map +0 -1
  93. package/esm/AuthStateManager.js +0 -214
  94. package/esm/AuthStateManager.js.map +0 -1
  95. package/esm/OktaAuth.js +0 -705
  96. package/esm/OktaAuth.js.map +0 -1
  97. package/esm/OktaUserAgent.js +0 -49
  98. package/esm/OktaUserAgent.js.map +0 -1
  99. package/esm/PromiseQueue.js +0 -71
  100. package/esm/PromiseQueue.js.map +0 -1
  101. package/esm/SavedObject.js +0 -91
  102. package/esm/SavedObject.js.map +0 -1
  103. package/esm/StorageManager.js +0 -190
  104. package/esm/StorageManager.js.map +0 -1
  105. package/esm/TokenManager.js +0 -455
  106. package/esm/TokenManager.js.map +0 -1
  107. package/esm/TransactionManager.js +0 -324
  108. package/esm/TransactionManager.js.map +0 -1
  109. package/esm/browser/browserStorage.js +0 -256
  110. package/esm/browser/browserStorage.js.map +0 -1
  111. package/esm/browser/fingerprint.js +0 -74
  112. package/esm/browser/fingerprint.js.map +0 -1
  113. package/esm/builderUtil.js +0 -56
  114. package/esm/builderUtil.js.map +0 -1
  115. package/esm/clock.js +0 -32
  116. package/esm/clock.js.map +0 -1
  117. package/esm/constants.js +0 -36
  118. package/esm/constants.js.map +0 -1
  119. package/esm/crypto/base64.js +0 -66
  120. package/esm/crypto/base64.js.map +0 -1
  121. package/esm/crypto/browser.js.map +0 -1
  122. package/esm/crypto/index.js.map +0 -1
  123. package/esm/crypto/node.js +0 -54
  124. package/esm/crypto/node.js.map +0 -1
  125. package/esm/crypto/oidcHash.js +0 -27
  126. package/esm/crypto/oidcHash.js.map +0 -1
  127. package/esm/crypto/verifyToken.js +0 -39
  128. package/esm/crypto/verifyToken.js.map +0 -1
  129. package/esm/crypto/webcrypto.js.map +0 -1
  130. package/esm/errors/AuthApiError.js +0 -30
  131. package/esm/errors/AuthApiError.js.map +0 -1
  132. package/esm/errors/AuthPollStopError.js.map +0 -1
  133. package/esm/errors/AuthSdkError.js +0 -29
  134. package/esm/errors/AuthSdkError.js.map +0 -1
  135. package/esm/errors/CustomError.js +0 -21
  136. package/esm/errors/CustomError.js.map +0 -1
  137. package/esm/errors/OAuthError.js +0 -22
  138. package/esm/errors/OAuthError.js.map +0 -1
  139. package/esm/errors/index.js +0 -22
  140. package/esm/errors/index.js.map +0 -1
  141. package/esm/features.js +0 -64
  142. package/esm/features.js.map +0 -1
  143. package/esm/fetch/fetchRequest.js +0 -92
  144. package/esm/fetch/fetchRequest.js.map +0 -1
  145. package/esm/http/headers.js +0 -17
  146. package/esm/http/headers.js.map +0 -1
  147. package/esm/http/index.js +0 -3
  148. package/esm/http/index.js.map +0 -1
  149. package/esm/http/request.js +0 -145
  150. package/esm/http/request.js.map +0 -1
  151. package/esm/idx/authenticate.js +0 -47
  152. package/esm/idx/authenticate.js.map +0 -1
  153. package/esm/idx/cancel.js +0 -32
  154. package/esm/idx/cancel.js.map +0 -1
  155. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
  156. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  157. package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
  158. package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
  159. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
  160. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  161. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
  162. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  163. package/esm/idx/flowMonitors/index.js +0 -16
  164. package/esm/idx/flowMonitors/index.js.map +0 -1
  165. package/esm/idx/handleInteractionCodeRedirect.js +0 -64
  166. package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
  167. package/esm/idx/headers.js +0 -39
  168. package/esm/idx/headers.js.map +0 -1
  169. package/esm/idx/index.js +0 -20
  170. package/esm/idx/index.js.map +0 -1
  171. package/esm/idx/interact.js +0 -86
  172. package/esm/idx/interact.js.map +0 -1
  173. package/esm/idx/introspect.js +0 -61
  174. package/esm/idx/introspect.js.map +0 -1
  175. package/esm/idx/recoverPassword.js +0 -46
  176. package/esm/idx/recoverPassword.js.map +0 -1
  177. package/esm/idx/register.js +0 -63
  178. package/esm/idx/register.js.map +0 -1
  179. package/esm/idx/remediate.js +0 -302
  180. package/esm/idx/remediate.js.map +0 -1
  181. package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
  182. package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
  183. package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
  184. package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
  185. package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
  186. package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
  187. package/esm/idx/remediators/Base/Remediator.js +0 -221
  188. package/esm/idx/remediators/Base/Remediator.js.map +0 -1
  189. package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
  190. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
  191. package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -65
  192. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
  193. package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
  194. package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
  195. package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
  196. package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
  197. package/esm/idx/remediators/EnrollProfile.js +0 -79
  198. package/esm/idx/remediators/EnrollProfile.js.map +0 -1
  199. package/esm/idx/remediators/Identify.js +0 -87
  200. package/esm/idx/remediators/Identify.js.map +0 -1
  201. package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
  202. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
  203. package/esm/idx/remediators/RedirectIdp.js +0 -38
  204. package/esm/idx/remediators/RedirectIdp.js.map +0 -1
  205. package/esm/idx/remediators/ResetAuthenticator.js +0 -18
  206. package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
  207. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
  208. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
  209. package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
  210. package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
  211. package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
  212. package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
  213. package/esm/idx/remediators/Skip.js +0 -23
  214. package/esm/idx/remediators/Skip.js.map +0 -1
  215. package/esm/idx/remediators/index.js +0 -26
  216. package/esm/idx/remediators/index.js.map +0 -1
  217. package/esm/idx/remediators/util.js +0 -35
  218. package/esm/idx/remediators/util.js.map +0 -1
  219. package/esm/idx/run.js +0 -222
  220. package/esm/idx/run.js.map +0 -1
  221. package/esm/idx/startTransaction.js +0 -27
  222. package/esm/idx/startTransaction.js.map +0 -1
  223. package/esm/idx/transactionMeta.js +0 -125
  224. package/esm/idx/transactionMeta.js.map +0 -1
  225. package/esm/idx/types/idx-js.js +0 -20
  226. package/esm/idx/types/idx-js.js.map +0 -1
  227. package/esm/idx/types/index.js +0 -44
  228. package/esm/idx/types/index.js.map +0 -1
  229. package/esm/oidc/decodeToken.js +0 -31
  230. package/esm/oidc/decodeToken.js.map +0 -1
  231. package/esm/oidc/endpoints/authorize.js +0 -61
  232. package/esm/oidc/endpoints/authorize.js.map +0 -1
  233. package/esm/oidc/endpoints/index.js.map +0 -1
  234. package/esm/oidc/endpoints/token.js +0 -97
  235. package/esm/oidc/endpoints/token.js.map +0 -1
  236. package/esm/oidc/endpoints/well-known.js +0 -58
  237. package/esm/oidc/endpoints/well-known.js.map +0 -1
  238. package/esm/oidc/exchangeCodeForTokens.js +0 -69
  239. package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
  240. package/esm/oidc/getToken.js +0 -180
  241. package/esm/oidc/getToken.js.map +0 -1
  242. package/esm/oidc/getUserInfo.js +0 -82
  243. package/esm/oidc/getUserInfo.js.map +0 -1
  244. package/esm/oidc/getWithPopup.js +0 -34
  245. package/esm/oidc/getWithPopup.js.map +0 -1
  246. package/esm/oidc/getWithRedirect.js +0 -61
  247. package/esm/oidc/getWithRedirect.js.map +0 -1
  248. package/esm/oidc/getWithoutPrompt.js +0 -29
  249. package/esm/oidc/getWithoutPrompt.js.map +0 -1
  250. package/esm/oidc/handleOAuthResponse.js +0 -148
  251. package/esm/oidc/handleOAuthResponse.js.map +0 -1
  252. package/esm/oidc/index.js +0 -29
  253. package/esm/oidc/index.js.map +0 -1
  254. package/esm/oidc/parseFromUrl.js +0 -144
  255. package/esm/oidc/parseFromUrl.js.map +0 -1
  256. package/esm/oidc/renewToken.js +0 -85
  257. package/esm/oidc/renewToken.js.map +0 -1
  258. package/esm/oidc/renewTokens.js +0 -74
  259. package/esm/oidc/renewTokens.js.map +0 -1
  260. package/esm/oidc/renewTokensWithRefresh.js +0 -55
  261. package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
  262. package/esm/oidc/revokeToken.js +0 -57
  263. package/esm/oidc/revokeToken.js.map +0 -1
  264. package/esm/oidc/util/browser.js +0 -74
  265. package/esm/oidc/util/browser.js.map +0 -1
  266. package/esm/oidc/util/defaultTokenParams.js +0 -42
  267. package/esm/oidc/util/defaultTokenParams.js.map +0 -1
  268. package/esm/oidc/util/errors.js +0 -31
  269. package/esm/oidc/util/errors.js.map +0 -1
  270. package/esm/oidc/util/index.js +0 -25
  271. package/esm/oidc/util/index.js.map +0 -1
  272. package/esm/oidc/util/loginRedirect.js +0 -88
  273. package/esm/oidc/util/loginRedirect.js.map +0 -1
  274. package/esm/oidc/util/oauth.js +0 -70
  275. package/esm/oidc/util/oauth.js.map +0 -1
  276. package/esm/oidc/util/pkce.js +0 -55
  277. package/esm/oidc/util/pkce.js.map +0 -1
  278. package/esm/oidc/util/prepareTokenParams.js +0 -75
  279. package/esm/oidc/util/prepareTokenParams.js.map +0 -1
  280. package/esm/oidc/util/refreshToken.js +0 -24
  281. package/esm/oidc/util/refreshToken.js.map +0 -1
  282. package/esm/oidc/util/urlParams.js +0 -54
  283. package/esm/oidc/util/urlParams.js.map +0 -1
  284. package/esm/oidc/util/validateClaims.js +0 -53
  285. package/esm/oidc/util/validateClaims.js.map +0 -1
  286. package/esm/oidc/util/validateToken.js +0 -21
  287. package/esm/oidc/util/validateToken.js.map +0 -1
  288. package/esm/oidc/verifyToken.js +0 -78
  289. package/esm/oidc/verifyToken.js.map +0 -1
  290. package/esm/options.js +0 -144
  291. package/esm/options.js.map +0 -1
  292. package/esm/server/serverStorage.js +0 -111
  293. package/esm/server/serverStorage.js.map +0 -1
  294. package/esm/services/TokenService.js +0 -103
  295. package/esm/services/TokenService.js.map +0 -1
  296. package/esm/session.js +0 -81
  297. package/esm/session.js.map +0 -1
  298. package/esm/tx/AuthTransaction.js +0 -213
  299. package/esm/tx/AuthTransaction.js.map +0 -1
  300. package/esm/tx/TransactionState.js.map +0 -1
  301. package/esm/tx/api.js +0 -87
  302. package/esm/tx/api.js.map +0 -1
  303. package/esm/tx/index.js +0 -18
  304. package/esm/tx/index.js.map +0 -1
  305. package/esm/tx/poll.js +0 -124
  306. package/esm/tx/poll.js.map +0 -1
  307. package/esm/tx/util.js +0 -26
  308. package/esm/tx/util.js.map +0 -1
  309. package/esm/types/AuthState.js +0 -3
  310. package/esm/types/Cookies.js +0 -3
  311. package/esm/types/EventEmitter.js +0 -3
  312. package/esm/types/EventEmitter.js.map +0 -1
  313. package/esm/types/JWT.js +0 -3
  314. package/esm/types/JWT.js.map +0 -1
  315. package/esm/types/OAuth.js +0 -3
  316. package/esm/types/OAuth.js.map +0 -1
  317. package/esm/types/OktaAuthOptions.js +0 -3
  318. package/esm/types/OktaAuthOptions.js.map +0 -1
  319. package/esm/types/Storage.js +0 -3
  320. package/esm/types/Storage.js.map +0 -1
  321. package/esm/types/Token.js +0 -29
  322. package/esm/types/Token.js.map +0 -1
  323. package/esm/types/TokenManager.js +0 -3
  324. package/esm/types/TokenManager.js.map +0 -1
  325. package/esm/types/Transaction.js +0 -57
  326. package/esm/types/Transaction.js.map +0 -1
  327. package/esm/types/UserClaims.js +0 -3
  328. package/esm/types/UserClaims.js.map +0 -1
  329. package/esm/types/api.js +0 -3
  330. package/esm/types/api.js.map +0 -1
  331. package/esm/types/http.js +0 -3
  332. package/esm/types/http.js.map +0 -1
  333. package/esm/types/index.js +0 -27
  334. package/esm/types/index.js.map +0 -1
  335. package/esm/util/console.js +0 -53
  336. package/esm/util/console.js.map +0 -1
  337. package/esm/util/emailVerify.js +0 -21
  338. package/esm/util/emailVerify.js.map +0 -1
  339. package/esm/util/index.js +0 -18
  340. package/esm/util/index.js.map +0 -1
  341. package/esm/util/misc.js +0 -33
  342. package/esm/util/misc.js.map +0 -1
  343. package/esm/util/object.js +0 -117
  344. package/esm/util/object.js.map +0 -1
  345. package/esm/util/sharedStorage.js +0 -43
  346. package/esm/util/sharedStorage.js.map +0 -1
  347. package/esm/util/types.js +0 -27
  348. package/esm/util/types.js.map +0 -1
  349. package/esm/util/url.js +0 -64
  350. package/esm/util/url.js.map +0 -1
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ exports.getFlowSpecification = getFlowSpecification;
4
+
5
+ var _AuthenticationFlow = require("./AuthenticationFlow");
6
+
7
+ var _AuthenticationFlowMonitor = require("./AuthenticationFlowMonitor");
8
+
9
+ var _PasswordRecoveryFlow = require("./PasswordRecoveryFlow");
10
+
11
+ var _PasswordRecoveryFlowMonitor = require("./PasswordRecoveryFlowMonitor");
12
+
13
+ var _RegistrationFlow = require("./RegistrationFlow");
14
+
15
+ var _RegistrationFlowMonitor = require("./RegistrationFlowMonitor");
16
+
17
+ function getFlowSpecification(oktaAuth, flow = 'proceed') {
18
+ let remediators, flowMonitor, actions;
19
+
20
+ switch (flow) {
21
+ case 'register':
22
+ case 'signup':
23
+ case 'enrollProfile':
24
+ remediators = _RegistrationFlow.RegistrationFlow;
25
+ flowMonitor = new _RegistrationFlowMonitor.RegistrationFlowMonitor(oktaAuth);
26
+ break;
27
+
28
+ case 'recoverPassword':
29
+ case 'resetPassword':
30
+ remediators = _PasswordRecoveryFlow.PasswordRecoveryFlow;
31
+ flowMonitor = new _PasswordRecoveryFlowMonitor.PasswordRecoveryFlowMonitor(oktaAuth);
32
+ actions = ['currentAuthenticator-recover', 'currentAuthenticatorEnrollment-recover'];
33
+ break;
34
+
35
+ default:
36
+ // authenticate
37
+ remediators = _AuthenticationFlow.AuthenticationFlow;
38
+ flowMonitor = new _AuthenticationFlowMonitor.AuthenticationFlowMonitor(oktaAuth);
39
+ break;
40
+ }
41
+
42
+ return {
43
+ flow,
44
+ remediators,
45
+ flowMonitor,
46
+ actions
47
+ };
48
+ }
49
+ //# sourceMappingURL=FlowSpecification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/FlowSpecification.ts"],"names":["getFlowSpecification","oktaAuth","flow","remediators","flowMonitor","actions","RegistrationFlow","RegistrationFlowMonitor","PasswordRecoveryFlow","PasswordRecoveryFlowMonitor","AuthenticationFlow","AuthenticationFlowMonitor"],"mappings":";;;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAUO,SAASA,oBAAT,CAA8BC,QAA9B,EAAkDC,IAAoB,GAAG,SAAzE,EAAuG;AAC5G,MAAIC,WAAJ,EAAiBC,WAAjB,EAA8BC,OAA9B;;AACA,UAAQH,IAAR;AACE,SAAK,UAAL;AACA,SAAK,QAAL;AACA,SAAK,eAAL;AACEC,MAAAA,WAAW,GAAGG,kCAAd;AACAF,MAAAA,WAAW,GAAG,IAAIG,gDAAJ,CAA4BN,QAA5B,CAAd;AACA;;AACF,SAAK,iBAAL;AACA,SAAK,eAAL;AACEE,MAAAA,WAAW,GAAGK,0CAAd;AACAJ,MAAAA,WAAW,GAAG,IAAIK,wDAAJ,CAAgCR,QAAhC,CAAd;AACAI,MAAAA,OAAO,GAAG,CACR,8BADQ,EAER,wCAFQ,CAAV;AAIA;;AACF;AACE;AACAF,MAAAA,WAAW,GAAGO,sCAAd;AACAN,MAAAA,WAAW,GAAG,IAAIO,oDAAJ,CAA8BV,QAA9B,CAAd;AACA;AApBJ;;AAsBA,SAAO;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,WAAR;AAAqBC,IAAAA,WAArB;AAAkCC,IAAAA;AAAlC,GAAP;AACD","sourcesContent":["import { OktaAuth, FlowIdentifier } from '../../types';\nimport { AuthenticationFlow } from './AuthenticationFlow';\nimport { AuthenticationFlowMonitor } from './AuthenticationFlowMonitor';\nimport { FlowMonitor } from './FlowMonitor';\nimport { PasswordRecoveryFlow } from './PasswordRecoveryFlow';\nimport { PasswordRecoveryFlowMonitor } from './PasswordRecoveryFlowMonitor';\nimport { RegistrationFlow } from './RegistrationFlow';\nimport { RegistrationFlowMonitor } from './RegistrationFlowMonitor';\nimport { RemediationFlow } from './RemediationFlow';\n\nexport interface FlowSpecification {\n flow: FlowIdentifier;\n remediators: RemediationFlow;\n flowMonitor: FlowMonitor;\n actions?: string[];\n}\n\nexport function getFlowSpecification(oktaAuth: OktaAuth, flow: FlowIdentifier = 'proceed'): FlowSpecification {\n let remediators, flowMonitor, actions;\n switch (flow) {\n case 'register':\n case 'signup':\n case 'enrollProfile':\n remediators = RegistrationFlow;\n flowMonitor = new RegistrationFlowMonitor(oktaAuth);\n break;\n case 'recoverPassword':\n case 'resetPassword':\n remediators = PasswordRecoveryFlow;\n flowMonitor = new PasswordRecoveryFlowMonitor(oktaAuth);\n actions = [\n 'currentAuthenticator-recover', \n 'currentAuthenticatorEnrollment-recover'\n ];\n break;\n default:\n // authenticate\n remediators = AuthenticationFlow;\n flowMonitor = new AuthenticationFlowMonitor(oktaAuth);\n break;\n }\n return { flow, remediators, flowMonitor, actions };\n}\n"],"file":"FlowSpecification.js"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ exports.PasswordRecoveryFlow = void 0;
4
+
5
+ var _remediators = require("../remediators");
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
+ const PasswordRecoveryFlow = {
19
+ 'identify': _remediators.Identify,
20
+ 'identify-recovery': _remediators.Identify,
21
+ 'select-authenticator-authenticate': _remediators.SelectAuthenticatorAuthenticate,
22
+ 'challenge-authenticator': _remediators.ChallengeAuthenticator,
23
+ 'authenticator-verification-data': _remediators.AuthenticatorVerificationData,
24
+ 'reset-authenticator': _remediators.ResetAuthenticator,
25
+ 'reenroll-authenticator': _remediators.ReEnrollAuthenticator
26
+ };
27
+ exports.PasswordRecoveryFlow = PasswordRecoveryFlow;
28
+ //# sourceMappingURL=PasswordRecoveryFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/PasswordRecoveryFlow.ts"],"names":["PasswordRecoveryFlow","Identify","SelectAuthenticatorAuthenticate","ChallengeAuthenticator","AuthenticatorVerificationData","ResetAuthenticator","ReEnrollAuthenticator"],"mappings":";;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaO,MAAMA,oBAAqC,GAAG;AACnD,cAAYC,qBADuC;AAEnD,uBAAqBA,qBAF8B;AAGnD,uCAAqCC,4CAHc;AAInD,6BAA2BC,mCAJwB;AAKnD,qCAAmCC,0CALgB;AAMnD,yBAAuBC,+BAN4B;AAOnD,4BAA0BC;AAPyB,CAA9C","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 { RemediationFlow } from './RemediationFlow';\nimport {\n Identify,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n AuthenticatorVerificationData,\n ResetAuthenticator,\n ReEnrollAuthenticator,\n} from '../remediators';\n\nexport const PasswordRecoveryFlow: 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"],"file":"PasswordRecoveryFlow.js"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/PasswordRecoveryFlowMonitor.ts"],"names":["PasswordRecoveryFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name","isFinished","authClient"],"mappings":";;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAMA,2BAAN,SAA0CC,wBAA1C,CAAsD;AAC3DC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,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,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,yBAAzC,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,WAAO,MAAMV,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAEe,QAAVQ,UAAU,GAAG;AACjB,UAAM;AAAET,MAAAA;AAAF,QAAoB,MAAM,yCAAmB,KAAKU,UAAxB,CAAhC;;AACA,QAAI,CAACV,YAAY,CAACM,QAAb,CAAsB,qBAAtB,CAAL,EAAmD;AACjD,aAAO,KAAP;AACD;;AAED,WAAO,MAAM,MAAMG,UAAN,EAAb;AACD;;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,3 +1,9 @@
1
+ "use strict";
2
+
3
+ exports.RegistrationFlow = void 0;
4
+
5
+ var _remediators = require("../remediators");
6
+
1
7
  /*!
2
8
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
9
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -9,16 +15,13 @@
9
15
  *
10
16
  * See the License for the specific language governing permissions and limitations under the License.
11
17
  */
12
-
13
- /* global atob, btoa, crypto */
14
- var a = function a(str) {
15
- return atob(str);
18
+ const RegistrationFlow = {
19
+ 'select-enroll-profile': _remediators.SelectEnrollProfile,
20
+ 'enroll-profile': _remediators.EnrollProfile,
21
+ 'authenticator-enrollment-data': _remediators.AuthenticatorEnrollmentData,
22
+ 'select-authenticator-enroll': _remediators.SelectAuthenticatorEnroll,
23
+ 'enroll-authenticator': _remediators.EnrollAuthenticator,
24
+ 'skip': _remediators.Skip
16
25
  };
17
-
18
- var b = function b(str) {
19
- return btoa(str);
20
- };
21
-
22
- var c = typeof crypto === 'undefined' ? null : crypto;
23
- export { a as atob, b as btoa, c as webcrypto };
24
- //# sourceMappingURL=browser.js.map
26
+ exports.RegistrationFlow = RegistrationFlow;
27
+ //# sourceMappingURL=RegistrationFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/RegistrationFlow.ts"],"names":["RegistrationFlow","SelectEnrollProfile","EnrollProfile","AuthenticatorEnrollmentData","SelectAuthenticatorEnroll","EnrollAuthenticator","Skip"],"mappings":";;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaO,MAAMA,gBAAiC,GAAG;AAC/C,2BAAyBC,gCADsB;AAE/C,oBAAkBC,0BAF6B;AAG/C,mCAAiCC,wCAHc;AAI/C,iCAA+BC,sCAJgB;AAK/C,0BAAwBC,gCALuB;AAM/C,UAAQC;AANuC,CAA1C","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 { RemediationFlow } from './RemediationFlow';\nimport { \n SelectEnrollProfile,\n EnrollProfile,\n SelectAuthenticatorEnroll,\n EnrollAuthenticator,\n AuthenticatorEnrollmentData,\n Skip,\n} from '../remediators';\n\nexport const RegistrationFlow: RemediationFlow = {\n 'select-enroll-profile': SelectEnrollProfile,\n 'enroll-profile': EnrollProfile,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'enroll-authenticator': EnrollAuthenticator,\n 'skip': Skip,\n};\n"],"file":"RegistrationFlow.js"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/RegistrationFlowMonitor.ts"],"names":["RegistrationFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes"],"mappings":";;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;AACvDC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,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"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=RemediationFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"Cookies.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"RemediationFlow.js"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ var _AuthenticationFlow = require("./AuthenticationFlow");
4
+
5
+ Object.keys(_AuthenticationFlow).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _AuthenticationFlow[key]) return;
8
+ Object.defineProperty(exports, key, {
9
+ enumerable: true,
10
+ get: function () {
11
+ return _AuthenticationFlow[key];
12
+ }
13
+ });
14
+ });
15
+
16
+ var _AuthenticationFlowMonitor = require("./AuthenticationFlowMonitor");
17
+
18
+ Object.keys(_AuthenticationFlowMonitor).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _AuthenticationFlowMonitor[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _AuthenticationFlowMonitor[key];
25
+ }
26
+ });
27
+ });
28
+
29
+ var _FlowMonitor = require("./FlowMonitor");
30
+
31
+ Object.keys(_FlowMonitor).forEach(function (key) {
32
+ if (key === "default" || key === "__esModule") return;
33
+ if (key in exports && exports[key] === _FlowMonitor[key]) return;
34
+ Object.defineProperty(exports, key, {
35
+ enumerable: true,
36
+ get: function () {
37
+ return _FlowMonitor[key];
38
+ }
39
+ });
40
+ });
41
+
42
+ var _FlowSpecification = require("./FlowSpecification");
43
+
44
+ Object.keys(_FlowSpecification).forEach(function (key) {
45
+ if (key === "default" || key === "__esModule") return;
46
+ if (key in exports && exports[key] === _FlowSpecification[key]) return;
47
+ Object.defineProperty(exports, key, {
48
+ enumerable: true,
49
+ get: function () {
50
+ return _FlowSpecification[key];
51
+ }
52
+ });
53
+ });
54
+
55
+ var _PasswordRecoveryFlow = require("./PasswordRecoveryFlow");
56
+
57
+ Object.keys(_PasswordRecoveryFlow).forEach(function (key) {
58
+ if (key === "default" || key === "__esModule") return;
59
+ if (key in exports && exports[key] === _PasswordRecoveryFlow[key]) return;
60
+ Object.defineProperty(exports, key, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _PasswordRecoveryFlow[key];
64
+ }
65
+ });
66
+ });
67
+
68
+ var _PasswordRecoveryFlowMonitor = require("./PasswordRecoveryFlowMonitor");
69
+
70
+ Object.keys(_PasswordRecoveryFlowMonitor).forEach(function (key) {
71
+ if (key === "default" || key === "__esModule") return;
72
+ if (key in exports && exports[key] === _PasswordRecoveryFlowMonitor[key]) return;
73
+ Object.defineProperty(exports, key, {
74
+ enumerable: true,
75
+ get: function () {
76
+ return _PasswordRecoveryFlowMonitor[key];
77
+ }
78
+ });
79
+ });
80
+
81
+ var _RegistrationFlow = require("./RegistrationFlow");
82
+
83
+ Object.keys(_RegistrationFlow).forEach(function (key) {
84
+ if (key === "default" || key === "__esModule") return;
85
+ if (key in exports && exports[key] === _RegistrationFlow[key]) return;
86
+ Object.defineProperty(exports, key, {
87
+ enumerable: true,
88
+ get: function () {
89
+ return _RegistrationFlow[key];
90
+ }
91
+ });
92
+ });
93
+
94
+ var _RegistrationFlowMonitor = require("./RegistrationFlowMonitor");
95
+
96
+ Object.keys(_RegistrationFlowMonitor).forEach(function (key) {
97
+ if (key === "default" || key === "__esModule") return;
98
+ if (key in exports && exports[key] === _RegistrationFlowMonitor[key]) return;
99
+ Object.defineProperty(exports, key, {
100
+ enumerable: true,
101
+ get: function () {
102
+ return _RegistrationFlowMonitor[key];
103
+ }
104
+ });
105
+ });
106
+
107
+ var _RemediationFlow = require("./RemediationFlow");
108
+
109
+ Object.keys(_RemediationFlow).forEach(function (key) {
110
+ if (key === "default" || key === "__esModule") return;
111
+ if (key in exports && exports[key] === _RemediationFlow[key]) return;
112
+ Object.defineProperty(exports, key, {
113
+ enumerable: true,
114
+ get: function () {
115
+ return _RemediationFlow[key];
116
+ }
117
+ });
118
+ });
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/flow/index.ts"],"names":[],"mappings":";;AAYA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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\nexport * from './AuthenticationFlow';\nexport * from './AuthenticationFlowMonitor';\nexport * from './FlowMonitor';\nexport * from './FlowSpecification';\nexport * from './PasswordRecoveryFlow';\nexport * from './PasswordRecoveryFlowMonitor';\nexport * from './RegistrationFlow';\nexport * from './RegistrationFlowMonitor';\nexport * from './RemediationFlow';\n"],"file":"index.js"}
package/cjs/idx/index.js CHANGED
@@ -52,6 +52,19 @@ Object.keys(_introspect).forEach(function (key) {
52
52
  });
53
53
  });
54
54
 
55
+ var _proceed = require("./proceed");
56
+
57
+ Object.keys(_proceed).forEach(function (key) {
58
+ if (key === "default" || key === "__esModule") return;
59
+ if (key in exports && exports[key] === _proceed[key]) return;
60
+ Object.defineProperty(exports, key, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _proceed[key];
64
+ }
65
+ });
66
+ });
67
+
55
68
  var _register = require("./register");
56
69
 
57
70
  Object.keys(_register).forEach(function (key) {
@@ -103,4 +116,17 @@ Object.keys(_startTransaction).forEach(function (key) {
103
116
  }
104
117
  });
105
118
  });
119
+
120
+ var _transactionMeta = require("./transactionMeta");
121
+
122
+ Object.keys(_transactionMeta).forEach(function (key) {
123
+ if (key === "default" || key === "__esModule") return;
124
+ if (key in exports && exports[key] === _transactionMeta[key]) return;
125
+ Object.defineProperty(exports, key, {
126
+ enumerable: true,
127
+ get: function () {
128
+ return _transactionMeta[key];
129
+ }
130
+ });
131
+ });
106
132
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/idx/index.ts"],"names":[],"mappings":";;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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"}
1
+ {"version":3,"sources":["../../../lib/idx/index.ts"],"names":[],"mappings":";;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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 './proceed';\nexport * from './register';\nexport * from './recoverPassword';\nexport * from './handleInteractionCodeRedirect';\nexport * from './startTransaction';\nexport * from './transactionMeta';\n"],"file":"index.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/idx/interact.ts"],"names":["getResponse","meta","interactionHandle","state","interact","authClient","options","codeChallenge","codeChallengeMethod","clientId","redirectUri","scopes","baseUrl","idx","then","newMeta"],"mappings":";;;;;;AAYA;;AAEA;;AACA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA,SAASA,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;;;AACO,eAAeC,QAAf,CAAyBC,UAAzB,EAA+CC,OAAwB,GAAG,EAA1E,EAAyG;AAC9G,MAAIH,KAAK,GAAGG,OAAO,CAACH,KAAR,IAAiBE,UAAU,CAACC,OAAX,CAAmBH,KAAhD;AACA,QAAMF,IAAI,GAAG,MAAM,yCAAmBI,UAAnB,EAA+B;AAAEF,IAAAA;AAAF,GAA/B,CAAnB,CAF8G,CAI9G;;AACA,MAAIF,IAAI,CAACC,iBAAT,EAA4B;AAC1B,WAAOF,WAAW,CAACC,IAAD,CAAlB;AACD,GAP6G,CAS9G;;;AACA,QAAM;AAAEM,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAyCP,IAA/C,CAV8G,CAY9G;;AACA,QAAM;AAAEQ,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA4BL,UAAU,CAACC,OAA7C,CAb8G,CAe9G;;AACAH,EAAAA,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,GAAG,2BAAgBP,UAAhB,CAAhB;AACA,SAAOQ,mBAAIT,QAAJ,CAAa;AAClB;AACAK,IAAAA,QAFkB;AAGlBG,IAAAA,OAHkB;AAIlBD,IAAAA,MAJkB;AAKlBR,IAAAA,KALkB;AAMlBO,IAAAA,WANkB;AAQlB;AACAH,IAAAA,aATkB;AAUlBC,IAAAA;AAVkB,GAAb,EAWJM,IAXI,CAWCZ,iBAAiB,IAAI;AAC3B,UAAMa,OAAO,GAAG,EAAE,GAAGd,IAAL;AAAWC,MAAAA,iBAAX;AAA8BC,MAAAA,KAA9B;AAAqCQ,MAAAA;AAArC,KAAhB,CAD2B,CAE3B;;AACA,8CAAoBN,UAApB,EAAgCU,OAAhC;AAEA,WAAOf,WAAW,CAACe,OAAD,CAAlB;AACD,GAjBM,CAAP;AAkBD","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"}
1
+ {"version":3,"sources":["../../../lib/idx/interact.ts"],"names":["getResponse","meta","interactionHandle","state","interact","authClient","options","codeChallenge","codeChallengeMethod","clientId","redirectUri","scopes","baseUrl","idx","then","newMeta"],"mappings":";;;;;;AAYA;;AAEA;;AACA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA,SAASA,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;;;AACO,eAAeC,QAAf,CAAyBC,UAAzB,EAA+CC,OAAwB,GAAG,EAA1E,EAAyG;AAC9G,MAAIH,KAAK,GAAGG,OAAO,CAACH,KAAR,IAAiBE,UAAU,CAACC,OAAX,CAAmBH,KAAhD;AACA,QAAMF,IAAI,GAAG,MAAM,yCAAmBI,UAAnB,EAA+B;AAAEF,IAAAA;AAAF,GAA/B,CAAnB,CAF8G,CAI9G;;AACA,MAAIF,IAAI,CAACC,iBAAT,EAA4B;AAC1B,WAAOF,WAAW,CAACC,IAAD,CAAlB;AACD,GAP6G,CAS9G;;;AACA,QAAM;AAAEM,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAyCP,IAA/C,CAV8G,CAY9G;;AACA,QAAM;AAAEQ,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA4BL,UAAU,CAACC,OAA7C,CAb8G,CAe9G;;AACAH,EAAAA,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,GAAG,2BAAgBP,UAAhB,CAAhB;AACA,SAAOQ,mBAAIT,QAAJ,CAAa;AAClB;AACAK,IAAAA,QAFkB;AAGlBG,IAAAA,OAHkB;AAIlBD,IAAAA,MAJkB;AAKlBR,IAAAA,KALkB;AAMlBO,IAAAA,WANkB;AAQlB;AACAH,IAAAA,aATkB;AAUlBC,IAAAA;AAVkB,GAAb,EAWJM,IAXI,CAWCZ,iBAAiB,IAAI;AAC3B,UAAMa,OAAO,GAAG,EACd,GAAGd,IADW;AAEdC,MAAAA,iBAFc;AAGdC,MAAAA,KAHc;AAIdQ,MAAAA;AAJc,KAAhB,CAD2B,CAO3B;;AACA,8CAAoBN,UAApB,EAAgCU,OAAhC;AAEA,WAAOf,WAAW,CAACe,OAAD,CAAlB;AACD,GAtBM,CAAP;AAuBD","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 = {\n ...meta,\n interactionHandle,\n state,\n scopes\n };\n // Save transaction meta so it can be resumed\n saveTransactionMeta(authClient, newMeta);\n\n return getResponse(newMeta);\n });\n}\n"],"file":"interact.js"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ exports.canProceed = canProceed;
4
+ exports.proceed = proceed;
5
+
6
+ var _run = require("./run");
7
+
8
+ var _transactionMeta = require("./transactionMeta");
9
+
10
+ var _flow = require("./flow");
11
+
12
+ var _errors = require("../errors");
13
+
14
+ /*!
15
+ * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
16
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
17
+ *
18
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ *
23
+ * See the License for the specific language governing permissions and limitations under the License.
24
+ */
25
+ function canProceed(authClient, options) {
26
+ const meta = (0, _transactionMeta.getSavedTransactionMeta)(authClient, options);
27
+ return !!meta;
28
+ }
29
+
30
+ async function proceed(authClient, options = {}) {
31
+ const {
32
+ stateTokenExternalId,
33
+ state
34
+ } = options;
35
+ const meta = (0, _transactionMeta.getSavedTransactionMeta)(authClient, {
36
+ state
37
+ }); // Proceed always needs saved transaction meta, except in the case of email verify callback
38
+
39
+ if (!meta && !stateTokenExternalId) {
40
+ throw new _errors.AuthSdkError('Unable to proceed: saved transaction could not be loaded');
41
+ } // Determine the flow specification based on the saved flow
42
+
43
+
44
+ const flowSpec = (0, _flow.getFlowSpecification)(authClient, meta === null || meta === void 0 ? void 0 : meta.flow);
45
+ return (0, _run.run)(authClient, { ...options,
46
+ ...flowSpec
47
+ });
48
+ }
49
+ //# sourceMappingURL=proceed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../lib/idx/proceed.ts"],"names":["canProceed","authClient","options","meta","proceed","stateTokenExternalId","state","AuthSdkError","flowSpec","flow"],"mappings":";;;;;AAiBA;;AAIA;;AACA;;AACA;;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBO,SAASA,UAAT,CAAoBC,UAApB,EAA0CC,OAA1C,EAAwE;AAC7E,QAAMC,IAAI,GAAG,8CAAwBF,UAAxB,EAAoCC,OAApC,CAAb;AACA,SAAO,CAAC,CAACC,IAAT;AACD;;AAEM,eAAeC,OAAf,CACLH,UADK,EAELC,OAAuB,GAAG,EAFrB,EAGoB;AACzB,QAAM;AAAEG,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAkCJ,OAAxC;AACA,QAAMC,IAAI,GAAG,8CAAwBF,UAAxB,EAAoC;AAAEK,IAAAA;AAAF,GAApC,CAAb,CAFyB,CAIzB;;AACA,MAAI,CAACH,IAAD,IAAS,CAACE,oBAAd,EAAoC;AAClC,UAAM,IAAIE,oBAAJ,CAAiB,0DAAjB,CAAN;AACD,GAPwB,CASzB;;;AACA,QAAMC,QAAQ,GAAG,gCAAqBP,UAArB,EAAiCE,IAAjC,aAAiCA,IAAjC,uBAAiCA,IAAI,CAAEM,IAAvC,CAAjB;AAEA,SAAO,cAAIR,UAAJ,EAAgB,EACrB,GAAGC,OADkB;AAErB,OAAGM;AAFkB,GAAhB,CAAP;AAID","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 { \n OktaAuth,\n IdxTransaction,\n} from '../types';\nimport { run } from './run';\nimport { AuthenticationOptions } from './authenticate';\nimport { RegistrationOptions } from './register';\nimport { PasswordRecoveryOptions } from './recoverPassword';\nimport { getSavedTransactionMeta } from './transactionMeta';\nimport { getFlowSpecification } from './flow';\nimport { AuthSdkError } from '../errors';\n\nexport type ProceedOptions = AuthenticationOptions\n & RegistrationOptions\n & PasswordRecoveryOptions;\n\nexport function canProceed(authClient: OktaAuth, options?: { state?: string }) {\n const meta = getSavedTransactionMeta(authClient, options);\n return !!meta;\n}\n\nexport async function proceed(\n authClient: OktaAuth,\n options: ProceedOptions = {}\n): Promise<IdxTransaction> {\n const { stateTokenExternalId, state } = options;\n const meta = getSavedTransactionMeta(authClient, { state });\n\n // Proceed always needs saved transaction meta, except in the case of email verify callback\n if (!meta && !stateTokenExternalId) {\n throw new AuthSdkError('Unable to proceed: saved transaction could not be loaded');\n }\n\n // Determine the flow specification based on the saved flow\n const flowSpec = getFlowSpecification(authClient, meta?.flow);\n\n return run(authClient, { \n ...options, \n ...flowSpec\n });\n}\n"],"file":"proceed.js"}
@@ -4,9 +4,7 @@ exports.recoverPassword = recoverPassword;
4
4
 
5
5
  var _run = require("./run");
6
6
 
7
- var _remediators = require("./remediators");
8
-
9
- var _flowMonitors = require("./flowMonitors");
7
+ var _flow = require("./flow");
10
8
 
11
9
  /*!
12
10
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
@@ -19,22 +17,10 @@ var _flowMonitors = require("./flowMonitors");
19
17
  *
20
18
  * See the License for the specific language governing permissions and limitations under the License.
21
19
  */
22
- const flow = {
23
- 'identify': _remediators.Identify,
24
- 'identify-recovery': _remediators.Identify,
25
- 'select-authenticator-authenticate': _remediators.SelectAuthenticatorAuthenticate,
26
- 'challenge-authenticator': _remediators.ChallengeAuthenticator,
27
- 'authenticator-verification-data': _remediators.AuthenticatorVerificationData,
28
- 'reset-authenticator': _remediators.ResetAuthenticator,
29
- 'reenroll-authenticator': _remediators.ReEnrollAuthenticator
30
- };
31
-
32
20
  async function recoverPassword(authClient, options) {
33
- const flowMonitor = new _flowMonitors.PasswordRecoveryFlowMonitor(authClient);
21
+ const flowSpec = (0, _flow.getFlowSpecification)(authClient, 'recoverPassword');
34
22
  return (0, _run.run)(authClient, { ...options,
35
- flow,
36
- flowMonitor,
37
- actions: ['currentAuthenticator-recover', 'currentAuthenticatorEnrollment-recover']
23
+ ...flowSpec
38
24
  });
39
25
  }
40
26
  //# sourceMappingURL=recoverPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/idx/recoverPassword.ts"],"names":["flow","Identify","SelectAuthenticatorAuthenticate","ChallengeAuthenticator","AuthenticatorVerificationData","ResetAuthenticator","ReEnrollAuthenticator","recoverPassword","authClient","options","flowMonitor","PasswordRecoveryFlowMonitor","actions"],"mappings":";;;;AAaA;;AACA;;AAcA;;AA5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA,MAAMA,IAAqB,GAAG;AAC5B,cAAYC,qBADgB;AAE5B,uBAAqBA,qBAFO;AAG5B,uCAAqCC,4CAHT;AAI5B,6BAA2BC,mCAJC;AAK5B,qCAAmCC,0CALP;AAM5B,yBAAuBC,+BANK;AAO5B,4BAA0BC;AAPE,CAA9B;;AAkBO,eAAeC,eAAf,CACLC,UADK,EACiBC,OADjB,EAEoB;AACzB,QAAMC,WAAW,GAAG,IAAIC,yCAAJ,CAAgCH,UAAhC,CAApB;AACA,SAAO,cACLA,UADK,EAEL,EACE,GAAGC,OADL;AAEET,IAAAA,IAFF;AAGEU,IAAAA,WAHF;AAIEE,IAAAA,OAAO,EAAE,CACP,8BADO,EAEP,wCAFO;AAJX,GAFK,CAAP;AAYD","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"}
1
+ {"version":3,"sources":["../../../lib/idx/recoverPassword.ts"],"names":["recoverPassword","authClient","options","flowSpec"],"mappings":";;;;AAaA;;AASA;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA2BO,eAAeA,eAAf,CACLC,UADK,EACiBC,OADjB,EAEoB;AACzB,QAAMC,QAAQ,GAAG,gCAAqBF,UAArB,EAAiC,iBAAjC,CAAjB;AACA,SAAO,cACLA,UADK,EAEL,EACE,GAAGC,OADL;AAEE,OAAGC;AAFL,GAFK,CAAP;AAOD","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 } from './run';\nimport {\n IdentifyValues,\n SelectAuthenticatorAuthenticateValues,\n ChallengeAuthenticatorValues,\n AuthenticatorVerificationDataValues,\n ResetAuthenticatorValues,\n ReEnrollAuthenticatorValues,\n} from './remediators';\nimport { getFlowSpecification } from './flow';\nimport { \n OktaAuth, \n IdxOptions, \n IdxTransaction,\n} from '../types';\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 flowSpec = getFlowSpecification(authClient, 'recoverPassword');\n return run(\n authClient, \n { \n ...options,\n ...flowSpec,\n }\n );\n}\n"],"file":"recoverPassword.js"}
@@ -8,9 +8,7 @@ var _transactionMeta = require("./transactionMeta");
8
8
 
9
9
  var _startTransaction = require("./startTransaction");
10
10
 
11
- var _remediators = require("./remediators");
12
-
13
- var _flowMonitors = require("./flowMonitors");
11
+ var _flow = require("./flow");
14
12
 
15
13
  var _errors = require("../errors");
16
14
 
@@ -27,21 +25,15 @@ var _types = require("../types");
27
25
  *
28
26
  * See the License for the specific language governing permissions and limitations under the License.
29
27
  */
30
- const flow = {
31
- 'select-enroll-profile': _remediators.SelectEnrollProfile,
32
- 'enroll-profile': _remediators.EnrollProfile,
33
- 'authenticator-enrollment-data': _remediators.AuthenticatorEnrollmentData,
34
- 'select-authenticator-enroll': _remediators.SelectAuthenticatorEnroll,
35
- 'enroll-authenticator': _remediators.EnrollAuthenticator,
36
- 'skip': _remediators.Skip
37
- };
38
-
39
28
  async function register(authClient, options) {
40
29
  // Only check at the beginning of the transaction
41
30
  if (!(0, _transactionMeta.transactionMetaExist)(authClient)) {
42
31
  const {
43
32
  enabledFeatures
44
- } = await (0, _startTransaction.startTransaction)(authClient, options);
33
+ } = await (0, _startTransaction.startTransaction)(authClient, {
34
+ flow: 'register',
35
+ ...options
36
+ });
45
37
 
46
38
  if (enabledFeatures && !enabledFeatures.includes(_types.IdxFeature.REGISTRATION)) {
47
39
  const error = new _errors.AuthSdkError('Registration is not supported based on your current org configuration.');
@@ -52,10 +44,9 @@ async function register(authClient, options) {
52
44
  }
53
45
  }
54
46
 
55
- const flowMonitor = new _flowMonitors.RegistrationFlowMonitor(authClient);
47
+ const flowSpec = (0, _flow.getFlowSpecification)(authClient, 'register');
56
48
  return (0, _run.run)(authClient, { ...options,
57
- flow,
58
- flowMonitor
49
+ ...flowSpec
59
50
  });
60
51
  }
61
52
  //# sourceMappingURL=register.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/idx/register.ts"],"names":["flow","SelectEnrollProfile","EnrollProfile","AuthenticatorEnrollmentData","SelectAuthenticatorEnroll","EnrollAuthenticator","Skip","register","authClient","options","enabledFeatures","includes","IdxFeature","REGISTRATION","error","AuthSdkError","status","IdxStatus","FAILURE","flowMonitor","RegistrationFlowMonitor"],"mappings":";;;;AAaA;;AACA;;AACA;;AACA;;AAaA;;AACA;;AACA;;AA/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA6BA,MAAMA,IAAqB,GAAG;AAC5B,2BAAyBC,gCADG;AAE5B,oBAAkBC,0BAFU;AAG5B,mCAAiCC,wCAHL;AAI5B,iCAA+BC,sCAJH;AAK5B,0BAAwBC,gCALI;AAM5B,UAAQC;AANoB,CAA9B;;AAgBO,eAAeC,QAAf,CACLC,UADK,EACiBC,OADjB,EAEoB;AACzB;AACA,MAAI,CAAC,2CAAqBD,UAArB,CAAL,EAAuC;AACrC,UAAM;AAAEE,MAAAA;AAAF,QAAsB,MAAM,wCAAiBF,UAAjB,EAA6BC,OAA7B,CAAlC;;AACA,QAAIC,eAAe,IAAI,CAACA,eAAe,CAACC,QAAhB,CAAyBC,kBAAWC,YAApC,CAAxB,EAA2E;AACzE,YAAMC,KAAK,GAAG,IAAIC,oBAAJ,CAAiB,wEAAjB,CAAd;AACA,aAAO;AAAEC,QAAAA,MAAM,EAAEC,iBAAUC,OAApB;AAA6BJ,QAAAA;AAA7B,OAAP;AACD;AACF;;AAED,QAAMK,WAAW,GAAG,IAAIC,qCAAJ,CAA4BZ,UAA5B,CAApB;AACA,SAAO,cAAIA,UAAJ,EAAgB,EACrB,GAAGC,OADkB;AAErBT,IAAAA,IAFqB;AAGrBmB,IAAAA;AAHqB,GAAhB,CAAP;AAKD","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 { transactionMetaExist } from './transactionMeta';\nimport { startTransaction } from './startTransaction';\nimport { \n SelectEnrollProfile,\n EnrollProfile,\n EnrollProfileValues,\n SelectAuthenticatorEnroll,\n SelectAuthenticatorEnrollValues,\n EnrollAuthenticator,\n EnrollAuthenticatorValues,\n AuthenticatorEnrollmentData,\n AuthenticatorEnrollmentDataValues,\n Skip,\n SkipValues,\n} from './remediators';\nimport { RegistrationFlowMonitor } from './flowMonitors';\nimport { AuthSdkError } from '../errors';\nimport { \n IdxOptions, \n IdxTransaction, \n OktaAuth, \n IdxFeature,\n IdxStatus,\n} from '../types';\n\nconst flow: RemediationFlow = {\n 'select-enroll-profile': SelectEnrollProfile,\n 'enroll-profile': EnrollProfile,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'enroll-authenticator': EnrollAuthenticator,\n 'skip': Skip,\n};\n\nexport type RegistrationOptions = IdxOptions \n & EnrollProfileValues \n & SelectAuthenticatorEnrollValues \n & EnrollAuthenticatorValues \n & AuthenticatorEnrollmentDataValues \n & SkipValues;\n\nexport async function register(\n authClient: OktaAuth, options: RegistrationOptions\n): Promise<IdxTransaction> {\n // Only check at the beginning of the transaction\n if (!transactionMetaExist(authClient)) {\n const { enabledFeatures } = await startTransaction(authClient, options);\n if (enabledFeatures && !enabledFeatures.includes(IdxFeature.REGISTRATION)) {\n const error = new AuthSdkError('Registration is not supported based on your current org configuration.');\n return { status: IdxStatus.FAILURE, error };\n }\n }\n \n const flowMonitor = new RegistrationFlowMonitor(authClient);\n return run(authClient, { \n ...options, \n flow,\n flowMonitor,\n });\n}\n"],"file":"register.js"}
1
+ {"version":3,"sources":["../../../lib/idx/register.ts"],"names":["register","authClient","options","enabledFeatures","flow","includes","IdxFeature","REGISTRATION","error","AuthSdkError","status","IdxStatus","FAILURE","flowSpec"],"mappings":";;;;AAaA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA8BO,eAAeA,QAAf,CACLC,UADK,EACiBC,OADjB,EAEoB;AACzB;AACA,MAAI,CAAC,2CAAqBD,UAArB,CAAL,EAAuC;AACrC,UAAM;AAAEE,MAAAA;AAAF,QAAsB,MAAM,wCAAiBF,UAAjB,EAA6B;AAAEG,MAAAA,IAAI,EAAE,UAAR;AAAoB,SAAGF;AAAvB,KAA7B,CAAlC;;AACA,QAAIC,eAAe,IAAI,CAACA,eAAe,CAACE,QAAhB,CAAyBC,kBAAWC,YAApC,CAAxB,EAA2E;AACzE,YAAMC,KAAK,GAAG,IAAIC,oBAAJ,CAAiB,wEAAjB,CAAd;AACA,aAAO;AAAEC,QAAAA,MAAM,EAAEC,iBAAUC,OAApB;AAA6BJ,QAAAA;AAA7B,OAAP;AACD;AACF;;AAED,QAAMK,QAAQ,GAAG,gCAAqBZ,UAArB,EAAiC,UAAjC,CAAjB;AACA,SAAO,cAAIA,UAAJ,EAAgB,EACrB,GAAGC,OADkB;AAErB,OAAGW;AAFkB,GAAhB,CAAP;AAID","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 } from './run';\nimport { transactionMetaExist } from './transactionMeta';\nimport { startTransaction } from './startTransaction';\nimport { \n EnrollProfileValues,\n SelectAuthenticatorEnrollValues,\n EnrollAuthenticatorValues,\n AuthenticatorEnrollmentDataValues,\n SkipValues,\n} from './remediators';\nimport { getFlowSpecification } from './flow';\nimport { AuthSdkError } from '../errors';\nimport { \n IdxOptions, \n IdxTransaction, \n OktaAuth, \n IdxFeature,\n IdxStatus,\n} from '../types';\n\nexport type RegistrationOptions = IdxOptions \n & EnrollProfileValues \n & SelectAuthenticatorEnrollValues \n & EnrollAuthenticatorValues \n & AuthenticatorEnrollmentDataValues \n & SkipValues;\n\nexport async function register(\n authClient: OktaAuth, options: RegistrationOptions\n): Promise<IdxTransaction> {\n // Only check at the beginning of the transaction\n if (!transactionMetaExist(authClient)) {\n const { enabledFeatures } = await startTransaction(authClient, { flow: 'register', ...options });\n if (enabledFeatures && !enabledFeatures.includes(IdxFeature.REGISTRATION)) {\n const error = new AuthSdkError('Registration is not supported based on your current org configuration.');\n return { status: IdxStatus.FAILURE, error };\n }\n }\n\n const flowSpec = getFlowSpecification(authClient, 'register');\n return run(authClient, { \n ...options, \n ...flowSpec\n });\n}\n"],"file":"register.js"}