@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
package/esm/tx/poll.js DELETED
@@ -1,124 +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
- */
13
- import { post } from '../http';
14
- import { isNumber, isObject, getLink, toQueryString, delay as delayFn } from '../util';
15
- import { DEFAULT_POLLING_DELAY } from '../constants';
16
- import AuthSdkError from '../errors/AuthSdkError';
17
- import AuthPollStopError from '../errors/AuthPollStopError';
18
- import { TransactionState } from './TransactionState';
19
- import { AuthTransaction } from './AuthTransaction';
20
- import { getStateToken } from './util';
21
- export function getPollFn(sdk, res, ref) {
22
- return function (options) {
23
- var delay;
24
- var rememberDevice;
25
- var autoPush;
26
- var transactionCallBack;
27
-
28
- if (isNumber(options)) {
29
- delay = options;
30
- } else if (isObject(options)) {
31
- options = options;
32
- delay = options.delay;
33
- rememberDevice = options.rememberDevice;
34
- autoPush = options.autoPush;
35
- transactionCallBack = options.transactionCallBack;
36
- }
37
-
38
- if (!delay && delay !== 0) {
39
- delay = DEFAULT_POLLING_DELAY;
40
- } // Get the poll function
41
-
42
-
43
- var pollLink = getLink(res, 'next', 'poll'); // eslint-disable-next-line complexity
44
-
45
- function pollFn() {
46
- var opts = {};
47
-
48
- if (typeof autoPush === 'function') {
49
- try {
50
- opts.autoPush = !!autoPush();
51
- } catch (e) {
52
- return Promise.reject(new AuthSdkError('AutoPush resulted in an error.'));
53
- }
54
- } else if (autoPush !== undefined && autoPush !== null) {
55
- opts.autoPush = !!autoPush;
56
- }
57
-
58
- if (typeof rememberDevice === 'function') {
59
- try {
60
- opts.rememberDevice = !!rememberDevice();
61
- } catch (e) {
62
- return Promise.reject(new AuthSdkError('RememberDevice resulted in an error.'));
63
- }
64
- } else if (rememberDevice !== undefined && rememberDevice !== null) {
65
- opts.rememberDevice = !!rememberDevice;
66
- }
67
-
68
- var href = pollLink.href + toQueryString(opts);
69
- return post(sdk, href, getStateToken(res), {
70
- saveAuthnState: false,
71
- withCredentials: true
72
- });
73
- }
74
-
75
- ref.isPolling = true;
76
- var retryCount = 0;
77
-
78
- var recursivePoll = function recursivePoll() {
79
- // If the poll was manually stopped during the delay
80
- if (!ref.isPolling) {
81
- return Promise.reject(new AuthPollStopError());
82
- }
83
-
84
- return pollFn().then(function (pollRes) {
85
- // Reset our retry counter on success
86
- retryCount = 0; // If we're still waiting
87
-
88
- if (pollRes.factorResult && pollRes.factorResult === 'WAITING') {
89
- // If the poll was manually stopped while the pollFn was called
90
- if (!ref.isPolling) {
91
- throw new AuthPollStopError();
92
- }
93
-
94
- if (typeof transactionCallBack === 'function') {
95
- transactionCallBack(pollRes);
96
- } // Continue poll
97
-
98
-
99
- return delayFn(delay).then(recursivePoll);
100
- } else {
101
- // Any non-waiting result, even if polling was stopped
102
- // during a request, will return
103
- ref.isPolling = false;
104
- return new AuthTransaction(sdk, pollRes);
105
- }
106
- }).catch(function (err) {
107
- // Exponential backoff, up to 16 seconds
108
- if (err.xhr && (err.xhr.status === 0 || err.xhr.status === 429) && retryCount <= 4) {
109
- var delayLength = Math.pow(2, retryCount) * 1000;
110
- retryCount++;
111
- return delayFn(delayLength).then(recursivePoll);
112
- }
113
-
114
- throw err;
115
- });
116
- };
117
-
118
- return recursivePoll().catch(function (err) {
119
- ref.isPolling = false;
120
- throw err;
121
- });
122
- };
123
- }
124
- //# sourceMappingURL=poll.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/tx/poll.ts"],"names":["post","isNumber","isObject","getLink","toQueryString","delay","delayFn","DEFAULT_POLLING_DELAY","AuthSdkError","AuthPollStopError","TransactionState","AuthTransaction","getStateToken","getPollFn","sdk","res","ref","options","rememberDevice","autoPush","transactionCallBack","pollLink","pollFn","opts","e","Promise","reject","undefined","href","saveAuthnState","withCredentials","isPolling","retryCount","recursivePoll","then","pollRes","factorResult","catch","err","xhr","status","delayLength","Math","pow"],"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\nimport { post } from '../http';\nimport { isNumber, isObject, getLink, toQueryString, delay as delayFn } from '../util';\nimport { DEFAULT_POLLING_DELAY } from '../constants';\nimport AuthSdkError from '../errors/AuthSdkError';\nimport AuthPollStopError from '../errors/AuthPollStopError';\nimport { TransactionState } from './TransactionState';\nimport { AuthTransaction } from './AuthTransaction';\nimport { getStateToken } from './util';\n\nexport interface PollOptions {\n delay?: number;\n rememberDevice?: boolean;\n autoPush?: boolean;\n transactionCallBack?: (TransactionState) => void;\n}\n\nexport function getPollFn(sdk, res: TransactionState, ref) {\n return function (options: PollOptions | number) {\n var delay;\n var rememberDevice;\n var autoPush;\n var transactionCallBack;\n\n if (isNumber(options)) {\n delay = options;\n } else if (isObject(options)) {\n options = options as PollOptions;\n delay = options.delay;\n rememberDevice = options.rememberDevice;\n autoPush = options.autoPush;\n transactionCallBack = options.transactionCallBack;\n }\n\n if (!delay && delay !== 0) {\n delay = DEFAULT_POLLING_DELAY;\n }\n\n // Get the poll function\n var pollLink = getLink(res, 'next', 'poll');\n // eslint-disable-next-line complexity\n function pollFn() {\n var opts = {} as PollOptions;\n if (typeof autoPush === 'function') {\n try {\n opts.autoPush = !!autoPush();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('AutoPush resulted in an error.'));\n }\n }\n else if (autoPush !== undefined && autoPush !== null) {\n opts.autoPush = !!autoPush;\n }\n if (typeof rememberDevice === 'function') {\n try {\n opts.rememberDevice = !!rememberDevice();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('RememberDevice resulted in an error.'));\n }\n }\n else if (rememberDevice !== undefined && rememberDevice !== null) {\n opts.rememberDevice = !!rememberDevice;\n }\n\n var href = pollLink.href + toQueryString(opts);\n return post(sdk, href, getStateToken(res), {\n saveAuthnState: false,\n withCredentials: true\n });\n }\n\n ref.isPolling = true;\n\n var retryCount = 0;\n var recursivePoll = function () {\n // If the poll was manually stopped during the delay\n if (!ref.isPolling) {\n return Promise.reject(new AuthPollStopError());\n }\n return pollFn()\n .then(function (pollRes) {\n // Reset our retry counter on success\n retryCount = 0;\n\n // If we're still waiting\n if (pollRes.factorResult && pollRes.factorResult === 'WAITING') {\n\n // If the poll was manually stopped while the pollFn was called\n if (!ref.isPolling) {\n throw new AuthPollStopError();\n }\n\n if (typeof transactionCallBack === 'function') {\n transactionCallBack(pollRes);\n }\n\n // Continue poll\n return delayFn(delay).then(recursivePoll);\n\n } else {\n // Any non-waiting result, even if polling was stopped\n // during a request, will return\n ref.isPolling = false;\n return new AuthTransaction(sdk, pollRes);\n }\n })\n .catch(function(err) {\n // Exponential backoff, up to 16 seconds\n if (err.xhr &&\n (err.xhr.status === 0 || err.xhr.status === 429) &&\n retryCount <= 4) {\n var delayLength = Math.pow(2, retryCount) * 1000;\n retryCount++;\n return delayFn(delayLength)\n .then(recursivePoll);\n }\n throw err;\n });\n };\n return recursivePoll()\n .catch(function(err) {\n ref.isPolling = false;\n throw err;\n });\n };\n}\n"],"file":"poll.js"}
package/esm/tx/util.js DELETED
@@ -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
- */
13
- export function addStateToken(res, options) {
14
- var builtArgs = {};
15
- Object.assign(builtArgs, options); // Add the stateToken if one isn't passed and we have one
16
-
17
- if (!builtArgs.stateToken && res.stateToken) {
18
- builtArgs.stateToken = res.stateToken;
19
- }
20
-
21
- return builtArgs;
22
- }
23
- export function getStateToken(res) {
24
- return addStateToken(res);
25
- }
26
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/tx/util.ts"],"names":["addStateToken","res","options","builtArgs","Object","assign","stateToken","getStateToken"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,OAAO,SAASA,aAAT,CAAuBC,GAAvB,EAA4BC,OAA5B,EAAsC;AAC3C,MAAIC,SAAS,GAAG,EAAhB;AACAC,EAAAA,MAAM,CAACC,MAAP,CAAcF,SAAd,EAAyBD,OAAzB,EAF2C,CAI3C;;AACA,MAAI,CAACC,SAAS,CAACG,UAAX,IAAyBL,GAAG,CAACK,UAAjC,EAA6C;AAC3CH,IAAAA,SAAS,CAACG,UAAV,GAAuBL,GAAG,CAACK,UAA3B;AACD;;AAED,SAAOH,SAAP;AACD;AAED,OAAO,SAASI,aAAT,CAAuBN,GAAvB,EAA4B;AACjC,SAAOD,aAAa,CAACC,GAAD,CAApB;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\n\nimport { TransactionState } from './TransactionState';\n\nexport function addStateToken(res, options?) {\n var builtArgs = {} as TransactionState;\n Object.assign(builtArgs, options);\n\n // Add the stateToken if one isn't passed and we have one\n if (!builtArgs.stateToken && res.stateToken) {\n builtArgs.stateToken = res.stateToken;\n }\n\n return builtArgs;\n}\n\nexport function getStateToken(res) {\n return addStateToken(res);\n}\n"],"file":"util.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=AuthState.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=Cookies.js.map
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=EventEmitter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"EventEmitter.js"}
package/esm/types/JWT.js DELETED
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=JWT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"JWT.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=OAuth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"OAuth.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=OktaAuthOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"OktaAuthOptions.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=Storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"Storage.js"}
@@ -1,29 +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
- // eslint-disable-next-line @typescript-eslint/interface-name-prefix
13
- export function isToken(obj) {
14
- if (obj && (obj.accessToken || obj.idToken || obj.refreshToken) && Array.isArray(obj.scopes)) {
15
- return true;
16
- }
17
-
18
- return false;
19
- }
20
- export function isAccessToken(obj) {
21
- return obj && obj.accessToken;
22
- }
23
- export function isIDToken(obj) {
24
- return obj && obj.idToken;
25
- }
26
- export function isRefreshToken(obj) {
27
- return obj && obj.refreshToken;
28
- }
29
- //# sourceMappingURL=Token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/types/Token.ts"],"names":["isToken","obj","accessToken","idToken","refreshToken","Array","isArray","scopes","isAccessToken","isIDToken","isRefreshToken"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAuBA;AAaA,OAAO,SAASA,OAAT,CAAiBC,GAAjB,EAAyC;AAC9C,MAAIA,GAAG,KACFA,GAAG,CAACC,WAAJ,IAAmBD,GAAG,CAACE,OAAvB,IAAkCF,GAAG,CAACG,YADpC,CAAH,IAEAC,KAAK,CAACC,OAAN,CAAcL,GAAG,CAACM,MAAlB,CAFJ,EAE+B;AAC7B,WAAO,IAAP;AACD;;AACD,SAAO,KAAP;AACD;AAED,OAAO,SAASC,aAAT,CAAuBP,GAAvB,EAAqD;AAC1D,SAAOA,GAAG,IAAIA,GAAG,CAACC,WAAlB;AACD;AAED,OAAO,SAASO,SAAT,CAAmBR,GAAnB,EAA6C;AAClD,SAAOA,GAAG,IAAIA,GAAG,CAACE,OAAlB;AACD;AAED,OAAO,SAASO,cAAT,CAAwBT,GAAxB,EAAuD;AAC5D,SAAOA,GAAG,IAAIA,GAAG,CAACG,YAAlB;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\nimport { UserClaims } from './UserClaims';\n\nexport interface AbstractToken {\n expiresAt: number;\n authorizeUrl: string;\n scopes: string[];\n}\n\nexport interface AccessToken extends AbstractToken {\n accessToken: string;\n claims: UserClaims;\n tokenType: string;\n userinfoUrl: string;\n}\n\nexport interface RefreshToken extends AbstractToken {\n refreshToken: string;\n tokenUrl: string;\n issuer: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/interface-name-prefix\nexport interface IDToken extends AbstractToken {\n idToken: string;\n claims: UserClaims;\n issuer: string;\n clientId: string;\n}\n\nexport type Token = AccessToken | IDToken | RefreshToken;\nexport type RevocableToken = AccessToken | RefreshToken;\n\nexport type TokenType = 'accessToken' | 'idToken' | 'refreshToken';\n\nexport function isToken(obj: any): obj is Token {\n if (obj &&\n (obj.accessToken || obj.idToken || obj.refreshToken) &&\n Array.isArray(obj.scopes)) {\n return true;\n }\n return false;\n}\n\nexport function isAccessToken(obj: any): obj is AccessToken {\n return obj && obj.accessToken;\n}\n\nexport function isIDToken(obj: any): obj is IDToken {\n return obj && obj.idToken;\n}\n\nexport function isRefreshToken(obj: any): obj is RefreshToken {\n return obj && obj.refreshToken;\n}\n\nexport interface Tokens {\n accessToken?: AccessToken;\n idToken?: IDToken;\n refreshToken?: RefreshToken;\n}\n"],"file":"Token.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=TokenManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"TokenManager.js"}
@@ -1,57 +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
- // formerly known as "Redirect OAuth Params"
13
- function isObjectWithProperties(obj) {
14
- if (!obj || typeof obj !== 'object' || Object.values(obj).length === 0) {
15
- return false;
16
- }
17
-
18
- return true;
19
- }
20
-
21
- export function isOAuthTransactionMeta(obj) {
22
- if (!isObjectWithProperties(obj)) {
23
- return false;
24
- }
25
-
26
- return !!obj.redirectUri || !!obj.responseType;
27
- }
28
- export function isPKCETransactionMeta(obj) {
29
- if (!isOAuthTransactionMeta(obj)) {
30
- return false;
31
- }
32
-
33
- return !!obj.codeVerifier;
34
- }
35
- export function isIdxTransactionMeta(obj) {
36
- if (!isPKCETransactionMeta(obj)) {
37
- return false;
38
- }
39
-
40
- return !!obj.interactionHandle;
41
- }
42
- export function isCustomAuthTransactionMeta(obj) {
43
- if (!isObjectWithProperties(obj)) {
44
- return false;
45
- }
46
-
47
- var isAllStringValues = Object.values(obj).find(value => typeof value !== 'string') === undefined;
48
- return isAllStringValues;
49
- }
50
- export function isTransactionMeta(obj) {
51
- if (isOAuthTransactionMeta(obj) || isCustomAuthTransactionMeta(obj)) {
52
- return true;
53
- }
54
-
55
- return false;
56
- }
57
- //# sourceMappingURL=Transaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/types/Transaction.ts"],"names":["isObjectWithProperties","obj","Object","values","length","isOAuthTransactionMeta","redirectUri","responseType","isPKCETransactionMeta","codeVerifier","isIdxTransactionMeta","interactionHandle","isCustomAuthTransactionMeta","isAllStringValues","find","value","undefined","isTransactionMeta"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;AAiCA,SAASA,sBAAT,CAAgCC,GAAhC,EAAqC;AACnC,MAAI,CAACA,GAAD,IAAQ,OAAOA,GAAP,KAAe,QAAvB,IAAmCC,MAAM,CAACC,MAAP,CAAcF,GAAd,EAAmBG,MAAnB,KAA8B,CAArE,EAAwE;AACtE,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD;;AAED,OAAO,SAASC,sBAAT,CAAgCJ,GAAhC,EAAuE;AAC5E,MAAI,CAACD,sBAAsB,CAACC,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAACA,GAAG,CAACK,WAAN,IAAqB,CAAC,CAACL,GAAG,CAACM,YAAlC;AACD;AAED,OAAO,SAASC,qBAAT,CAA+BP,GAA/B,EAAqE;AAC1E,MAAI,CAACI,sBAAsB,CAACJ,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAAEA,GAAD,CAAaQ,YAAtB;AACD;AAED,OAAO,SAASC,oBAAT,CAA8BT,GAA9B,EAAmE;AACxE,MAAI,CAACO,qBAAqB,CAACP,GAAD,CAA1B,EAAiC;AAC/B,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAAEA,GAAD,CAAaU,iBAAtB;AACD;AAED,OAAO,SAASC,2BAAT,CAAqCX,GAArC,EAAiF;AACtF,MAAI,CAACD,sBAAsB,CAACC,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,MAAMY,iBAAiB,GAAGX,MAAM,CAACC,MAAP,CAAcF,GAAd,EAAmBa,IAAnB,CAAyBC,KAAD,IAAY,OAAOA,KAAP,KAAiB,QAArD,MAAoEC,SAA9F;AACA,SAAOH,iBAAP;AACD;AAED,OAAO,SAASI,iBAAT,CAA2BhB,GAA3B,EAA6D;AAClE,MAAII,sBAAsB,CAACJ,GAAD,CAAtB,IAA+BW,2BAA2B,CAACX,GAAD,CAA9D,EAAqE;AACnE,WAAO,IAAP;AACD;;AACD,SAAO,KAAP;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 StorageManager from '../StorageManager';\nimport { CustomUrls } from './OktaAuthOptions';\n\nexport interface TransactionManagerOptions {\n storageManager?: StorageManager;\n enableSharedStorage?: boolean; // default true\n legacyWidgetSupport?: boolean; // default true\n saveNonceCookie?: boolean; // default true\n saveStateCookie?: boolean; // default true\n saveParamsCookie?: boolean; // default true\n}\n\nexport interface TransactionMetaOptions {\n pkce?: boolean;\n oauth?: boolean;\n muteWarning?: boolean;\n state?: string;\n}\n\n// formerly known as \"Redirect OAuth Params\"\nexport interface OAuthTransactionMeta {\n issuer: string;\n redirectUri: string;\n state: string;\n nonce: string;\n responseType: string | string [];\n scopes: string[];\n clientId: string;\n urls: CustomUrls;\n ignoreSignature: boolean;\n originalUri?: string;\n}\n\nexport interface PKCETransactionMeta extends OAuthTransactionMeta {\n codeVerifier: string;\n codeChallengeMethod: string;\n codeChallenge: string;\n}\n\nexport interface IdxTransactionMeta extends PKCETransactionMeta {\n interactionHandle?: string;\n remediations?: string[];\n}\n\nexport type CustomAuthTransactionMeta = Record<string, string | undefined>;\n\nexport type TransactionMeta =\n IdxTransactionMeta |\n PKCETransactionMeta |\n OAuthTransactionMeta |\n CustomAuthTransactionMeta;\n\nfunction isObjectWithProperties(obj) {\n if (!obj || typeof obj !== 'object' || Object.values(obj).length === 0) {\n return false;\n }\n return true;\n}\n\nexport function isOAuthTransactionMeta(obj: any): obj is OAuthTransactionMeta {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n return !!obj.redirectUri || !!obj.responseType;\n}\n\nexport function isPKCETransactionMeta(obj: any): obj is PKCETransactionMeta {\n if (!isOAuthTransactionMeta(obj)) {\n return false;\n }\n return !!(obj as any).codeVerifier;\n}\n\nexport function isIdxTransactionMeta(obj: any): obj is IdxTransactionMeta {\n if (!isPKCETransactionMeta(obj)) {\n return false;\n }\n return !!(obj as any).interactionHandle;\n}\n\nexport function isCustomAuthTransactionMeta(obj: any): obj is CustomAuthTransactionMeta {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n const isAllStringValues = Object.values(obj).find((value) => (typeof value !== 'string')) === undefined;\n return isAllStringValues;\n}\n\nexport function isTransactionMeta(obj: any): obj is TransactionMeta {\n if (isOAuthTransactionMeta(obj) || isCustomAuthTransactionMeta(obj)) {\n return true;\n }\n return false;\n}\n"],"file":"Transaction.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=UserClaims.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"UserClaims.js"}
package/esm/types/api.js DELETED
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"api.js"}
package/esm/types/http.js DELETED
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"http.js"}
@@ -1,27 +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 './api';
13
- export * from './AuthState';
14
- export * from './EventEmitter';
15
- export * from './Transaction';
16
- export * from './Cookies';
17
- export * from './http';
18
- export * from '../idx/types';
19
- export * from './JWT';
20
- export * from './OAuth';
21
- export * from './OktaAuthOptions';
22
- export * from './Storage';
23
- export * from './Token';
24
- export * from './TokenManager';
25
- export * from './UserClaims';
26
- export * from './AuthState';
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/types/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,cAAc,OAAd;AACA,cAAc,aAAd;AACA,cAAc,gBAAd;AACA,cAAc,eAAd;AACA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,cAAd;AACA,cAAc,OAAd;AACA,cAAc,SAAd;AACA,cAAc,mBAAd;AACA,cAAc,WAAd;AACA,cAAc,SAAd;AACA,cAAc,gBAAd;AACA,cAAc,cAAd;AACA,cAAc,aAAd","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from './api';\nexport * from './AuthState';\nexport * from './EventEmitter';\nexport * from './Transaction';\nexport * from './Cookies';\nexport * from './http';\nexport * from '../idx/types';\nexport * from './JWT';\nexport * from './OAuth';\nexport * from './OktaAuthOptions';\nexport * from './Storage';\nexport * from './Token';\nexport * from './TokenManager';\nexport * from './UserClaims';\nexport * from './AuthState';\n"],"file":"index.js"}
@@ -1,53 +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
-
13
- /* global window */
14
- export function getNativeConsole() {
15
- if (typeof window !== 'undefined') {
16
- return window.console;
17
- } else if (typeof console !== 'undefined') {
18
- return console;
19
- } else {
20
- return undefined;
21
- }
22
- }
23
- export function getConsole() {
24
- var nativeConsole = getNativeConsole();
25
-
26
- if (nativeConsole && nativeConsole.log) {
27
- return nativeConsole;
28
- }
29
-
30
- return {
31
- log: function log() {},
32
- warn: function warn() {},
33
- group: function group() {},
34
- groupEnd: function groupEnd() {}
35
- };
36
- }
37
- export function warn(text) {
38
- /* eslint-disable no-console */
39
- getConsole().warn('[okta-auth-sdk] WARN: ' + text);
40
- /* eslint-enable */
41
- }
42
- export function deprecate(text) {
43
- /* eslint-disable no-console */
44
- getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);
45
- /* eslint-enable */
46
- }
47
- export function deprecateWrap(text, fn) {
48
- return function () {
49
- deprecate(text);
50
- return fn.apply(null, arguments);
51
- };
52
- }
53
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/console.ts"],"names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAEA,OAAO,SAASA,gBAAT,GAA4B;AACjC,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,WAAOA,MAAM,CAACC,OAAd;AACD,GAFD,MAEO,IAAI,OAAOA,OAAP,KAAmB,WAAvB,EAAoC;AACzC,WAAOA,OAAP;AACD,GAFM,MAEA;AACL,WAAOC,SAAP;AACD;AACF;AAED,OAAO,SAASC,UAAT,GAAsB;AAC3B,MAAIC,aAAa,GAAGL,gBAAgB,EAApC;;AACA,MAAIK,aAAa,IAAIA,aAAa,CAACC,GAAnC,EAAwC;AACtC,WAAOD,aAAP;AACD;;AACD,SAAO;AACLC,IAAAA,GAAG,EAAE,eAAW,CAAE,CADb;AAELC,IAAAA,IAAI,EAAE,gBAAW,CAAE,CAFd;AAGLC,IAAAA,KAAK,EAAE,iBAAW,CAAE,CAHf;AAILC,IAAAA,QAAQ,EAAE,oBAAW,CAAE;AAJlB,GAAP;AAMD;AAED,OAAO,SAASF,IAAT,CAAcG,IAAd,EAAoB;AACzB;AACAN,EAAAA,UAAU,GAAGG,IAAb,CAAkB,2BAA2BG,IAA7C;AACA;AACD;AAED,OAAO,SAASC,SAAT,CAAmBD,IAAnB,EAAyB;AAC9B;AACAN,EAAAA,UAAU,GAAGG,IAAb,CAAkB,kCAAkCG,IAApD;AACA;AACD;AAED,OAAO,SAASE,aAAT,CAAuBF,IAAvB,EAA6BG,EAA7B,EAAiC;AACtC,SAAO,YAAW;AAChBF,IAAAA,SAAS,CAACD,IAAD,CAAT;AACA,WAAOG,EAAE,CAACC,KAAH,CAAS,IAAT,EAAeC,SAAf,CAAP;AACD,GAHD;AAID","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n/* global window */\n\nexport function getNativeConsole() {\n if (typeof window !== 'undefined') {\n return window.console;\n } else if (typeof console !== 'undefined') {\n return console;\n } else {\n return undefined;\n }\n}\n\nexport function getConsole() {\n var nativeConsole = getNativeConsole();\n if (nativeConsole && nativeConsole.log) {\n return nativeConsole;\n }\n return {\n log: function() {},\n warn: function() {},\n group: function() {},\n groupEnd: function() {}\n };\n}\n\nexport function warn(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] WARN: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecate(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecateWrap(text, fn) {\n return function() {\n deprecate(text);\n return fn.apply(null, arguments);\n };\n}\n\n"],"file":"console.js"}
@@ -1,21 +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 { urlParamsToObject } from '../oidc/util/urlParams';
13
- // Check if state && stateTokenExternalId have been passed back in the url
14
- export function isEmailVerifyCallback(urlPath) {
15
- return /(stateTokenExternalId=)/i.test(urlPath) && /(state=)/i.test(urlPath);
16
- } // Parse state and stateTokenExternalId from a urlPath (should be either a search or fragment from the URL)
17
-
18
- export function parseEmailVerifyCallback(urlPath) {
19
- return urlParamsToObject(urlPath);
20
- }
21
- //# sourceMappingURL=emailVerify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/emailVerify.ts"],"names":["urlParamsToObject","isEmailVerifyCallback","urlPath","test","parseEmailVerifyCallback"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,iBAAT,QAAmC,wBAAnC;AAOA;AACA,OAAO,SAASC,qBAAT,CAAgCC,OAAhC,EAA0D;AAC/D,SAAO,2BAA2BC,IAA3B,CAAgCD,OAAhC,KAA4C,YAAYC,IAAZ,CAAiBD,OAAjB,CAAnD;AACD,C,CAED;;AACA,OAAO,SAASE,wBAAT,CAAkCF,OAAlC,EAAgF;AACrF,SAAOF,iBAAiB,CAACE,OAAD,CAAxB;AACD","sourcesContent":["\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { urlParamsToObject } from '../oidc/util/urlParams';\n\nexport interface EmailVerifyCallbackResponse {\n state: string;\n stateTokenExternalId: string;\n}\n\n// Check if state && stateTokenExternalId have been passed back in the url\nexport function isEmailVerifyCallback (urlPath: string): boolean {\n return /(stateTokenExternalId=)/i.test(urlPath) && /(state=)/i.test(urlPath);\n}\n\n// Parse state and stateTokenExternalId from a urlPath (should be either a search or fragment from the URL)\nexport function parseEmailVerifyCallback(urlPath: string): EmailVerifyCallbackResponse {\n return urlParamsToObject(urlPath) as EmailVerifyCallbackResponse;\n}\n"],"file":"emailVerify.js"}
package/esm/util/index.js DELETED
@@ -1,18 +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 './console';
13
- export * from './emailVerify';
14
- export * from './misc';
15
- export * from './object';
16
- export * from './types';
17
- export * from './url';
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,OAAd","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 './console';\nexport * from './emailVerify';\nexport * from './misc';\nexport * from './object';\nexport * from './types';\nexport * from './url';\n"],"file":"index.js"}
package/esm/util/misc.js DELETED
@@ -1,33 +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 isoToUTCString(str) {
13
- var parts = str.match(/\d+/g),
14
- isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),
15
- isoDate = new Date(isoTime);
16
- return isoDate.toUTCString();
17
- }
18
- export function genRandomString(length) {
19
- var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
20
- var random = '';
21
-
22
- for (var c = 0, cl = randomCharset.length; c < length; ++c) {
23
- random += randomCharset[Math.floor(Math.random() * cl)];
24
- }
25
-
26
- return random;
27
- }
28
- export function delay(ms) {
29
- return new Promise(function (resolve) {
30
- setTimeout(resolve, ms);
31
- });
32
- }
33
- //# sourceMappingURL=misc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/misc.ts"],"names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,SAASA,cAAT,CAAwBC,GAAxB,EAA6B;AAClC,MAAIC,KAAK,GAAGD,GAAG,CAACE,KAAJ,CAAU,MAAV,CAAZ;AAAA,MACIC,OAAO,GAAGC,IAAI,CAACC,GAAL,CAASJ,KAAK,CAAC,CAAD,CAAd,EAAmBA,KAAK,CAAC,CAAD,CAAL,GAAW,CAA9B,EAAiCA,KAAK,CAAC,CAAD,CAAtC,EAA2CA,KAAK,CAAC,CAAD,CAAhD,EAAqDA,KAAK,CAAC,CAAD,CAA1D,EAA+DA,KAAK,CAAC,CAAD,CAApE,CADd;AAAA,MAEIK,OAAO,GAAG,IAAIF,IAAJ,CAASD,OAAT,CAFd;AAIA,SAAOG,OAAO,CAACC,WAAR,EAAP;AACD;AAED,OAAO,SAASC,eAAT,CAAyBC,MAAzB,EAAiC;AACtC,MAAIC,aAAa,GAAG,+DAApB;AACA,MAAIC,MAAM,GAAG,EAAb;;AACA,OAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,EAAE,GAAGH,aAAa,CAACD,MAAnC,EAA2CG,CAAC,GAAGH,MAA/C,EAAuD,EAAEG,CAAzD,EAA4D;AAC1DD,IAAAA,MAAM,IAAID,aAAa,CAACI,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACH,MAAL,KAAgBE,EAA3B,CAAD,CAAvB;AACD;;AACD,SAAOF,MAAP;AACD;AAED,OAAO,SAASK,KAAT,CAAeC,EAAf,EAAmB;AACxB,SAAO,IAAIC,OAAJ,CAAY,UAASC,OAAT,EAAkB;AACnCC,IAAAA,UAAU,CAACD,OAAD,EAAUF,EAAV,CAAV;AACD,GAFM,CAAP;AAGD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isoToUTCString(str) {\n var parts = str.match(/\\d+/g),\n isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),\n isoDate = new Date(isoTime);\n\n return isoDate.toUTCString();\n}\n\nexport function genRandomString(length) {\n var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var random = '';\n for (var c = 0, cl = randomCharset.length; c < length; ++c) {\n random += randomCharset[Math.floor(Math.random() * cl)];\n }\n return random;\n}\n\nexport function delay(ms) {\n return new Promise(function(resolve) {\n setTimeout(resolve, ms);\n });\n}\n"],"file":"misc.js"}