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