@okta/okta-auth-js 6.0.0 → 6.3.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 (398) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +58 -27
  3. package/cjs/AuthStateManager.js +21 -7
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +96 -40
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/PromiseQueue.js +14 -3
  9. package/cjs/PromiseQueue.js.map +1 -1
  10. package/cjs/SavedObject.js +4 -2
  11. package/cjs/SavedObject.js.map +1 -1
  12. package/cjs/ServiceManager.js +195 -0
  13. package/cjs/ServiceManager.js.map +1 -0
  14. package/cjs/StorageManager.js +13 -8
  15. package/cjs/StorageManager.js.map +1 -1
  16. package/cjs/TokenManager.js +34 -32
  17. package/cjs/TokenManager.js.map +1 -1
  18. package/cjs/TransactionManager.js +17 -5
  19. package/cjs/TransactionManager.js.map +1 -1
  20. package/cjs/browser/browserStorage.js +48 -33
  21. package/cjs/browser/browserStorage.js.map +1 -1
  22. package/cjs/browser/fingerprint.js +9 -3
  23. package/cjs/browser/fingerprint.js.map +1 -1
  24. package/cjs/builderUtil.js +4 -2
  25. package/cjs/builderUtil.js.map +1 -1
  26. package/cjs/clock.js +5 -1
  27. package/cjs/clock.js.map +1 -1
  28. package/cjs/crypto/base64.js +18 -0
  29. package/cjs/crypto/base64.js.map +1 -1
  30. package/cjs/crypto/index.js +6 -4
  31. package/cjs/crypto/index.js.map +1 -1
  32. package/cjs/crypto/node.js +19 -13
  33. package/cjs/crypto/node.js.map +1 -1
  34. package/cjs/crypto/oidcHash.js +5 -1
  35. package/cjs/crypto/oidcHash.js.map +1 -1
  36. package/cjs/crypto/webauthn.js +101 -0
  37. package/cjs/crypto/webauthn.js.map +1 -0
  38. package/cjs/crypto/webcrypto.js +3 -1
  39. package/cjs/crypto/webcrypto.js.map +1 -1
  40. package/cjs/errors/AuthApiError.js +1 -1
  41. package/cjs/errors/AuthPollStopError.js +1 -1
  42. package/cjs/errors/AuthSdkError.js +1 -1
  43. package/cjs/errors/CustomError.js +5 -1
  44. package/cjs/errors/CustomError.js.map +1 -1
  45. package/cjs/errors/OAuthError.js +1 -1
  46. package/cjs/errors/index.js +1 -1
  47. package/cjs/fetch/fetchRequest.js +18 -6
  48. package/cjs/fetch/fetchRequest.js.map +1 -1
  49. package/cjs/http/headers.js.map +1 -1
  50. package/cjs/http/index.js +4 -2
  51. package/cjs/http/index.js.map +1 -1
  52. package/cjs/http/request.js +9 -5
  53. package/cjs/http/request.js.map +1 -1
  54. package/cjs/idx/authenticate.js.map +1 -1
  55. package/cjs/idx/authenticator/Authenticator.js.map +1 -1
  56. package/cjs/idx/authenticator/OktaPassword.js +12 -3
  57. package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
  58. package/cjs/idx/authenticator/OktaVerifyTotp.js +9 -1
  59. package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
  60. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +15 -2
  61. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
  62. package/cjs/idx/authenticator/SecurityQuestionVerification.js +10 -2
  63. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  64. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +13 -3
  65. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  66. package/cjs/idx/authenticator/WebauthnEnrollment.js +51 -0
  67. package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -0
  68. package/cjs/idx/authenticator/WebauthnVerification.js +60 -0
  69. package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -0
  70. package/cjs/idx/authenticator/getAuthenticator.js +13 -1
  71. package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
  72. package/cjs/idx/authenticator/index.js +34 -6
  73. package/cjs/idx/authenticator/index.js.map +1 -1
  74. package/cjs/idx/authenticator/util.js +64 -0
  75. package/cjs/idx/authenticator/util.js.map +1 -0
  76. package/cjs/idx/cancel.js.map +1 -1
  77. package/cjs/idx/emailVerify.js +1 -1
  78. package/cjs/idx/emailVerify.js.map +1 -1
  79. package/cjs/idx/flow/AccountUnlockFlow.js +30 -0
  80. package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -0
  81. package/cjs/idx/flow/FlowSpecification.js +8 -0
  82. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  83. package/cjs/idx/flow/PasswordRecoveryFlow.js +4 -1
  84. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  85. package/cjs/idx/flow/index.js +20 -5
  86. package/cjs/idx/flow/index.js.map +1 -1
  87. package/cjs/idx/handleInteractionCodeRedirect.js +5 -1
  88. package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
  89. package/cjs/idx/headers.js +21 -5
  90. package/cjs/idx/headers.js.map +1 -1
  91. package/cjs/idx/idx-js/client.js +91 -0
  92. package/cjs/idx/idx-js/client.js.map +1 -0
  93. package/cjs/idx/idx-js/index.js +40 -0
  94. package/cjs/idx/idx-js/index.js.map +1 -0
  95. package/cjs/idx/idx-js/interact.js +83 -0
  96. package/cjs/idx/idx-js/interact.js.map +1 -0
  97. package/cjs/idx/idx-js/introspect.js +62 -0
  98. package/cjs/idx/idx-js/introspect.js.map +1 -0
  99. package/cjs/idx/idx-js/parsers.js +41 -0
  100. package/cjs/idx/idx-js/parsers.js.map +1 -0
  101. package/cjs/idx/idx-js/util.js +34 -0
  102. package/cjs/idx/idx-js/util.js.map +1 -0
  103. package/cjs/idx/idx-js/v1/actionParser.js +90 -0
  104. package/cjs/idx/idx-js/v1/actionParser.js.map +1 -0
  105. package/cjs/idx/idx-js/v1/generateIdxAction.js +111 -0
  106. package/cjs/idx/idx-js/v1/generateIdxAction.js.map +1 -0
  107. package/cjs/idx/idx-js/v1/idxResponseParser.js +137 -0
  108. package/cjs/idx/idx-js/v1/idxResponseParser.js.map +1 -0
  109. package/cjs/idx/idx-js/v1/makeIdxState.js +65 -0
  110. package/cjs/idx/idx-js/v1/makeIdxState.js.map +1 -0
  111. package/cjs/idx/idx-js/v1/parsers.js +24 -0
  112. package/cjs/idx/idx-js/v1/parsers.js.map +1 -0
  113. package/cjs/idx/idx-js/v1/remediationParser.js +32 -0
  114. package/cjs/idx/idx-js/v1/remediationParser.js.map +1 -0
  115. package/cjs/idx/index.js +120 -121
  116. package/cjs/idx/index.js.map +1 -1
  117. package/cjs/idx/interact.js +9 -4
  118. package/cjs/idx/interact.js.map +1 -1
  119. package/cjs/idx/introspect.js +19 -9
  120. package/cjs/idx/introspect.js.map +1 -1
  121. package/cjs/idx/poll.js +13 -3
  122. package/cjs/idx/poll.js.map +1 -1
  123. package/cjs/idx/proceed.js +14 -11
  124. package/cjs/idx/proceed.js.map +1 -1
  125. package/cjs/idx/recoverPassword.js.map +1 -1
  126. package/cjs/idx/register.js +5 -1
  127. package/cjs/idx/register.js.map +1 -1
  128. package/cjs/idx/remediate.js +112 -88
  129. package/cjs/idx/remediate.js.map +1 -1
  130. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +16 -6
  131. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  132. package/cjs/idx/remediators/AuthenticatorVerificationData.js +61 -16
  133. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  134. package/cjs/idx/remediators/Base/AuthenticatorData.js +44 -20
  135. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  136. package/cjs/idx/remediators/Base/Remediator.js +116 -82
  137. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  138. package/cjs/idx/remediators/Base/SelectAuthenticator.js +58 -34
  139. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  140. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +30 -7
  141. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  142. package/cjs/idx/remediators/ChallengeAuthenticator.js +2 -2
  143. package/cjs/idx/remediators/ChallengePoll.js +10 -3
  144. package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
  145. package/cjs/idx/remediators/EnrollAuthenticator.js +2 -2
  146. package/cjs/idx/remediators/EnrollPoll.js +16 -6
  147. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  148. package/cjs/idx/remediators/EnrollProfile.js +34 -16
  149. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  150. package/cjs/idx/remediators/EnrollmentChannelData.js +25 -17
  151. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
  152. package/cjs/idx/remediators/Identify.js +16 -7
  153. package/cjs/idx/remediators/Identify.js.map +1 -1
  154. package/cjs/idx/remediators/ReEnrollAuthenticator.js +13 -10
  155. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  156. package/cjs/idx/remediators/RedirectIdp.js +2 -2
  157. package/cjs/idx/remediators/ResetAuthenticator.js +2 -2
  158. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +9 -6
  159. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  160. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +2 -2
  161. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +71 -0
  162. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -0
  163. package/cjs/idx/remediators/SelectEnrollProfile.js +2 -2
  164. package/cjs/idx/remediators/SelectEnrollmentChannel.js +22 -10
  165. package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
  166. package/cjs/idx/remediators/Skip.js +5 -10
  167. package/cjs/idx/remediators/Skip.js.map +1 -1
  168. package/cjs/idx/remediators/index.js +33 -18
  169. package/cjs/idx/remediators/index.js.map +1 -1
  170. package/cjs/idx/remediators/util.js +13 -3
  171. package/cjs/idx/remediators/util.js.map +1 -1
  172. package/cjs/idx/run.js +276 -177
  173. package/cjs/idx/run.js.map +1 -1
  174. package/cjs/idx/startTransaction.js.map +1 -1
  175. package/cjs/idx/transactionMeta.js.map +1 -1
  176. package/cjs/idx/types/idx-js.js.map +1 -1
  177. package/cjs/idx/types/index.js +82 -9
  178. package/cjs/idx/types/index.js.map +1 -1
  179. package/cjs/idx/unlockAccount.js +48 -0
  180. package/cjs/idx/unlockAccount.js.map +1 -0
  181. package/cjs/idx/util.js +198 -0
  182. package/cjs/idx/util.js.map +1 -0
  183. package/cjs/index.js +20 -14
  184. package/cjs/index.js.map +1 -1
  185. package/cjs/oidc/endpoints/authorize.js +8 -2
  186. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  187. package/cjs/oidc/endpoints/index.js +5 -3
  188. package/cjs/oidc/endpoints/index.js.map +1 -1
  189. package/cjs/oidc/endpoints/token.js +15 -3
  190. package/cjs/oidc/endpoints/token.js.map +1 -1
  191. package/cjs/oidc/endpoints/well-known.js +7 -3
  192. package/cjs/oidc/endpoints/well-known.js.map +1 -1
  193. package/cjs/oidc/exchangeCodeForTokens.js +10 -2
  194. package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
  195. package/cjs/oidc/getToken.js +9 -5
  196. package/cjs/oidc/getToken.js.map +1 -1
  197. package/cjs/oidc/getUserInfo.js +7 -3
  198. package/cjs/oidc/getUserInfo.js.map +1 -1
  199. package/cjs/oidc/getWithPopup.js +8 -2
  200. package/cjs/oidc/getWithPopup.js.map +1 -1
  201. package/cjs/oidc/getWithRedirect.js +5 -1
  202. package/cjs/oidc/getWithRedirect.js.map +1 -1
  203. package/cjs/oidc/getWithoutPrompt.js +8 -2
  204. package/cjs/oidc/getWithoutPrompt.js.map +1 -1
  205. package/cjs/oidc/handleOAuthResponse.js +9 -3
  206. package/cjs/oidc/handleOAuthResponse.js.map +1 -1
  207. package/cjs/oidc/index.js +4 -2
  208. package/cjs/oidc/index.js.map +1 -1
  209. package/cjs/oidc/parseFromUrl.js +9 -3
  210. package/cjs/oidc/parseFromUrl.js.map +1 -1
  211. package/cjs/oidc/renewToken.js.map +1 -1
  212. package/cjs/oidc/renewTokens.js +5 -1
  213. package/cjs/oidc/renewTokens.js.map +1 -1
  214. package/cjs/oidc/renewTokensWithRefresh.js +5 -1
  215. package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
  216. package/cjs/oidc/revokeToken.js +7 -3
  217. package/cjs/oidc/revokeToken.js.map +1 -1
  218. package/cjs/oidc/util/browser.js +5 -1
  219. package/cjs/oidc/util/browser.js.map +1 -1
  220. package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
  221. package/cjs/oidc/util/errors.js.map +1 -1
  222. package/cjs/oidc/util/index.js +14 -12
  223. package/cjs/oidc/util/index.js.map +1 -1
  224. package/cjs/oidc/util/loginRedirect.js +5 -1
  225. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  226. package/cjs/oidc/util/oauth.js +4 -2
  227. package/cjs/oidc/util/oauth.js.map +1 -1
  228. package/cjs/oidc/util/oauthMeta.js.map +1 -1
  229. package/cjs/oidc/util/pkce.js +11 -3
  230. package/cjs/oidc/util/pkce.js.map +1 -1
  231. package/cjs/oidc/util/prepareTokenParams.js +7 -5
  232. package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
  233. package/cjs/oidc/util/validateClaims.js +1 -1
  234. package/cjs/oidc/util/validateClaims.js.map +1 -1
  235. package/cjs/oidc/verifyToken.js +11 -3
  236. package/cjs/oidc/verifyToken.js.map +1 -1
  237. package/cjs/options/browser.js +86 -0
  238. package/cjs/options/browser.js.map +1 -0
  239. package/cjs/options/index.js +94 -0
  240. package/cjs/options/index.js.map +1 -0
  241. package/cjs/options/node.js +45 -0
  242. package/cjs/options/node.js.map +1 -0
  243. package/cjs/options.js +17 -5
  244. package/cjs/options.js.map +1 -1
  245. package/cjs/server/serverStorage.js +8 -4
  246. package/cjs/server/serverStorage.js.map +1 -1
  247. package/cjs/services/AutoRenewService.js +94 -0
  248. package/cjs/services/AutoRenewService.js.map +1 -0
  249. package/cjs/services/SyncStorageService.js +93 -0
  250. package/cjs/services/SyncStorageService.js.map +1 -0
  251. package/cjs/services/index.js +30 -0
  252. package/cjs/services/index.js.map +1 -0
  253. package/cjs/tx/AuthTransaction.js +15 -9
  254. package/cjs/tx/AuthTransaction.js.map +1 -1
  255. package/cjs/tx/api.js +8 -4
  256. package/cjs/tx/api.js.map +1 -1
  257. package/cjs/tx/index.js +7 -5
  258. package/cjs/tx/index.js.map +1 -1
  259. package/cjs/tx/poll.js +6 -4
  260. package/cjs/tx/poll.js.map +1 -1
  261. package/cjs/tx/util.js +5 -1
  262. package/cjs/tx/util.js.map +1 -1
  263. package/cjs/types/Service.js +2 -0
  264. package/cjs/types/Service.js.map +1 -0
  265. package/cjs/types/Transaction.js +10 -2
  266. package/cjs/types/Transaction.js.map +1 -1
  267. package/cjs/types/index.js +29 -14
  268. package/cjs/types/index.js.map +1 -1
  269. package/cjs/util/index.js +7 -5
  270. package/cjs/util/index.js.map +1 -1
  271. package/cjs/util/misc.js +5 -1
  272. package/cjs/util/misc.js.map +1 -1
  273. package/cjs/util/object.js +16 -6
  274. package/cjs/util/object.js.map +1 -1
  275. package/cjs/util/sharedStorage.js +5 -1
  276. package/cjs/util/sharedStorage.js.map +1 -1
  277. package/dist/okta-auth-js.min.js +1 -1
  278. package/dist/okta-auth-js.min.js.LICENSE.txt +0 -20
  279. package/dist/okta-auth-js.min.js.map +1 -1
  280. package/dist/okta-auth-js.polyfill.js +1 -1
  281. package/dist/okta-auth-js.polyfill.js.map +1 -1
  282. package/dist/okta-auth-js.umd.js +1 -1
  283. package/dist/okta-auth-js.umd.js.LICENSE.txt +1 -19
  284. package/dist/okta-auth-js.umd.js.map +1 -1
  285. package/esm/{index.js → esm.browser.js} +2978 -2585
  286. package/esm/esm.browser.js.map +1 -0
  287. package/esm/esm.node.mjs +9595 -0
  288. package/esm/esm.node.mjs.map +1 -0
  289. package/lib/AuthStateManager.d.ts +3 -3
  290. package/lib/OktaAuth.d.ts +10 -6
  291. package/lib/PromiseQueue.d.ts +6 -2
  292. package/lib/ServiceManager.d.ts +38 -0
  293. package/lib/StorageManager.d.ts +1 -1
  294. package/lib/TokenManager.d.ts +2 -3
  295. package/lib/TransactionManager.d.ts +4 -5
  296. package/lib/browser/fingerprint.d.ts +2 -3
  297. package/lib/crypto/base64.d.ts +2 -0
  298. package/lib/crypto/webauthn.d.ts +25 -0
  299. package/lib/http/headers.d.ts +2 -2
  300. package/lib/http/request.d.ts +4 -4
  301. package/lib/idx/authenticate.d.ts +2 -2
  302. package/lib/idx/authenticator/Authenticator.d.ts +4 -5
  303. package/lib/idx/authenticator/OktaPassword.d.ts +8 -9
  304. package/lib/idx/authenticator/OktaVerifyTotp.d.ts +1 -1
  305. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +11 -12
  306. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +7 -7
  307. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +8 -3
  308. package/lib/idx/authenticator/WebauthnEnrollment.d.ts +16 -0
  309. package/lib/idx/authenticator/WebauthnVerification.d.ts +17 -0
  310. package/lib/idx/authenticator/getAuthenticator.d.ts +1 -1
  311. package/lib/idx/authenticator/index.d.ts +9 -0
  312. package/lib/idx/authenticator/util.d.ts +4 -0
  313. package/lib/idx/cancel.d.ts +2 -2
  314. package/lib/idx/emailVerify.d.ts +2 -2
  315. package/lib/idx/flow/AccountUnlockFlow.d.ts +13 -0
  316. package/lib/idx/flow/FlowSpecification.d.ts +2 -2
  317. package/lib/idx/flow/index.d.ts +1 -0
  318. package/lib/idx/headers.d.ts +3 -2
  319. package/lib/idx/idx-js/client.d.ts +36 -0
  320. package/lib/idx/idx-js/index.d.ts +35 -0
  321. package/lib/idx/idx-js/interact.d.ts +25 -0
  322. package/lib/idx/idx-js/introspect.d.ts +21 -0
  323. package/lib/idx/idx-js/parsers.d.ts +15 -0
  324. package/lib/idx/idx-js/util.d.ts +12 -0
  325. package/lib/idx/idx-js/v1/actionParser.d.ts +16 -0
  326. package/lib/idx/idx-js/v1/generateIdxAction.d.ts +13 -0
  327. package/lib/idx/idx-js/v1/idxResponseParser.d.ts +20 -0
  328. package/lib/idx/idx-js/v1/makeIdxState.d.ts +13 -0
  329. package/lib/idx/idx-js/v1/parsers.d.ts +16 -0
  330. package/lib/idx/idx-js/v1/remediationParser.d.ts +12 -0
  331. package/lib/idx/index.d.ts +12 -11
  332. package/lib/idx/interact.d.ts +3 -2
  333. package/lib/idx/introspect.d.ts +2 -2
  334. package/lib/idx/poll.d.ts +2 -2
  335. package/lib/idx/proceed.d.ts +5 -6
  336. package/lib/idx/recoverPassword.d.ts +2 -2
  337. package/lib/idx/register.d.ts +2 -2
  338. package/lib/idx/remediate.d.ts +2 -2
  339. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +6 -5
  340. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +5 -8
  341. package/lib/idx/remediators/Base/Remediator.d.ts +6 -5
  342. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +9 -8
  343. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +9 -16
  344. package/lib/idx/remediators/ChallengePoll.d.ts +1 -0
  345. package/lib/idx/remediators/EnrollProfile.d.ts +0 -3
  346. package/lib/idx/remediators/EnrollmentChannelData.d.ts +1 -4
  347. package/lib/idx/remediators/Identify.d.ts +3 -5
  348. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -5
  349. package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +2 -1
  350. package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +37 -0
  351. package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +1 -0
  352. package/lib/idx/remediators/Skip.d.ts +0 -3
  353. package/lib/idx/remediators/index.d.ts +1 -0
  354. package/lib/idx/run.d.ts +2 -2
  355. package/lib/idx/startTransaction.d.ts +2 -2
  356. package/lib/idx/transactionMeta.d.ts +7 -7
  357. package/lib/idx/types/FlowIdentifier.d.ts +1 -1
  358. package/lib/idx/types/idx-js.d.ts +41 -1
  359. package/lib/idx/types/index.d.ts +27 -7
  360. package/lib/idx/unlockAccount.d.ts +15 -0
  361. package/lib/idx/util.d.ts +11 -0
  362. package/lib/oidc/endpoints/well-known.d.ts +3 -3
  363. package/lib/oidc/exchangeCodeForTokens.d.ts +2 -2
  364. package/lib/oidc/getToken.d.ts +2 -2
  365. package/lib/oidc/getWithPopup.d.ts +2 -2
  366. package/lib/oidc/getWithRedirect.d.ts +2 -2
  367. package/lib/oidc/getWithoutPrompt.d.ts +2 -2
  368. package/lib/oidc/handleOAuthResponse.d.ts +2 -2
  369. package/lib/oidc/renewToken.d.ts +2 -2
  370. package/lib/oidc/renewTokensWithRefresh.d.ts +2 -2
  371. package/lib/oidc/revokeToken.d.ts +2 -2
  372. package/lib/oidc/util/browser.d.ts +2 -2
  373. package/lib/oidc/util/defaultTokenParams.d.ts +2 -2
  374. package/lib/oidc/util/errors.d.ts +2 -2
  375. package/lib/oidc/util/loginRedirect.d.ts +4 -4
  376. package/lib/oidc/util/oauth.d.ts +4 -4
  377. package/lib/oidc/util/oauthMeta.d.ts +2 -2
  378. package/lib/oidc/util/prepareTokenParams.d.ts +5 -5
  379. package/lib/oidc/util/validateClaims.d.ts +2 -2
  380. package/lib/oidc/verifyToken.d.ts +2 -2
  381. package/lib/options/browser.d.ts +16 -0
  382. package/lib/options/index.d.ts +14 -0
  383. package/lib/options/node.d.ts +16 -0
  384. package/lib/services/AutoRenewService.d.ts +27 -0
  385. package/lib/services/{TokenService.d.ts → SyncStorageService.d.ts} +8 -5
  386. package/lib/services/index.d.ts +13 -0
  387. package/lib/types/OktaAuthOptions.d.ts +6 -2
  388. package/lib/types/Service.d.ts +23 -0
  389. package/lib/types/Storage.d.ts +7 -5
  390. package/lib/types/Transaction.d.ts +2 -10
  391. package/lib/types/api.d.ts +23 -10
  392. package/lib/types/index.d.ts +1 -1
  393. package/lib/util/sharedStorage.d.ts +1 -1
  394. package/package.json +32 -14
  395. package/polyfill/index.js +1 -0
  396. package/cjs/services/TokenService.js +0 -111
  397. package/cjs/services/TokenService.js.map +0 -1
  398. package/esm/index.js.map +0 -1
@@ -10,5 +10,5 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  import { RunOptions } from './run';
13
- import { OktaAuth, IdxTransaction } from '../types';
14
- export declare function startTransaction(authClient: OktaAuth, options?: RunOptions): Promise<IdxTransaction>;
13
+ import { OktaAuthInterface, IdxTransaction } from '../types';
14
+ export declare function startTransaction(authClient: OktaAuthInterface, options?: RunOptions): Promise<IdxTransaction>;
@@ -9,13 +9,13 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import { OktaAuth, IdxTransactionMeta, TransactionMetaOptions } from '../types';
13
- export declare function createTransactionMeta(authClient: OktaAuth, options?: TransactionMetaOptions): Promise<IdxTransactionMeta>;
14
- export declare function hasSavedInteractionHandle(authClient: OktaAuth, options?: TransactionMetaOptions): boolean;
15
- export declare function getSavedTransactionMeta(authClient: OktaAuth, options?: TransactionMetaOptions): IdxTransactionMeta | undefined;
16
- export declare function getTransactionMeta(authClient: OktaAuth, options?: TransactionMetaOptions): Promise<IdxTransactionMeta>;
17
- export declare function saveTransactionMeta(authClient: OktaAuth, meta: any): void;
18
- export declare function clearTransactionMeta(authClient: OktaAuth): void;
12
+ import { OktaAuthInterface, IdxTransactionMeta, TransactionMetaOptions } from '../types';
13
+ export declare function createTransactionMeta(authClient: OktaAuthInterface, options?: TransactionMetaOptions): Promise<IdxTransactionMeta>;
14
+ export declare function hasSavedInteractionHandle(authClient: OktaAuthInterface, options?: TransactionMetaOptions): boolean;
15
+ export declare function getSavedTransactionMeta(authClient: OktaAuthInterface, options?: TransactionMetaOptions): IdxTransactionMeta | undefined;
16
+ export declare function getTransactionMeta(authClient: OktaAuthInterface, options?: TransactionMetaOptions): Promise<IdxTransactionMeta>;
17
+ export declare function saveTransactionMeta(authClient: OktaAuthInterface, meta: any): void;
18
+ export declare function clearTransactionMeta(authClient: OktaAuthInterface): void;
19
19
  export declare function isTransactionMetaValid(meta: any, options?: TransactionMetaOptions): boolean;
20
20
  export declare function isTransactionMetaValidForFlow(meta: any, flow: any): boolean;
21
21
  export declare function isTransactionMetaValidForOptions(meta: any, options: any, keys: any): boolean;
@@ -1 +1 @@
1
- export declare type FlowIdentifier = 'default' | 'proceed' | 'authenticate' | 'login' | 'signin' | 'register' | 'signup' | 'enrollProfile' | 'recoverPassword' | 'resetPassword';
1
+ export declare type FlowIdentifier = 'default' | 'proceed' | 'authenticate' | 'login' | 'signin' | 'register' | 'signup' | 'enrollProfile' | 'recoverPassword' | 'resetPassword' | 'unlockAccount';
@@ -9,6 +9,39 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
+ export interface ChallengeData {
13
+ challenge: string;
14
+ userVerification: string;
15
+ extensions?: {
16
+ appid: string;
17
+ };
18
+ }
19
+ export interface ActivationData {
20
+ challenge: string;
21
+ rp: {
22
+ name: string;
23
+ };
24
+ user: {
25
+ id: string;
26
+ name: string;
27
+ displayName: string;
28
+ };
29
+ pubKeyCredParams: {
30
+ type: string;
31
+ alg: number;
32
+ }[];
33
+ attestation?: string;
34
+ authenticatorSelection?: {
35
+ userVerification?: string;
36
+ authenticatorAttachment?: string;
37
+ requireResidentKey?: boolean;
38
+ residentKey?: string;
39
+ };
40
+ excludeCredentials?: {
41
+ id: string;
42
+ type: string;
43
+ }[];
44
+ }
12
45
  export interface IdxAuthenticatorMethod {
13
46
  type: string;
14
47
  }
@@ -39,7 +72,11 @@ export interface IdxAuthenticator {
39
72
  }[];
40
73
  questionKeys?: string[];
41
74
  selectedChannel?: string;
75
+ activationData?: ActivationData;
76
+ challengeData?: ChallengeData;
42
77
  };
78
+ credentialId?: string;
79
+ enrollmentId?: string;
43
80
  }
44
81
  export interface IdxForm {
45
82
  value: IdxRemediationValue[];
@@ -143,10 +180,12 @@ export interface RawIdxResponse {
143
180
  value: IdxRemediation[];
144
181
  };
145
182
  messages?: IdxMessages;
183
+ success?: boolean;
184
+ successWithInteractionCode?: IdxRemediation;
146
185
  }
147
186
  export declare function isRawIdxResponse(obj: any): obj is RawIdxResponse;
148
187
  export interface IdxActions {
149
- [key: string]: Function;
188
+ [key: string]: () => Promise<IdxResponse>;
150
189
  }
151
190
  export interface IdxResponse {
152
191
  proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;
@@ -158,5 +197,6 @@ export interface IdxResponse {
158
197
  interactionHandle?: string;
159
198
  };
160
199
  context?: IdxContext;
200
+ requestDidSucceed?: boolean;
161
201
  }
162
202
  export declare function isIdxResponse(obj: any): obj is IdxResponse;
@@ -12,18 +12,22 @@
12
12
  import { InteractOptions } from '../interact';
13
13
  import { IntrospectOptions } from '../introspect';
14
14
  import { APIError, Tokens } from '../../types';
15
- import { IdxTransactionMeta } from '../../types/Transaction';
15
+ import { PKCETransactionMeta } from '../../types/Transaction';
16
16
  import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse } from './idx-js';
17
17
  import { FlowIdentifier } from './FlowIdentifier';
18
- export { IdxMessage } from './idx-js';
18
+ export { IdxMessage, IdxMessages, ChallengeData, ActivationData, IdxResponse, IdxContext, RawIdxResponse } from './idx-js';
19
19
  export { AuthenticationOptions } from '../authenticate';
20
20
  export { RegistrationOptions } from '../register';
21
21
  export { PasswordRecoveryOptions } from '../recoverPassword';
22
+ export { AccountUnlockOptions } from '../unlockAccount';
22
23
  export { ProceedOptions } from '../proceed';
23
24
  export { CancelOptions } from '../cancel';
25
+ export { RemediateOptions } from '../remediate';
24
26
  export { FlowIdentifier };
25
- export { IdxTransactionMeta };
27
+ export { IdxAuthenticator };
26
28
  export { EmailVerifyCallbackResponse } from '../emailVerify';
29
+ export { WebauthnEnrollValues } from '../authenticator/WebauthnEnrollment';
30
+ export { WebauthnVerificationValues } from '../authenticator/WebauthnVerification';
27
31
  export declare enum IdxStatus {
28
32
  SUCCESS = "SUCCESS",
29
33
  PENDING = "PENDING",
@@ -37,7 +41,8 @@ export declare enum AuthenticatorKey {
37
41
  PHONE_NUMBER = "phone_number",
38
42
  GOOGLE_AUTHENTICATOR = "google_otp",
39
43
  SECURITY_QUESTION = "security_question",
40
- OKTA_VERIFY = "okta_verify"
44
+ OKTA_VERIFY = "okta_verify",
45
+ WEBAUTHN = "webauthn"
41
46
  }
42
47
  export declare type Input = {
43
48
  name: string;
@@ -46,6 +51,8 @@ export declare type Input = {
46
51
  value?: string | {
47
52
  form: IdxForm;
48
53
  };
54
+ minLength?: number;
55
+ maxLength?: number;
49
56
  secret?: boolean;
50
57
  required?: boolean;
51
58
  };
@@ -57,18 +64,28 @@ export declare type NextStep = {
57
64
  inputs?: Input[];
58
65
  options?: IdxOption[];
59
66
  poll?: IdxPollOptions;
67
+ authenticatorEnrollments?: IdxAuthenticator[];
60
68
  };
61
69
  export declare enum IdxFeature {
62
70
  PASSWORD_RECOVERY = "recover-password",
63
71
  REGISTRATION = "enroll-profile",
64
- SOCIAL_IDP = "redirect-idp"
72
+ SOCIAL_IDP = "redirect-idp",
73
+ ACCOUNT_UNLOCK = "unlock-account"
74
+ }
75
+ export interface IdxTransactionMeta extends PKCETransactionMeta {
76
+ interactionHandle?: string;
77
+ remediations?: string[];
78
+ flow?: FlowIdentifier;
79
+ withCredentials?: boolean;
80
+ activationToken?: string;
81
+ recoveryToken?: string;
65
82
  }
66
83
  export interface IdxTransaction {
67
84
  status: IdxStatus;
68
85
  tokens?: Tokens;
69
86
  nextStep?: NextStep;
70
87
  messages?: IdxMessage[];
71
- error?: APIError;
88
+ error?: APIError | IdxResponse;
72
89
  meta?: IdxTransactionMeta;
73
90
  enabledFeatures?: IdxFeature[];
74
91
  availableSteps?: NextStep[];
@@ -83,13 +100,16 @@ export declare type IdxOptions = InteractOptions & IntrospectOptions & {
83
100
  flow?: FlowIdentifier;
84
101
  exchangeCodeForTokens?: boolean;
85
102
  autoRemediate?: boolean;
103
+ step?: string;
86
104
  };
87
105
  export interface IdxPollOptions {
88
106
  required?: boolean;
89
107
  refresh?: number;
90
108
  }
91
109
  export declare type Authenticator = {
92
- key: string;
110
+ id?: string;
111
+ key?: string;
93
112
  methodType?: string;
94
113
  phoneNumber?: string;
95
114
  };
115
+ export declare function isAuthenticator(obj: any): obj is Authenticator;
@@ -0,0 +1,15 @@
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 { IdentifyValues, SelectAuthenticatorUnlockAccountValues, SelectAuthenticatorAuthenticateValues, ChallengeAuthenticatorValues, AuthenticatorVerificationDataValues } from './remediators';
13
+ import { OktaAuthInterface, IdxOptions, IdxTransaction } from '../types';
14
+ export declare type AccountUnlockOptions = IdxOptions & IdentifyValues & SelectAuthenticatorUnlockAccountValues & SelectAuthenticatorAuthenticateValues & ChallengeAuthenticatorValues & AuthenticatorVerificationDataValues;
15
+ export declare function unlockAccount(authClient: OktaAuthInterface, options?: AccountUnlockOptions): Promise<IdxTransaction>;
@@ -0,0 +1,11 @@
1
+ import { RemediationValues } from './remediators';
2
+ import { IdxFeature, NextStep } from './types';
3
+ import { IdxMessage, IdxRemediationValue, IdxResponse } from './types/idx-js';
4
+ export declare function isTerminalResponse(idxResponse: IdxResponse): boolean;
5
+ export declare function canSkipFn(idxResponse: IdxResponse): boolean;
6
+ export declare function canResendFn(idxResponse: IdxResponse): boolean;
7
+ export declare function getMessagesFromIdxRemediationValue(value?: IdxRemediationValue[]): IdxMessage[] | undefined;
8
+ export declare function getMessagesFromResponse(idxResponse: IdxResponse): IdxMessage[];
9
+ export declare function getEnabledFeatures(idxResponse: IdxResponse): IdxFeature[];
10
+ export declare function getAvailableSteps(idxResponse: IdxResponse): NextStep[];
11
+ export declare function filterValuesForRemediation(idxResponse: IdxResponse, values: RemediationValues): RemediationValues;
@@ -1,3 +1,3 @@
1
- import { OktaAuth, WellKnownResponse } from '../../types';
2
- export declare function getWellKnown(sdk: OktaAuth, issuer?: string): Promise<WellKnownResponse>;
3
- export declare function getKey(sdk: OktaAuth, issuer: string, kid: string): Promise<string>;
1
+ import { OktaAuthInterface, WellKnownResponse } from '../../types';
2
+ export declare function getWellKnown(sdk: OktaAuthInterface, issuer?: string): Promise<WellKnownResponse>;
3
+ export declare function getKey(sdk: OktaAuthInterface, issuer: string, kid: string): Promise<string>;
@@ -10,5 +10,5 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  *
12
12
  */
13
- import { CustomUrls, OktaAuth, TokenParams, TokenResponse } from '../types';
14
- export declare function exchangeCodeForTokens(sdk: OktaAuth, tokenParams: TokenParams, urls?: CustomUrls): Promise<TokenResponse>;
13
+ import { CustomUrls, OktaAuthInterface, TokenParams, TokenResponse } from '../types';
14
+ export declare function exchangeCodeForTokens(sdk: OktaAuthInterface, tokenParams: TokenParams, urls?: CustomUrls): Promise<TokenResponse>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams, PopupParams } from '../types';
2
- export declare function getToken(sdk: OktaAuth, options: TokenParams & PopupParams): Promise<import("../types").TokenResponse>;
1
+ import { OktaAuthInterface, TokenParams, PopupParams } from '../types';
2
+ export declare function getToken(sdk: OktaAuthInterface, options: TokenParams & PopupParams): Promise<import("../types").TokenResponse>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams, TokenResponse } from '../types';
2
- export declare function getWithPopup(sdk: OktaAuth, options: TokenParams): Promise<TokenResponse>;
1
+ import { OktaAuthInterface, TokenParams, TokenResponse } from '../types';
2
+ export declare function getWithPopup(sdk: OktaAuthInterface, options: TokenParams): Promise<TokenResponse>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams } from '../types';
2
- export declare function getWithRedirect(sdk: OktaAuth, options?: TokenParams): Promise<void>;
1
+ import { OktaAuthInterface, TokenParams } from '../types';
2
+ export declare function getWithRedirect(sdk: OktaAuthInterface, options?: TokenParams): Promise<void>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams, TokenResponse } from '../types';
2
- export declare function getWithoutPrompt(sdk: OktaAuth, options: TokenParams): Promise<TokenResponse>;
1
+ import { OktaAuthInterface, TokenParams, TokenResponse } from '../types';
2
+ export declare function getWithoutPrompt(sdk: OktaAuthInterface, options: TokenParams): Promise<TokenResponse>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, OAuthResponse, TokenParams, TokenResponse, CustomUrls } from '../types';
2
- export declare function handleOAuthResponse(sdk: OktaAuth, tokenParams: TokenParams, res: OAuthResponse, urls?: CustomUrls): Promise<TokenResponse>;
1
+ import { OktaAuthInterface, OAuthResponse, TokenParams, TokenResponse, CustomUrls } from '../types';
2
+ export declare function handleOAuthResponse(sdk: OktaAuthInterface, tokenParams: TokenParams, res: OAuthResponse, urls?: CustomUrls): Promise<TokenResponse>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, Token } from '../types';
2
- export declare function renewToken(sdk: OktaAuth, token: Token): Promise<Token | undefined>;
1
+ import { OktaAuthInterface, Token } from '../types';
2
+ export declare function renewToken(sdk: OktaAuthInterface, token: Token): Promise<Token | undefined>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams, RefreshToken, Tokens } from '../types';
2
- export declare function renewTokensWithRefresh(sdk: OktaAuth, tokenParams: TokenParams, refreshTokenObject: RefreshToken): Promise<Tokens>;
1
+ import { OktaAuthInterface, TokenParams, RefreshToken, Tokens } from '../types';
2
+ export declare function renewTokensWithRefresh(sdk: OktaAuthInterface, tokenParams: TokenParams, refreshTokenObject: RefreshToken): Promise<Tokens>;
@@ -10,5 +10,5 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  *
12
12
  */
13
- import { OktaAuth, RevocableToken } from '../types';
14
- export declare function revokeToken(sdk: OktaAuth, token: RevocableToken): Promise<any>;
13
+ import { OktaAuthInterface, RevocableToken } from '../types';
14
+ export declare function revokeToken(sdk: OktaAuthInterface, token: RevocableToken): Promise<any>;
@@ -1,6 +1,6 @@
1
- import { OktaAuth } from '../../types';
1
+ import { OktaAuthInterface } from '../../types';
2
2
  export declare function addListener(eventTarget: any, name: any, fn: any): void;
3
3
  export declare function removeListener(eventTarget: any, name: any, fn: any): void;
4
4
  export declare function loadFrame(src: any): HTMLIFrameElement;
5
5
  export declare function loadPopup(src: any, options: any): Window | null;
6
- export declare function addPostMessageListener(sdk: OktaAuth, timeout: any, state: any): Promise<unknown>;
6
+ export declare function addPostMessageListener(sdk: OktaAuthInterface, timeout: any, state: any): Promise<unknown>;
@@ -1,2 +1,2 @@
1
- import { OktaAuth, TokenParams } from '../../types';
2
- export declare function getDefaultTokenParams(sdk: OktaAuth): TokenParams;
1
+ import { OktaAuthInterface, TokenParams } from '../../types';
2
+ export declare function getDefaultTokenParams(sdk: OktaAuthInterface): TokenParams;
@@ -9,6 +9,6 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import { OktaAuth } from '../../types';
12
+ import { OktaAuthInterface } from '../../types';
13
13
  export declare function isInteractionRequiredError(error: Error): boolean;
14
- export declare function isAuthorizationCodeError(sdk: OktaAuth, error: Error): boolean | undefined;
14
+ export declare function isAuthorizationCodeError(sdk: OktaAuthInterface, error: Error): boolean | undefined;
@@ -10,21 +10,21 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  *
12
12
  */
13
- import { OktaAuth, OktaAuthOptions } from '../../types';
13
+ import { OktaAuthInterface, OktaAuthOptions } from '../../types';
14
14
  export declare function hasTokensInHash(hash: string): boolean;
15
15
  export declare function hasAuthorizationCode(hashOrSearch: string): boolean;
16
16
  export declare function hasInteractionCode(hashOrSearch: string): boolean;
17
17
  export declare function hasErrorInUrl(hashOrSearch: string): boolean;
18
- export declare function isRedirectUri(uri: string, sdk: OktaAuth): boolean;
18
+ export declare function isRedirectUri(uri: string, sdk: OktaAuthInterface): boolean;
19
19
  export declare function isCodeFlow(options: OktaAuthOptions): boolean;
20
20
  export declare function getHashOrSearch(options: OktaAuthOptions): string;
21
21
  /**
22
22
  * Check if tokens or a code have been passed back into the url, which happens in
23
23
  * the OIDC (including social auth IDP) redirect flow.
24
24
  */
25
- export declare function isLoginRedirect(sdk: OktaAuth): boolean;
25
+ export declare function isLoginRedirect(sdk: OktaAuthInterface): boolean;
26
26
  /**
27
27
  * Check if error=interaction_required has been passed back in the url, which happens in
28
28
  * the social auth IDP redirect flow.
29
29
  */
30
- export declare function isInteractionRequired(sdk: OktaAuth, hashOrSearch?: string): boolean;
30
+ export declare function isInteractionRequired(sdk: OktaAuthInterface, hashOrSearch?: string): boolean;
@@ -1,6 +1,6 @@
1
- import { OktaAuth, CustomUrls } from '../../types';
1
+ import { OktaAuthInterface, CustomUrls } from '../../types';
2
2
  export declare function generateState(): string;
3
3
  export declare function generateNonce(): string;
4
- export declare function getOAuthBaseUrl(sdk: OktaAuth, options?: CustomUrls): any;
5
- export declare function getOAuthDomain(sdk: OktaAuth, options?: CustomUrls): any;
6
- export declare function getOAuthUrls(sdk: OktaAuth, options?: CustomUrls): CustomUrls;
4
+ export declare function getOAuthBaseUrl(sdk: OktaAuthInterface, options?: CustomUrls): any;
5
+ export declare function getOAuthDomain(sdk: OktaAuthInterface, options?: CustomUrls): any;
6
+ export declare function getOAuthUrls(sdk: OktaAuthInterface, options?: CustomUrls): CustomUrls;
@@ -1,2 +1,2 @@
1
- import { OAuthTransactionMeta, OktaAuth, PKCETransactionMeta, TokenParams } from '../../types';
2
- export declare function createOAuthMeta(sdk: OktaAuth, tokenParams: TokenParams): OAuthTransactionMeta | PKCETransactionMeta;
1
+ import { OAuthTransactionMeta, OktaAuthInterface, PKCETransactionMeta, TokenParams } from '../../types';
2
+ export declare function createOAuthMeta(sdk: OktaAuthInterface, tokenParams: TokenParams): OAuthTransactionMeta | PKCETransactionMeta;
@@ -1,5 +1,5 @@
1
- import { OktaAuth, TokenParams } from '../../types';
2
- export declare function assertPKCESupport(sdk: OktaAuth): void;
3
- export declare function validateCodeChallengeMethod(sdk: OktaAuth, codeChallengeMethod?: string): Promise<string>;
4
- export declare function preparePKCE(sdk: OktaAuth, tokenParams: TokenParams): Promise<TokenParams>;
5
- export declare function prepareTokenParams(sdk: OktaAuth, tokenParams?: TokenParams): Promise<TokenParams>;
1
+ import { OktaAuthInterface, TokenParams } from '../../types';
2
+ export declare function assertPKCESupport(sdk: OktaAuthInterface): void;
3
+ export declare function validateCodeChallengeMethod(sdk: OktaAuthInterface, codeChallengeMethod?: string): Promise<string>;
4
+ export declare function preparePKCE(sdk: OktaAuthInterface, tokenParams: TokenParams): Promise<TokenParams>;
5
+ export declare function prepareTokenParams(sdk: OktaAuthInterface, tokenParams?: TokenParams): Promise<TokenParams>;
@@ -10,5 +10,5 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  *
12
12
  */
13
- import { OktaAuth, TokenVerifyParams, UserClaims } from '../../types';
14
- export declare function validateClaims(sdk: OktaAuth, claims: UserClaims, validationParams: TokenVerifyParams): void;
13
+ import { OktaAuthInterface, TokenVerifyParams, UserClaims } from '../../types';
14
+ export declare function validateClaims(sdk: OktaAuthInterface, claims: UserClaims, validationParams: TokenVerifyParams): void;
@@ -1,2 +1,2 @@
1
- import { IDToken, OktaAuth, TokenVerifyParams } from '../types';
2
- export declare function verifyToken(sdk: OktaAuth, token: IDToken, validationParams: TokenVerifyParams): Promise<IDToken>;
1
+ import { IDToken, OktaAuthInterface, TokenVerifyParams } from '../types';
2
+ export declare function verifyToken(sdk: OktaAuthInterface, token: IDToken, validationParams: TokenVerifyParams): Promise<IDToken>;
@@ -0,0 +1,16 @@
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 { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';
13
+ export declare function getStorage(): StorageUtil;
14
+ export declare const STORAGE_MANAGER_OPTIONS: StorageManagerOptions;
15
+ export declare const enableSharedStorage = true;
16
+ export declare function getCookieSettings(args: OktaAuthOptions | undefined, isHTTPS: boolean): import("../types").CookieOptions;
@@ -0,0 +1,14 @@
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 { OktaAuthOptions } from '../types';
13
+ export declare function getDefaultOptions(): OktaAuthOptions;
14
+ export declare function buildOptions(args?: OktaAuthOptions): OktaAuthOptions;
@@ -0,0 +1,16 @@
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 { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';
13
+ export declare function getStorage(): StorageUtil;
14
+ export declare const STORAGE_MANAGER_OPTIONS: StorageManagerOptions;
15
+ export declare const enableSharedStorage = false;
16
+ export declare function getCookieSettings(args?: OktaAuthOptions, isHTTPS?: boolean): import("../types").CookieOptions | undefined;
@@ -0,0 +1,27 @@
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 { TokenManager } from '../TokenManager';
13
+ import { ServiceInterface, ServiceManagerOptions } from '../types';
14
+ export declare class AutoRenewService implements ServiceInterface {
15
+ private tokenManager;
16
+ private options;
17
+ private renewTimeQueue;
18
+ private started;
19
+ constructor(tokenManager: TokenManager, options?: ServiceManagerOptions);
20
+ private shouldThrottleRenew;
21
+ requiresLeadership(): boolean;
22
+ private onTokenExpiredHandler;
23
+ canStart(): boolean;
24
+ start(): void;
25
+ stop(): void;
26
+ isStarted(): boolean;
27
+ }
@@ -10,14 +10,17 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  import { TokenManager } from '../TokenManager';
13
- import { TokenManagerOptions } from '../types';
14
- export declare class TokenService {
13
+ import { ServiceManagerOptions, ServiceInterface } from '../types';
14
+ export declare class SyncStorageService implements ServiceInterface {
15
15
  private tokenManager;
16
16
  private options;
17
- private storageListener?;
18
- private onTokenExpiredHandler?;
19
17
  private syncTimeout;
20
- constructor(tokenManager: TokenManager, options?: TokenManagerOptions);
18
+ private started;
19
+ constructor(tokenManager: TokenManager, options?: ServiceManagerOptions);
20
+ private storageListener;
21
+ requiresLeadership(): boolean;
22
+ isStarted(): boolean;
23
+ canStart(): boolean;
21
24
  start(): void;
22
25
  stop(): void;
23
26
  }
@@ -0,0 +1,13 @@
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 './AutoRenewService';
13
+ export * from './SyncStorageService';
@@ -9,14 +9,17 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import { StorageManagerOptions, StorageUtil } from './Storage';
12
+ import { StorageManagerOptions, StorageUtil, SimpleStorage } from './Storage';
13
13
  import { CookieOptions } from './Cookies';
14
14
  import { HttpRequestClient } from './http';
15
15
  import { AuthState } from './AuthState';
16
16
  import { TransactionManagerOptions } from './Transaction';
17
- import { SimpleStorage } from './Storage';
18
17
  import { FlowIdentifier } from '../idx/types';
18
+ import { ServiceManagerOptions } from './Service';
19
19
  import OktaAuth from '../OktaAuth';
20
+ export interface IsAuthenticatedOptions {
21
+ onExpiredToken?: 'renew' | 'remove' | 'none';
22
+ }
20
23
  export interface TokenManagerOptions {
21
24
  autoRenew?: boolean;
22
25
  autoRemove?: boolean;
@@ -60,6 +63,7 @@ export interface OktaAuthOptions extends CustomUrls {
60
63
  restoreOriginalUri?: (oktaAuth: OktaAuth, originalUri?: string) => Promise<void>;
61
64
  devMode?: boolean;
62
65
  storageManager?: StorageManagerOptions;
66
+ services?: ServiceManagerOptions;
63
67
  transactionManager?: TransactionManagerOptions;
64
68
  flow?: FlowIdentifier;
65
69
  codeChallenge?: string;
@@ -0,0 +1,23 @@
1
+ export interface ServiceManagerInterface {
2
+ isLeader(): boolean;
3
+ start(): void;
4
+ stop(): void;
5
+ getService(name: string): ServiceInterface | undefined;
6
+ }
7
+ export interface ServiceInterface {
8
+ start(): void;
9
+ stop(): void;
10
+ isStarted(): boolean;
11
+ canStart(): boolean;
12
+ requiresLeadership(): boolean;
13
+ }
14
+ export interface AutoRenewServiceOptions {
15
+ autoRenew?: boolean;
16
+ autoRemove?: boolean;
17
+ }
18
+ export interface SyncStorageServiceOptions {
19
+ syncStorage?: boolean;
20
+ }
21
+ export declare type ServiceManagerOptions = AutoRenewServiceOptions & SyncStorageServiceOptions & {
22
+ broadcastChannelName?: string;
23
+ };
@@ -40,9 +40,13 @@ export interface TransactionStorage extends StorageProvider {
40
40
  setStorage(obj: TransactionMeta): void;
41
41
  getStorage(): TransactionMeta;
42
42
  }
43
+ export interface SavedIdxResponse {
44
+ rawIdxResponse: RawIdxResponse;
45
+ requestDidSucceed?: boolean;
46
+ }
43
47
  export interface IdxResponseStorage extends StorageProvider {
44
- setStorage(obj: RawIdxResponse): void;
45
- getStorage(): RawIdxResponse;
48
+ setStorage(obj: SavedIdxResponse): void;
49
+ getStorage(): SavedIdxResponse;
46
50
  }
47
51
  export interface StorageOptions extends CookieOptions {
48
52
  storageType?: StorageType;
@@ -68,9 +72,7 @@ export interface BrowserStorageUtil extends StorageUtil {
68
72
  getCookieStorage(options?: StorageOptions): CookieStorage;
69
73
  testStorage(storage: any): boolean;
70
74
  storage: Cookies;
71
- inMemoryStore: {
72
- string?: string;
73
- };
75
+ inMemoryStore: Record<string, unknown>;
74
76
  getHttpCache(options?: StorageOptions): StorageProvider;
75
77
  getPKCEStorage(options?: StorageOptions): PKCEStorage;
76
78
  }
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import StorageManager from '../StorageManager';
12
+ import { StorageManager } from '../StorageManager';
13
13
  import { CustomUrls } from './OktaAuthOptions';
14
- import { FlowIdentifier } from '../idx/types';
14
+ import { FlowIdentifier, IdxTransactionMeta } from '../idx/types';
15
15
  export interface TransactionManagerOptions {
16
16
  storageManager?: StorageManager;
17
17
  enableSharedStorage?: boolean;
@@ -51,14 +51,6 @@ export interface PKCETransactionMeta extends OAuthTransactionMeta {
51
51
  codeChallengeMethod: string;
52
52
  codeChallenge: string;
53
53
  }
54
- export interface IdxTransactionMeta extends PKCETransactionMeta {
55
- interactionHandle?: string;
56
- remediations?: string[];
57
- flow?: FlowIdentifier;
58
- withCredentials?: boolean;
59
- activationToken?: string;
60
- recoveryToken?: string;
61
- }
62
54
  export declare type CustomAuthTransactionMeta = Record<string, string | undefined>;
63
55
  export declare type TransactionMeta = IdxTransactionMeta | PKCETransactionMeta | OAuthTransactionMeta | CustomAuthTransactionMeta;
64
56
  export declare function isOAuthTransactionMeta(obj: any): obj is OAuthTransactionMeta;