@okta/okta-auth-js 5.5.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 (424) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +61 -15
  3. package/cjs/AuthStateManager.js +5 -0
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +78 -29
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/StorageManager.js +16 -0
  9. package/cjs/StorageManager.js.map +1 -1
  10. package/cjs/TransactionManager.js +49 -9
  11. package/cjs/TransactionManager.js.map +1 -1
  12. package/cjs/builderUtil.js +6 -0
  13. package/cjs/builderUtil.js.map +1 -1
  14. package/cjs/constants.js +5 -1
  15. package/cjs/constants.js.map +1 -1
  16. package/cjs/features.js +1 -1
  17. package/cjs/features.js.map +1 -1
  18. package/cjs/idx/authenticate.js +3 -18
  19. package/cjs/idx/authenticate.js.map +1 -1
  20. package/cjs/idx/flow/AuthenticationFlow.js +30 -0
  21. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
  22. package/cjs/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.js +0 -0
  23. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +1 -0
  24. package/cjs/idx/{flowMonitors → flow}/FlowMonitor.js +0 -0
  25. package/cjs/idx/flow/FlowMonitor.js.map +1 -0
  26. package/cjs/idx/flow/FlowSpecification.js +49 -0
  27. package/cjs/idx/flow/FlowSpecification.js.map +1 -0
  28. package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
  29. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
  30. package/cjs/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.js +0 -0
  31. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +1 -0
  32. package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +15 -12
  33. package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
  34. package/cjs/idx/{flowMonitors → flow}/RegistrationFlowMonitor.js +0 -0
  35. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +1 -0
  36. package/cjs/idx/flow/RemediationFlow.js +2 -0
  37. package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
  38. package/cjs/idx/flow/index.js +119 -0
  39. package/cjs/idx/flow/index.js.map +1 -0
  40. package/cjs/idx/index.js +26 -0
  41. package/cjs/idx/index.js.map +1 -1
  42. package/cjs/idx/interact.js +5 -2
  43. package/cjs/idx/interact.js.map +1 -1
  44. package/cjs/idx/introspect.js +24 -7
  45. package/cjs/idx/introspect.js.map +1 -1
  46. package/cjs/idx/proceed.js +49 -0
  47. package/cjs/idx/proceed.js.map +1 -0
  48. package/cjs/idx/recoverPassword.js +3 -17
  49. package/cjs/idx/recoverPassword.js.map +1 -1
  50. package/cjs/idx/register.js +7 -16
  51. package/cjs/idx/register.js.map +1 -1
  52. package/cjs/idx/remediate.js +46 -52
  53. package/cjs/idx/remediate.js.map +1 -1
  54. package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -7
  55. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  56. package/cjs/idx/remediators/Base/Remediator.js +13 -7
  57. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  58. package/cjs/idx/remediators/Base/SelectAuthenticator.js +6 -6
  59. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  60. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +18 -14
  61. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  62. package/cjs/idx/remediators/EnrollProfile.js +14 -0
  63. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  64. package/cjs/idx/remediators/Identify.js +7 -3
  65. package/cjs/idx/remediators/Identify.js.map +1 -1
  66. package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -1
  67. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  68. package/cjs/idx/run.js +36 -8
  69. package/cjs/idx/run.js.map +1 -1
  70. package/cjs/idx/startTransaction.js +2 -0
  71. package/cjs/idx/startTransaction.js.map +1 -1
  72. package/cjs/idx/transactionMeta.js +80 -40
  73. package/cjs/idx/transactionMeta.js.map +1 -1
  74. package/cjs/idx/types/FlowIdentifier.js +2 -0
  75. package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
  76. package/cjs/idx/types/idx-js.js +5 -0
  77. package/cjs/idx/types/idx-js.js.map +1 -1
  78. package/cjs/idx/types/index.js +33 -6
  79. package/cjs/idx/types/index.js.map +1 -1
  80. package/cjs/oidc/endpoints/authorize.js +4 -1
  81. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  82. package/cjs/oidc/getToken.js +14 -9
  83. package/cjs/oidc/getToken.js.map +1 -1
  84. package/cjs/oidc/getWithPopup.js +9 -2
  85. package/cjs/oidc/getWithPopup.js.map +1 -1
  86. package/cjs/oidc/getWithRedirect.js.map +1 -1
  87. package/cjs/oidc/parseFromUrl.js +59 -20
  88. package/cjs/oidc/parseFromUrl.js.map +1 -1
  89. package/cjs/oidc/renewTokens.js +28 -5
  90. package/cjs/oidc/renewTokens.js.map +1 -1
  91. package/cjs/oidc/util/browser.js +1 -13
  92. package/cjs/oidc/util/browser.js.map +1 -1
  93. package/cjs/oidc/util/loginRedirect.js +9 -5
  94. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  95. package/cjs/oidc/util/urlParams.js +1 -1
  96. package/cjs/oidc/util/urlParams.js.map +1 -1
  97. package/cjs/options.js +15 -2
  98. package/cjs/options.js.map +1 -1
  99. package/cjs/server/serverStorage.js +2 -1
  100. package/cjs/server/serverStorage.js.map +1 -1
  101. package/cjs/tx/AuthTransaction.js +1 -3
  102. package/cjs/tx/AuthTransaction.js.map +1 -1
  103. package/cjs/tx/api.js +3 -0
  104. package/cjs/tx/api.js.map +1 -1
  105. package/cjs/types/Transaction.js.map +1 -1
  106. package/{esm/clock.js → cjs/util/emailVerify.js} +14 -18
  107. package/cjs/util/emailVerify.js.map +1 -0
  108. package/cjs/util/index.js +13 -0
  109. package/cjs/util/index.js.map +1 -1
  110. package/cjs/util/sharedStorage.js +54 -0
  111. package/cjs/util/sharedStorage.js.map +1 -0
  112. package/dist/okta-auth-js.min.js +2 -74
  113. package/dist/okta-auth-js.min.js.LICENSE.txt +32 -0
  114. package/dist/okta-auth-js.min.js.map +1 -1
  115. package/dist/okta-auth-js.polyfill.js +2 -18
  116. package/{esm/crypto/webcrypto.js → dist/okta-auth-js.polyfill.js.LICENSE.txt} +8 -4
  117. package/dist/okta-auth-js.polyfill.js.map +1 -1
  118. package/dist/okta-auth-js.umd.js +2 -74
  119. package/dist/okta-auth-js.umd.js.LICENSE.txt +32 -0
  120. package/dist/okta-auth-js.umd.js.map +1 -1
  121. package/esm/index.js +8368 -16
  122. package/esm/index.js.map +1 -1
  123. package/lib/AuthStateManager.d.ts +4 -2
  124. package/lib/OktaAuth.d.ts +9 -5
  125. package/lib/StorageManager.d.ts +2 -0
  126. package/lib/TransactionManager.d.ts +6 -1
  127. package/lib/constants.d.ts +2 -0
  128. package/lib/crypto/base64.d.ts +2 -2
  129. package/lib/crypto/oidcHash.d.ts +1 -1
  130. package/lib/crypto/verifyToken.d.ts +1 -1
  131. package/{esm/oidc/endpoints/index.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -5
  132. package/lib/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.d.ts +0 -0
  133. package/lib/idx/{flowMonitors → flow}/FlowMonitor.d.ts +0 -0
  134. package/lib/idx/flow/FlowSpecification.d.ts +10 -0
  135. package/{esm/crypto/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -6
  136. package/lib/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.d.ts +0 -0
  137. package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
  138. package/lib/idx/{flowMonitors → flow}/RegistrationFlowMonitor.d.ts +0 -0
  139. package/lib/idx/flow/RemediationFlow.d.ts +13 -0
  140. package/lib/idx/{flowMonitors → flow}/index.d.ts +7 -2
  141. package/lib/idx/index.d.ts +2 -0
  142. package/lib/idx/introspect.d.ts +2 -1
  143. package/{esm/errors/AuthApiError.js → lib/idx/proceed.d.ts} +9 -19
  144. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +2 -5
  145. package/lib/idx/remediators/Base/Remediator.d.ts +3 -6
  146. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +3 -6
  147. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +1 -1
  148. package/lib/idx/remediators/EnrollProfile.d.ts +1 -0
  149. package/lib/idx/remediators/Identify.d.ts +2 -5
  150. package/lib/idx/run.d.ts +9 -9
  151. package/lib/idx/transactionMeta.d.ts +28 -4
  152. package/lib/idx/types/FlowIdentifier.d.ts +1 -0
  153. package/lib/idx/types/idx-js.d.ts +5 -0
  154. package/lib/idx/types/index.d.ts +28 -10
  155. package/lib/oidc/getToken.d.ts +2 -2
  156. package/lib/oidc/parseFromUrl.d.ts +4 -1
  157. package/lib/oidc/renewTokens.d.ts +0 -12
  158. package/lib/oidc/util/loginRedirect.d.ts +1 -1
  159. package/lib/types/AuthState.d.ts +1 -0
  160. package/lib/types/OktaAuthOptions.d.ts +3 -1
  161. package/lib/types/Transaction.d.ts +7 -1
  162. package/lib/types/api.d.ts +21 -5
  163. package/{esm/errors/AuthPollStopError.js → lib/util/emailVerify.d.ts} +5 -8
  164. package/lib/util/index.d.ts +1 -0
  165. package/lib/util/sharedStorage.d.ts +6 -0
  166. package/package.json +26 -13
  167. package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  168. package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
  169. package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  170. package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  171. package/cjs/idx/flowMonitors/index.js +0 -54
  172. package/cjs/idx/flowMonitors/index.js.map +0 -1
  173. package/esm/AuthStateManager.js +0 -209
  174. package/esm/AuthStateManager.js.map +0 -1
  175. package/esm/OktaAuth.js +0 -665
  176. package/esm/OktaAuth.js.map +0 -1
  177. package/esm/OktaUserAgent.js +0 -49
  178. package/esm/OktaUserAgent.js.map +0 -1
  179. package/esm/PromiseQueue.js +0 -71
  180. package/esm/PromiseQueue.js.map +0 -1
  181. package/esm/SavedObject.js +0 -91
  182. package/esm/SavedObject.js.map +0 -1
  183. package/esm/StorageManager.js +0 -174
  184. package/esm/StorageManager.js.map +0 -1
  185. package/esm/TokenManager.js +0 -455
  186. package/esm/TokenManager.js.map +0 -1
  187. package/esm/TransactionManager.js +0 -289
  188. package/esm/TransactionManager.js.map +0 -1
  189. package/esm/browser/browserStorage.js +0 -256
  190. package/esm/browser/browserStorage.js.map +0 -1
  191. package/esm/browser/fingerprint.js +0 -74
  192. package/esm/browser/fingerprint.js.map +0 -1
  193. package/esm/builderUtil.js +0 -50
  194. package/esm/builderUtil.js.map +0 -1
  195. package/esm/clock.js.map +0 -1
  196. package/esm/constants.js +0 -34
  197. package/esm/constants.js.map +0 -1
  198. package/esm/crypto/base64.js +0 -66
  199. package/esm/crypto/base64.js.map +0 -1
  200. package/esm/crypto/browser.js.map +0 -1
  201. package/esm/crypto/index.js.map +0 -1
  202. package/esm/crypto/node.js +0 -54
  203. package/esm/crypto/node.js.map +0 -1
  204. package/esm/crypto/oidcHash.js +0 -27
  205. package/esm/crypto/oidcHash.js.map +0 -1
  206. package/esm/crypto/verifyToken.js +0 -39
  207. package/esm/crypto/verifyToken.js.map +0 -1
  208. package/esm/crypto/webcrypto.js.map +0 -1
  209. package/esm/errors/AuthApiError.js.map +0 -1
  210. package/esm/errors/AuthPollStopError.js.map +0 -1
  211. package/esm/errors/AuthSdkError.js +0 -29
  212. package/esm/errors/AuthSdkError.js.map +0 -1
  213. package/esm/errors/CustomError.js +0 -21
  214. package/esm/errors/CustomError.js.map +0 -1
  215. package/esm/errors/OAuthError.js +0 -22
  216. package/esm/errors/OAuthError.js.map +0 -1
  217. package/esm/errors/index.js +0 -22
  218. package/esm/errors/index.js.map +0 -1
  219. package/esm/features.js +0 -64
  220. package/esm/features.js.map +0 -1
  221. package/esm/fetch/fetchRequest.js +0 -92
  222. package/esm/fetch/fetchRequest.js.map +0 -1
  223. package/esm/http/headers.js +0 -17
  224. package/esm/http/headers.js.map +0 -1
  225. package/esm/http/index.js +0 -3
  226. package/esm/http/index.js.map +0 -1
  227. package/esm/http/request.js +0 -145
  228. package/esm/http/request.js.map +0 -1
  229. package/esm/idx/authenticate.js +0 -47
  230. package/esm/idx/authenticate.js.map +0 -1
  231. package/esm/idx/cancel.js +0 -32
  232. package/esm/idx/cancel.js.map +0 -1
  233. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
  234. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  235. package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
  236. package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
  237. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
  238. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  239. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
  240. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  241. package/esm/idx/flowMonitors/index.js +0 -16
  242. package/esm/idx/flowMonitors/index.js.map +0 -1
  243. package/esm/idx/handleInteractionCodeRedirect.js +0 -64
  244. package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
  245. package/esm/idx/headers.js +0 -39
  246. package/esm/idx/headers.js.map +0 -1
  247. package/esm/idx/index.js +0 -20
  248. package/esm/idx/index.js.map +0 -1
  249. package/esm/idx/interact.js +0 -83
  250. package/esm/idx/interact.js.map +0 -1
  251. package/esm/idx/introspect.js +0 -45
  252. package/esm/idx/introspect.js.map +0 -1
  253. package/esm/idx/recoverPassword.js +0 -46
  254. package/esm/idx/recoverPassword.js.map +0 -1
  255. package/esm/idx/register.js +0 -63
  256. package/esm/idx/register.js.map +0 -1
  257. package/esm/idx/remediate.js +0 -303
  258. package/esm/idx/remediate.js.map +0 -1
  259. package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
  260. package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
  261. package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
  262. package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
  263. package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
  264. package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
  265. package/esm/idx/remediators/Base/Remediator.js +0 -216
  266. package/esm/idx/remediators/Base/Remediator.js.map +0 -1
  267. package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
  268. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
  269. package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -62
  270. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
  271. package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
  272. package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
  273. package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
  274. package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
  275. package/esm/idx/remediators/EnrollProfile.js +0 -62
  276. package/esm/idx/remediators/EnrollProfile.js.map +0 -1
  277. package/esm/idx/remediators/Identify.js +0 -85
  278. package/esm/idx/remediators/Identify.js.map +0 -1
  279. package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
  280. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
  281. package/esm/idx/remediators/RedirectIdp.js +0 -38
  282. package/esm/idx/remediators/RedirectIdp.js.map +0 -1
  283. package/esm/idx/remediators/ResetAuthenticator.js +0 -18
  284. package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
  285. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
  286. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
  287. package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
  288. package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
  289. package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
  290. package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
  291. package/esm/idx/remediators/Skip.js +0 -23
  292. package/esm/idx/remediators/Skip.js.map +0 -1
  293. package/esm/idx/remediators/index.js +0 -26
  294. package/esm/idx/remediators/index.js.map +0 -1
  295. package/esm/idx/remediators/util.js +0 -35
  296. package/esm/idx/remediators/util.js.map +0 -1
  297. package/esm/idx/run.js +0 -201
  298. package/esm/idx/run.js.map +0 -1
  299. package/esm/idx/startTransaction.js +0 -27
  300. package/esm/idx/startTransaction.js.map +0 -1
  301. package/esm/idx/transactionMeta.js +0 -112
  302. package/esm/idx/transactionMeta.js.map +0 -1
  303. package/esm/idx/types/idx-js.js +0 -17
  304. package/esm/idx/types/idx-js.js.map +0 -1
  305. package/esm/idx/types/index.js +0 -34
  306. package/esm/idx/types/index.js.map +0 -1
  307. package/esm/oidc/decodeToken.js +0 -31
  308. package/esm/oidc/decodeToken.js.map +0 -1
  309. package/esm/oidc/endpoints/authorize.js +0 -61
  310. package/esm/oidc/endpoints/authorize.js.map +0 -1
  311. package/esm/oidc/endpoints/index.js.map +0 -1
  312. package/esm/oidc/endpoints/token.js +0 -97
  313. package/esm/oidc/endpoints/token.js.map +0 -1
  314. package/esm/oidc/endpoints/well-known.js +0 -58
  315. package/esm/oidc/endpoints/well-known.js.map +0 -1
  316. package/esm/oidc/exchangeCodeForTokens.js +0 -69
  317. package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
  318. package/esm/oidc/getToken.js +0 -175
  319. package/esm/oidc/getToken.js.map +0 -1
  320. package/esm/oidc/getUserInfo.js +0 -82
  321. package/esm/oidc/getUserInfo.js.map +0 -1
  322. package/esm/oidc/getWithPopup.js +0 -28
  323. package/esm/oidc/getWithPopup.js.map +0 -1
  324. package/esm/oidc/getWithRedirect.js +0 -61
  325. package/esm/oidc/getWithRedirect.js.map +0 -1
  326. package/esm/oidc/getWithoutPrompt.js +0 -29
  327. package/esm/oidc/getWithoutPrompt.js.map +0 -1
  328. package/esm/oidc/handleOAuthResponse.js +0 -148
  329. package/esm/oidc/handleOAuthResponse.js.map +0 -1
  330. package/esm/oidc/index.js +0 -29
  331. package/esm/oidc/index.js.map +0 -1
  332. package/esm/oidc/parseFromUrl.js +0 -102
  333. package/esm/oidc/parseFromUrl.js.map +0 -1
  334. package/esm/oidc/renewToken.js +0 -85
  335. package/esm/oidc/renewToken.js.map +0 -1
  336. package/esm/oidc/renewTokens.js +0 -52
  337. package/esm/oidc/renewTokens.js.map +0 -1
  338. package/esm/oidc/renewTokensWithRefresh.js +0 -55
  339. package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
  340. package/esm/oidc/revokeToken.js +0 -57
  341. package/esm/oidc/revokeToken.js.map +0 -1
  342. package/esm/oidc/util/browser.js +0 -85
  343. package/esm/oidc/util/browser.js.map +0 -1
  344. package/esm/oidc/util/defaultTokenParams.js +0 -42
  345. package/esm/oidc/util/defaultTokenParams.js.map +0 -1
  346. package/esm/oidc/util/errors.js +0 -31
  347. package/esm/oidc/util/errors.js.map +0 -1
  348. package/esm/oidc/util/index.js +0 -25
  349. package/esm/oidc/util/index.js.map +0 -1
  350. package/esm/oidc/util/loginRedirect.js +0 -84
  351. package/esm/oidc/util/loginRedirect.js.map +0 -1
  352. package/esm/oidc/util/oauth.js +0 -70
  353. package/esm/oidc/util/oauth.js.map +0 -1
  354. package/esm/oidc/util/pkce.js +0 -55
  355. package/esm/oidc/util/pkce.js.map +0 -1
  356. package/esm/oidc/util/prepareTokenParams.js +0 -75
  357. package/esm/oidc/util/prepareTokenParams.js.map +0 -1
  358. package/esm/oidc/util/refreshToken.js +0 -24
  359. package/esm/oidc/util/refreshToken.js.map +0 -1
  360. package/esm/oidc/util/urlParams.js +0 -54
  361. package/esm/oidc/util/urlParams.js.map +0 -1
  362. package/esm/oidc/util/validateClaims.js +0 -53
  363. package/esm/oidc/util/validateClaims.js.map +0 -1
  364. package/esm/oidc/util/validateToken.js +0 -21
  365. package/esm/oidc/util/validateToken.js.map +0 -1
  366. package/esm/oidc/verifyToken.js +0 -78
  367. package/esm/oidc/verifyToken.js.map +0 -1
  368. package/esm/options.js +0 -131
  369. package/esm/options.js.map +0 -1
  370. package/esm/server/serverStorage.js +0 -110
  371. package/esm/server/serverStorage.js.map +0 -1
  372. package/esm/services/TokenService.js +0 -103
  373. package/esm/services/TokenService.js.map +0 -1
  374. package/esm/session.js +0 -81
  375. package/esm/session.js.map +0 -1
  376. package/esm/tx/AuthTransaction.js +0 -215
  377. package/esm/tx/AuthTransaction.js.map +0 -1
  378. package/esm/tx/TransactionState.js.map +0 -1
  379. package/esm/tx/api.js +0 -84
  380. package/esm/tx/api.js.map +0 -1
  381. package/esm/tx/index.js +0 -18
  382. package/esm/tx/index.js.map +0 -1
  383. package/esm/tx/poll.js +0 -124
  384. package/esm/tx/poll.js.map +0 -1
  385. package/esm/tx/util.js +0 -26
  386. package/esm/tx/util.js.map +0 -1
  387. package/esm/types/AuthState.js +0 -3
  388. package/esm/types/Cookies.js +0 -3
  389. package/esm/types/EventEmitter.js +0 -3
  390. package/esm/types/EventEmitter.js.map +0 -1
  391. package/esm/types/JWT.js +0 -3
  392. package/esm/types/JWT.js.map +0 -1
  393. package/esm/types/OAuth.js +0 -3
  394. package/esm/types/OAuth.js.map +0 -1
  395. package/esm/types/OktaAuthOptions.js +0 -3
  396. package/esm/types/OktaAuthOptions.js.map +0 -1
  397. package/esm/types/Storage.js +0 -3
  398. package/esm/types/Storage.js.map +0 -1
  399. package/esm/types/Token.js +0 -29
  400. package/esm/types/Token.js.map +0 -1
  401. package/esm/types/TokenManager.js +0 -3
  402. package/esm/types/TokenManager.js.map +0 -1
  403. package/esm/types/Transaction.js +0 -57
  404. package/esm/types/Transaction.js.map +0 -1
  405. package/esm/types/UserClaims.js +0 -3
  406. package/esm/types/UserClaims.js.map +0 -1
  407. package/esm/types/api.js +0 -3
  408. package/esm/types/api.js.map +0 -1
  409. package/esm/types/http.js +0 -3
  410. package/esm/types/http.js.map +0 -1
  411. package/esm/types/index.js +0 -27
  412. package/esm/types/index.js.map +0 -1
  413. package/esm/util/console.js +0 -53
  414. package/esm/util/console.js.map +0 -1
  415. package/esm/util/index.js +0 -17
  416. package/esm/util/index.js.map +0 -1
  417. package/esm/util/misc.js +0 -33
  418. package/esm/util/misc.js.map +0 -1
  419. package/esm/util/object.js +0 -117
  420. package/esm/util/object.js.map +0 -1
  421. package/esm/util/types.js +0 -27
  422. package/esm/util/types.js.map +0 -1
  423. package/esm/util/url.js +0 -64
  424. package/esm/util/url.js.map +0 -1
@@ -1,85 +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
- import { Remediator } from './Base/Remediator';
19
- export class Identify extends Remediator {
20
- constructor(remediation, values) {
21
- super(remediation, values); // add password authenticator to authenticators list if password is provided
22
-
23
- _defineProperty(this, "map", {
24
- 'identifier': ['username'],
25
- 'credentials': []
26
- });
27
-
28
- var {
29
- password,
30
- authenticators
31
- } = this.values;
32
-
33
- if (password && !authenticators.some(authenticator => authenticator.type === 'password')) {
34
- this.values = _objectSpread(_objectSpread({}, this.values), {}, {
35
- authenticators: [{
36
- type: 'password'
37
- }, ...authenticators]
38
- });
39
- }
40
- }
41
-
42
- canRemediate() {
43
- var {
44
- identifier
45
- } = this.getData();
46
- return !!identifier;
47
- }
48
-
49
- mapCredentials() {
50
- return {
51
- passcode: this.values.password
52
- };
53
- }
54
-
55
- getInputCredentials(input) {
56
- return _objectSpread(_objectSpread({}, input.form.value[0]), {}, {
57
- name: 'password',
58
- required: input.required
59
- });
60
- }
61
-
62
- getValuesAfterProceed() {
63
- // Handle username + password scenario
64
- // remove "password" from authenticator array when remediation is finished
65
- if (this.remediation.value.some(_ref => {
66
- var {
67
- name
68
- } = _ref;
69
- return name === 'credentials';
70
- })) {
71
- var _this$values$authenti;
72
-
73
- var authenticators = (_this$values$authenti = this.values.authenticators) === null || _this$values$authenti === void 0 ? void 0 : _this$values$authenti.filter(authenticator => authenticator.type !== 'password');
74
- return _objectSpread(_objectSpread({}, this.values), {}, {
75
- authenticators
76
- });
77
- }
78
-
79
- return super.getValuesAfterProceed();
80
- }
81
-
82
- }
83
-
84
- _defineProperty(Identify, "remediationName", 'identify');
85
- //# sourceMappingURL=Identify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Identify.ts"],"names":["Remediator","Identify","constructor","remediation","values","password","authenticators","some","authenticator","type","canRemediate","identifier","getData","mapCredentials","passcode","getInputCredentials","input","form","value","name","required","getValuesAfterProceed","filter"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,UAAT,QAA8C,mBAA9C;AASA,OAAO,MAAMC,QAAN,SAAuBD,UAAvB,CAAkC;AAUvCE,EAAAA,WAAW,CAACC,WAAD,EAA8BC,MAA9B,EAAuD;AAChE,UAAMD,WAAN,EAAmBC,MAAnB,EADgE,CAGhE;;AAHgE,iCAL5D;AACJ,oBAAc,CAAC,UAAD,CADV;AAEJ,qBAAe;AAFX,KAK4D;;AAIhE,QAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA+B,KAAKF,MAA1C;;AACA,QAAIC,QAAQ,IAAI,CAACC,cAAc,CAACC,IAAf,CAAoBC,aAAa,IAAIA,aAAa,CAACC,IAAd,KAAuB,UAA5D,CAAjB,EAA0F;AACxF,WAAKL,MAAL,mCACK,KAAKA,MADV;AAEEE,QAAAA,cAAc,EAAE,CAAC;AAAEG,UAAAA,IAAI,EAAE;AAAR,SAAD,EAAuB,GAAGH,cAA1B;AAFlB;AAID;AACF;;AAEDI,EAAAA,YAAY,GAAG;AACb,QAAM;AAAEC,MAAAA;AAAF,QAAiB,KAAKC,OAAL,EAAvB;AACA,WAAO,CAAC,CAACD,UAAT;AACD;;AAEDE,EAAAA,cAAc,GAAG;AACf,WAAO;AAAEC,MAAAA,QAAQ,EAAE,KAAKV,MAAL,CAAYC;AAAxB,KAAP;AACD;;AAEDU,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,2CACKA,KAAK,CAACC,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADL;AAEEC,MAAAA,IAAI,EAAE,UAFR;AAGEC,MAAAA,QAAQ,EAAEJ,KAAK,CAACI;AAHlB;AAKD;;AAEDC,EAAAA,qBAAqB,GAAG;AACtB;AACA;AACA,QAAI,KAAKlB,WAAL,CAAiBe,KAAjB,CAAuBX,IAAvB,CAA4B;AAAA,UAAC;AAAEY,QAAAA;AAAF,OAAD;AAAA,aAAcA,IAAI,KAAK,aAAvB;AAAA,KAA5B,CAAJ,EAAuE;AAAA;;AACrE,UAAMb,cAAc,4BAAI,KAAKF,MAAL,CAAYE,cAAhB,0DAAG,sBACnBgB,MADmB,CACZd,aAAa,IAAIA,aAAa,CAACC,IAAd,KAAuB,UAD5B,CAAvB;AAEA,6CAAY,KAAKL,MAAjB;AAAyBE,QAAAA;AAAzB;AACD;;AAED,WAAO,MAAMe,qBAAN,EAAP;AACD;;AAlDsC;;gBAA5BpB,Q,qBACc,U","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { Authenticator } from '../types';\nimport { IdxRemediation } from '../types/idx-js';\n\nexport interface IdentifyValues extends RemediationValues {\n username?: string;\n password?: string;\n}\n\nexport class Identify extends Remediator {\n static remediationName = 'identify';\n\n values: IdentifyValues;\n\n map = {\n 'identifier': ['username'],\n 'credentials': []\n };\n\n constructor(remediation: IdxRemediation, values?: IdentifyValues) {\n super(remediation, values);\n\n // add password authenticator to authenticators list if password is provided\n const { password, authenticators } = this.values;\n if (password && !authenticators.some(authenticator => authenticator.type === 'password')) {\n this.values = {\n ...this.values,\n authenticators: [{ type: 'password' }, ...authenticators] as Authenticator[]\n };\n }\n }\n\n canRemediate() {\n const { identifier } = this.getData();\n return !!identifier;\n }\n\n mapCredentials() {\n return { passcode: this.values.password };\n }\n\n getInputCredentials(input) {\n return {\n ...input.form.value[0],\n name: 'password',\n required: input.required\n };\n }\n\n getValuesAfterProceed() {\n // Handle username + password scenario\n // remove \"password\" from authenticator array when remediation is finished\n if (this.remediation.value.some(({ name }) => name === 'credentials')) {\n const authenticators = (this.values.authenticators as Authenticator[])\n ?.filter(authenticator => authenticator.type !== 'password');\n return { ...this.values, authenticators };\n }\n\n return super.getValuesAfterProceed();\n }\n}\n"],"file":"Identify.js"}
@@ -1,45 +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
- import { Remediator } from './Base/Remediator';
19
- export class ReEnrollAuthenticator extends Remediator {
20
- constructor() {
21
- super(...arguments);
22
-
23
- _defineProperty(this, "map", {
24
- 'credentials': []
25
- });
26
- }
27
-
28
- mapCredentials() {
29
- return {
30
- passcode: this.values.newPassword
31
- };
32
- }
33
-
34
- getInputCredentials(input) {
35
- var challengeType = this.getRelatesToType();
36
- var name = challengeType === 'password' ? 'newPassword' : 'verificationCode';
37
- return _objectSpread(_objectSpread({}, input.form.value[0]), {}, {
38
- name
39
- });
40
- }
41
-
42
- }
43
-
44
- _defineProperty(ReEnrollAuthenticator, "remediationName", 'reenroll-authenticator');
45
- //# sourceMappingURL=ReEnrollAuthenticator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ReEnrollAuthenticator.ts"],"names":["Remediator","ReEnrollAuthenticator","mapCredentials","passcode","values","newPassword","getInputCredentials","input","challengeType","getRelatesToType","name","form","value"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,UAAT,QAA8C,mBAA9C;AAMA,OAAO,MAAMC,qBAAN,SAAoCD,UAApC,CAA+C;AAAA;AAAA;;AAAA,iCAK9C;AACJ,qBAAe;AADX,KAL8C;AAAA;;AASpDE,EAAAA,cAAc,GAAG;AACf,WAAO;AACLC,MAAAA,QAAQ,EAAE,KAAKC,MAAL,CAAYC;AADjB,KAAP;AAGD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,QAAMC,aAAa,GAAG,KAAKC,gBAAL,EAAtB;AACA,QAAMC,IAAI,GAAGF,aAAa,KAAK,UAAlB,GAA+B,aAA/B,GAA+C,kBAA5D;AACA,2CACKD,KAAK,CAACI,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADL;AAEEF,MAAAA;AAFF;AAID;;AAtBmD;;gBAAzCT,qB,qBACc,wB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface ReEnrollAuthenticatorValues extends RemediationValues {\n newPassword?: string;\n}\n\nexport class ReEnrollAuthenticator extends Remediator {\n static remediationName = 'reenroll-authenticator';\n\n values: ReEnrollAuthenticatorValues;\n\n map = {\n 'credentials': []\n };\n\n mapCredentials() {\n return { \n passcode: this.values.newPassword,\n };\n }\n\n getInputCredentials(input) {\n const challengeType = this.getRelatesToType();\n const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';\n return {\n ...input.form.value[0],\n name\n };\n }\n\n}\n"],"file":"ReEnrollAuthenticator.js"}
@@ -1,38 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { Remediator } from './Base/Remediator';
15
- export class RedirectIdp extends Remediator {
16
- canRemediate() {
17
- return false;
18
- }
19
-
20
- getNextStep() {
21
- var {
22
- name,
23
- type,
24
- idp,
25
- href
26
- } = this.remediation;
27
- return {
28
- name,
29
- type,
30
- idp,
31
- href
32
- };
33
- }
34
-
35
- }
36
-
37
- _defineProperty(RedirectIdp, "remediationName", 'redirect-idp');
38
- //# sourceMappingURL=RedirectIdp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/RedirectIdp.ts"],"names":["Remediator","RedirectIdp","canRemediate","getNextStep","name","type","idp","href","remediation"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,UAAT,QAA2B,mBAA3B;AAEA,OAAO,MAAMC,WAAN,SAA0BD,UAA1B,CAAqC;AAG1CE,EAAAA,YAAY,GAAG;AACb,WAAO,KAAP;AACD;;AAEDC,EAAAA,WAAW,GAAG;AACZ,QAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,IAAR;AAAcC,MAAAA,GAAd;AAAmBC,MAAAA;AAAnB,QAA4B,KAAKC,WAAvC;AACA,WAAO;AACLJ,MAAAA,IADK;AAELC,MAAAA,IAFK;AAGLC,MAAAA,GAHK;AAILC,MAAAA;AAJK,KAAP;AAMD;;AAfyC;;gBAA/BN,W,qBACc,c","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator } from './Base/Remediator';\n\nexport class RedirectIdp extends Remediator {\n static remediationName = 'redirect-idp';\n\n canRemediate() {\n return false;\n }\n\n getNextStep() {\n const { name, type, idp, href } = this.remediation;\n return {\n name,\n type,\n idp,\n href\n };\n }\n\n}\n"],"file":"RedirectIdp.js"}
@@ -1,18 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { VerifyAuthenticator } from './Base/VerifyAuthenticator';
15
- export class ResetAuthenticator extends VerifyAuthenticator {}
16
-
17
- _defineProperty(ResetAuthenticator, "remediationName", 'reset-authenticator');
18
- //# sourceMappingURL=ResetAuthenticator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ResetAuthenticator.ts"],"names":["VerifyAuthenticator","ResetAuthenticator"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,mBAAT,QAA+D,4BAA/D;AAIA,OAAO,MAAMC,kBAAN,SAAiCD,mBAAjC,CAAqD;;gBAA/CC,kB,qBACc,qB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type ResetAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class ResetAuthenticator extends VerifyAuthenticator {\n static remediationName = 'reset-authenticator';\n values: ResetAuthenticatorValues;\n}\n"],"file":"ResetAuthenticator.js"}
@@ -1,18 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { SelectAuthenticator } from './/Base/SelectAuthenticator';
15
- export class SelectAuthenticatorAuthenticate extends SelectAuthenticator {}
16
-
17
- _defineProperty(SelectAuthenticatorAuthenticate, "remediationName", 'select-authenticator-authenticate');
18
- //# sourceMappingURL=SelectAuthenticatorAuthenticate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorAuthenticate.ts"],"names":["SelectAuthenticator","SelectAuthenticatorAuthenticate"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,mBAAT,QAA+D,6BAA/D;AAIA,OAAO,MAAMC,+BAAN,SAA8CD,mBAA9C,CAAkE;;gBAA5DC,+B,qBACc,mC","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 { SelectAuthenticator, SelectAuthenticatorValues } from './/Base/SelectAuthenticator';\n\nexport type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues;\n\nexport class SelectAuthenticatorAuthenticate extends SelectAuthenticator {\n static remediationName = 'select-authenticator-authenticate';\n values: SelectAuthenticatorAuthenticateValues;\n}\n"],"file":"SelectAuthenticatorAuthenticate.js"}
@@ -1,18 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { SelectAuthenticator } from './Base/SelectAuthenticator';
15
- export class SelectAuthenticatorEnroll extends SelectAuthenticator {}
16
-
17
- _defineProperty(SelectAuthenticatorEnroll, "remediationName", 'select-authenticator-enroll');
18
- //# sourceMappingURL=SelectAuthenticatorEnroll.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorEnroll.ts"],"names":["SelectAuthenticator","SelectAuthenticatorEnroll"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,mBAAT,QAA+D,4BAA/D;AAIA,OAAO,MAAMC,yBAAN,SAAwCD,mBAAxC,CAA4D;;gBAAtDC,yB,qBACc,6B","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 { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\n\nexport type SelectAuthenticatorEnrollValues = SelectAuthenticatorValues;\n\nexport class SelectAuthenticatorEnroll extends SelectAuthenticator {\n static remediationName = 'select-authenticator-enroll';\n values: SelectAuthenticatorEnrollValues;\n}\n"],"file":"SelectAuthenticatorEnroll.js"}
@@ -1,24 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { Remediator } from './Base/Remediator'; // eslint-disable-next-line @typescript-eslint/no-empty-interface
15
-
16
- export class SelectEnrollProfile extends Remediator {
17
- canRemediate() {
18
- return true;
19
- }
20
-
21
- }
22
-
23
- _defineProperty(SelectEnrollProfile, "remediationName", 'select-enroll-profile');
24
- //# sourceMappingURL=SelectEnrollProfile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectEnrollProfile.ts"],"names":["Remediator","SelectEnrollProfile","canRemediate"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,UAAT,QAA8C,mBAA9C,C,CAEA;;AAGA,OAAO,MAAMC,mBAAN,SAAkCD,UAAlC,CAA6C;AAKlDE,EAAAA,YAAY,GAAG;AACb,WAAO,IAAP;AACD;;AAPiD;;gBAAvCD,mB,qBACc,uB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SelectEnrollProfileValues extends RemediationValues {}\n\nexport class SelectEnrollProfile extends Remediator {\n static remediationName = 'select-enroll-profile';\n\n values: SelectEnrollProfileValues;\n\n canRemediate() {\n return true;\n }\n}\n"],"file":"SelectEnrollProfile.js"}
@@ -1,23 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 { Remediator } from './Base/Remediator';
15
- export class Skip extends Remediator {
16
- canRemediate() {
17
- return !!this.values.skip;
18
- }
19
-
20
- }
21
-
22
- _defineProperty(Skip, "remediationName", 'skip');
23
- //# sourceMappingURL=Skip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Skip.ts"],"names":["Remediator","Skip","canRemediate","values","skip"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,UAAT,QAA8C,mBAA9C;AAMA,OAAO,MAAMC,IAAN,SAAmBD,UAAnB,CAA8B;AAKnCE,EAAAA,YAAY,GAAG;AACb,WAAO,CAAC,CAAC,KAAKC,MAAL,CAAYC,IAArB;AACD;;AAPkC;;gBAAxBH,I,qBACc,M","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface SkipValues extends RemediationValues {\n skip?: boolean;\n}\n\nexport class Skip extends Remediator {\n static remediationName = 'skip';\n\n values: SkipValues;\n\n canRemediate() {\n return !!this.values.skip;\n }\n\n}\n"],"file":"Skip.js"}
@@ -1,26 +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 './Base/Remediator';
13
- export * from './EnrollAuthenticator';
14
- export * from './ChallengeAuthenticator';
15
- export * from './ResetAuthenticator';
16
- export * from './EnrollProfile';
17
- export * from './Identify';
18
- export * from './ReEnrollAuthenticator';
19
- export * from './RedirectIdp';
20
- export * from './SelectAuthenticatorAuthenticate';
21
- export * from './SelectAuthenticatorEnroll';
22
- export * from './SelectEnrollProfile';
23
- export * from './AuthenticatorVerificationData';
24
- export * from './AuthenticatorEnrollmentData';
25
- export * from './Skip';
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,mBAAd;AACA,cAAc,uBAAd;AACA,cAAc,0BAAd;AACA,cAAc,sBAAd;AACA,cAAc,iBAAd;AACA,cAAc,YAAd;AACA,cAAc,yBAAd;AACA,cAAc,eAAd;AACA,cAAc,mCAAd;AACA,cAAc,6BAAd;AACA,cAAc,uBAAd;AACA,cAAc,iCAAd;AACA,cAAc,+BAAd;AACA,cAAc,QAAd","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 './Base/Remediator';\nexport * from './EnrollAuthenticator';\nexport * from './ChallengeAuthenticator';\nexport * from './ResetAuthenticator';\nexport * from './EnrollProfile';\nexport * from './Identify';\nexport * from './ReEnrollAuthenticator';\nexport * from './RedirectIdp';\nexport * from './SelectAuthenticatorAuthenticate';\nexport * from './SelectAuthenticatorEnroll';\nexport * from './SelectEnrollProfile';\nexport * from './AuthenticatorVerificationData';\nexport * from './AuthenticatorEnrollmentData';\nexport * from './Skip';\n"],"file":"index.js"}
@@ -1,35 +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 function getAllValues(idxRemediation) {
13
- return idxRemediation.value.map(r => r.name);
14
- }
15
- export function getRequiredValues(idxRemediation) {
16
- return idxRemediation.value.reduce((required, cur) => {
17
- if (cur.required) {
18
- required.push(cur.name);
19
- }
20
-
21
- return required;
22
- }, []);
23
- }
24
- export function titleCase(str) {
25
- return str.charAt(0).toUpperCase() + str.substring(1);
26
- }
27
- export function getAuthenticatorFromRemediation(remediation) {
28
- return remediation.value.find(_ref => {
29
- var {
30
- name
31
- } = _ref;
32
- return name === 'authenticator';
33
- });
34
- }
35
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/util.ts"],"names":["getAllValues","idxRemediation","value","map","r","name","getRequiredValues","reduce","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation","find"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,OAAO,SAASA,YAAT,CAAsBC,cAAtB,EAAsD;AAC3D,SAAOA,cAAc,CAACC,KAAf,CAAqBC,GAArB,CAAyBC,CAAC,IAAIA,CAAC,CAACC,IAAhC,CAAP;AACD;AAED,OAAO,SAASC,iBAAT,CAA2BL,cAA3B,EAA2D;AAChE,SAAOA,cAAc,CAACC,KAAf,CAAqBK,MAArB,CAA4B,CAACC,QAAD,EAAWC,GAAX,KAAmB;AACpD,QAAIA,GAAG,CAACD,QAAR,EAAkB;AAChBA,MAAAA,QAAQ,CAACE,IAAT,CAAcD,GAAG,CAACJ,IAAlB;AACD;;AACD,WAAOG,QAAP;AACD,GALM,EAKJ,EALI,CAAP;AAMD;AAED,OAAO,SAASG,SAAT,CAAmBC,GAAnB,EAAgC;AACrC,SAAOA,GAAG,CAACC,MAAJ,CAAW,CAAX,EAAcC,WAAd,KAA8BF,GAAG,CAACG,SAAJ,CAAc,CAAd,CAArC;AACD;AAED,OAAO,SAASC,+BAAT,CACLC,WADK,EAEgB;AACrB,SAAOA,WAAW,CAACf,KAAZ,CAAkBgB,IAAlB,CAAuB;AAAA,QAAC;AAAEb,MAAAA;AAAF,KAAD;AAAA,WAAcA,IAAI,KAAK,eAAvB;AAAA,GAAvB,CAAP;AACD","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 { IdxRemediation, IdxRemediationValue } from '../types/idx-js';\n\nexport function getAllValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value.map(r => r.name);\n}\n\nexport function getRequiredValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name);\n }\n return required;\n }, []);\n}\n\nexport function titleCase(str: string) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function getAuthenticatorFromRemediation(\n remediation: IdxRemediation\n): IdxRemediationValue {\n return remediation.value.find(({ name }) => name === 'authenticator');\n}\n"],"file":"util.js"}
package/esm/idx/run.js DELETED
@@ -1,201 +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
-
20
- /* eslint-disable max-statements, complexity, max-depth */
21
- import { interact } from './interact';
22
- import { introspect } from './introspect';
23
- import { remediate } from './remediate';
24
- import * as remediators from './remediators';
25
- import { AuthSdkError } from '../errors';
26
- import { IdxStatus, IdxFeature } from '../types';
27
-
28
- function getEnabledFeatures(idxResponse) {
29
- var res = [];
30
- var {
31
- actions,
32
- neededToProceed
33
- } = idxResponse;
34
-
35
- if (actions['currentAuthenticator-recover']) {
36
- res.push(IdxFeature.PASSWORD_RECOVERY);
37
- }
38
-
39
- if (neededToProceed.some(_ref => {
40
- var {
41
- name
42
- } = _ref;
43
- return name === 'select-enroll-profile';
44
- })) {
45
- res.push(IdxFeature.REGISTRATION);
46
- }
47
-
48
- if (neededToProceed.some(_ref2 => {
49
- var {
50
- name
51
- } = _ref2;
52
- return name === 'redirect-idp';
53
- })) {
54
- res.push(IdxFeature.SOCIAL_IDP);
55
- }
56
-
57
- return res;
58
- }
59
-
60
- function getAvailableSteps(remediations) {
61
- var res = [];
62
- var remediatorMap = Object.values(remediators).reduce((map, remediatorClass) => {
63
- // Only add concrete subclasses to the map
64
- if (remediatorClass.remediationName) {
65
- map[remediatorClass.remediationName] = remediatorClass;
66
- }
67
-
68
- return map;
69
- }, {});
70
-
71
- for (var remediation of remediations) {
72
- var T = remediatorMap[remediation.name];
73
-
74
- if (T) {
75
- var remediator = new T(remediation);
76
- res.push(remediator.getNextStep());
77
- }
78
- }
79
-
80
- return res;
81
- }
82
-
83
- export function run(_x, _x2) {
84
- return _run.apply(this, arguments);
85
- }
86
-
87
- function _run() {
88
- _run = _asyncToGenerator(function* (authClient, options) {
89
- var tokens;
90
- var nextStep;
91
- var messages;
92
- var error;
93
- var meta;
94
- var enabledFeatures;
95
- var availableSteps;
96
- var status = IdxStatus.PENDING;
97
- var shouldClearTransaction = false;
98
-
99
- try {
100
- // Start/resume the flow
101
- var {
102
- interactionHandle,
103
- meta: metaFromResp
104
- } = yield interact(authClient, options); // Introspect to get idx response
105
-
106
- var idxResponse = yield introspect(authClient, {
107
- interactionHandle
108
- });
109
-
110
- if (!options.flow && !options.actions) {
111
- // handle start transaction
112
- meta = metaFromResp;
113
- enabledFeatures = getEnabledFeatures(idxResponse);
114
- availableSteps = getAvailableSteps(idxResponse.neededToProceed);
115
- } else {
116
- var values = _objectSpread(_objectSpread({}, options), {}, {
117
- stateHandle: idxResponse.rawIdxState.stateHandle
118
- }); // Can we handle the remediations?
119
-
120
-
121
- var {
122
- idxResponse: idxResponseFromResp,
123
- nextStep: nextStepFromResp,
124
- terminal,
125
- canceled,
126
- messages: messagesFromResp
127
- } = yield remediate(idxResponse, values, options); // Track fields from remediation response
128
-
129
- nextStep = nextStepFromResp;
130
- messages = messagesFromResp; // Save intermediate idx response in storage to reduce introspect call
131
-
132
- if (nextStep && idxResponseFromResp) {
133
- authClient.transactionManager.saveIdxResponse(idxResponseFromResp.rawIdxState);
134
- }
135
-
136
- if (terminal) {
137
- status = IdxStatus.TERMINAL;
138
- shouldClearTransaction = true;
139
- }
140
-
141
- if (canceled) {
142
- status = IdxStatus.CANCELED;
143
- shouldClearTransaction = true;
144
- } else if (idxResponseFromResp !== null && idxResponseFromResp !== void 0 && idxResponseFromResp.interactionCode) {
145
- // Flows may end with interactionCode before the key remediation being hit
146
- // Double check if flow is finished to mitigate confusion with the wrapper methods
147
- if (!(yield options.flowMonitor.isFinished())) {
148
- throw new AuthSdkError('Current flow is not supported, check policy settings in your org.');
149
- }
150
-
151
- var {
152
- clientId,
153
- codeVerifier,
154
- ignoreSignature,
155
- redirectUri,
156
- urls,
157
- scopes
158
- } = metaFromResp;
159
- tokens = yield authClient.token.exchangeCodeForTokens({
160
- interactionCode: idxResponseFromResp.interactionCode,
161
- clientId,
162
- codeVerifier,
163
- ignoreSignature,
164
- redirectUri,
165
- scopes
166
- }, urls);
167
- status = IdxStatus.SUCCESS;
168
- shouldClearTransaction = true;
169
- }
170
- }
171
- } catch (err) {
172
- error = err;
173
- status = IdxStatus.FAILURE;
174
- shouldClearTransaction = true;
175
- }
176
-
177
- if (shouldClearTransaction) {
178
- authClient.transactionManager.clear();
179
- }
180
-
181
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
182
- status
183
- }, meta && {
184
- meta
185
- }), enabledFeatures && {
186
- enabledFeatures
187
- }), availableSteps && {
188
- availableSteps
189
- }), tokens && {
190
- tokens: tokens.tokens
191
- }), nextStep && {
192
- nextStep
193
- }), messages && {
194
- messages
195
- }), error && {
196
- error
197
- });
198
- });
199
- return _run.apply(this, arguments);
200
- }
201
- //# sourceMappingURL=run.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/idx/run.ts"],"names":["interact","introspect","remediate","remediators","AuthSdkError","IdxStatus","IdxFeature","getEnabledFeatures","idxResponse","res","actions","neededToProceed","push","PASSWORD_RECOVERY","some","name","REGISTRATION","SOCIAL_IDP","getAvailableSteps","remediations","remediatorMap","Object","values","reduce","map","remediatorClass","remediationName","remediation","T","remediator","getNextStep","run","authClient","options","tokens","nextStep","messages","error","meta","enabledFeatures","availableSteps","status","PENDING","shouldClearTransaction","interactionHandle","metaFromResp","flow","stateHandle","rawIdxState","idxResponseFromResp","nextStepFromResp","terminal","canceled","messagesFromResp","transactionManager","saveIdxResponse","TERMINAL","CANCELED","interactionCode","flowMonitor","isFinished","clientId","codeVerifier","ignoreSignature","redirectUri","urls","scopes","token","exchangeCodeForTokens","SUCCESS","err","FAILURE","clear"],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\n/* eslint-disable max-statements, complexity, max-depth */\nimport { interact } from './interact';\nimport { introspect } from './introspect';\nimport { remediate } from './remediate';\nimport { FlowMonitor } from './flowMonitors';\nimport * as remediators from './remediators';\nimport { AuthSdkError } from '../errors';\nimport { \n OktaAuth,\n IdxOptions,\n IdxStatus,\n IdxTransaction,\n IdxFeature,\n NextStep,\n} from '../types';\nimport { IdxResponse, IdxRemediation } from './types/idx-js';\n\nexport type RemediationFlow = Record<string, typeof remediators.Remediator>;\nexport interface RunOptions {\n flow?: RemediationFlow;\n actions?: string[];\n flowMonitor?: FlowMonitor;\n}\n\nfunction getEnabledFeatures(idxResponse: IdxResponse): IdxFeature[] {\n const res = [];\n const { actions, neededToProceed } = idxResponse;\n\n if (actions['currentAuthenticator-recover']) {\n res.push(IdxFeature.PASSWORD_RECOVERY);\n }\n\n if (neededToProceed.some(({ name }) => name === 'select-enroll-profile')) {\n res.push(IdxFeature.REGISTRATION);\n }\n\n if (neededToProceed.some(({ name }) => name === 'redirect-idp')) {\n res.push(IdxFeature.SOCIAL_IDP);\n }\n\n return res;\n}\n\nfunction getAvailableSteps(remediations: IdxRemediation[]): NextStep[] {\n const res = [];\n\n const remediatorMap = Object.values(remediators).reduce((map, remediatorClass) => {\n // Only add concrete subclasses to the map\n if (remediatorClass.remediationName) {\n map[remediatorClass.remediationName] = remediatorClass;\n }\n return map;\n }, {});\n\n for (let remediation of remediations) {\n const T = remediatorMap[remediation.name];\n if (T) {\n const remediator = new T(remediation);\n res.push (remediator.getNextStep());\n }\n }\n\n return res;\n}\n\nexport async function run(\n authClient: OktaAuth, \n options: RunOptions & IdxOptions,\n): Promise<IdxTransaction> {\n let tokens;\n let nextStep;\n let messages;\n let error;\n let meta;\n let enabledFeatures;\n let availableSteps;\n let status = IdxStatus.PENDING;\n let shouldClearTransaction = false;\n\n try {\n // Start/resume the flow\n const { interactionHandle, meta: metaFromResp } = await interact(authClient, options); \n\n // Introspect to get idx response\n const idxResponse = await introspect(authClient, { interactionHandle });\n\n if (!options.flow && !options.actions) {\n // handle start transaction\n meta = metaFromResp;\n enabledFeatures = getEnabledFeatures(idxResponse);\n availableSteps = getAvailableSteps(idxResponse.neededToProceed);\n } else {\n const values: remediators.RemediationValues = { \n ...options, \n stateHandle: idxResponse.rawIdxState.stateHandle \n };\n\n // Can we handle the remediations?\n const { \n idxResponse: idxResponseFromResp, \n nextStep: nextStepFromResp,\n terminal,\n canceled,\n messages: messagesFromResp,\n } = await remediate(idxResponse, values, options);\n\n // Track fields from remediation response\n nextStep = nextStepFromResp;\n messages = messagesFromResp;\n\n // Save intermediate idx response in storage to reduce introspect call\n if (nextStep && idxResponseFromResp) {\n authClient.transactionManager.saveIdxResponse(idxResponseFromResp.rawIdxState);\n }\n\n if (terminal) {\n status = IdxStatus.TERMINAL;\n shouldClearTransaction = true;\n } if (canceled) {\n status = IdxStatus.CANCELED;\n shouldClearTransaction = true;\n } else if (idxResponseFromResp?.interactionCode) { \n // Flows may end with interactionCode before the key remediation being hit\n // Double check if flow is finished to mitigate confusion with the wrapper methods\n if (!(await options.flowMonitor.isFinished())) {\n throw new AuthSdkError('Current flow is not supported, check policy settings in your org.');\n }\n\n const {\n clientId,\n codeVerifier,\n ignoreSignature,\n redirectUri,\n urls,\n scopes,\n } = metaFromResp;\n tokens = await authClient.token.exchangeCodeForTokens({\n interactionCode: idxResponseFromResp.interactionCode,\n clientId,\n codeVerifier,\n ignoreSignature,\n redirectUri,\n scopes\n }, urls);\n\n status = IdxStatus.SUCCESS;\n shouldClearTransaction = true;\n }\n }\n } catch (err) {\n error = err;\n status = IdxStatus.FAILURE;\n shouldClearTransaction = true;\n }\n\n if (shouldClearTransaction) {\n authClient.transactionManager.clear();\n }\n \n return {\n status,\n ...(meta && { meta }),\n ...(enabledFeatures && { enabledFeatures }),\n ...(availableSteps && { availableSteps }),\n ...(tokens && { tokens: tokens.tokens }),\n ...(nextStep && { nextStep }),\n ...(messages && { messages }),\n ...(error && { error }),\n };\n}\n"],"file":"run.js"}