@okta/okta-auth-js 5.4.3 → 5.8.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 (202) hide show
  1. package/CHANGELOG.md +59 -4
  2. package/README.md +66 -977
  3. package/cjs/AuthStateManager.js +5 -0
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +74 -29
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/StorageManager.js +16 -0
  9. package/cjs/StorageManager.js.map +1 -1
  10. package/cjs/TransactionManager.js +44 -8
  11. package/cjs/TransactionManager.js.map +1 -1
  12. package/cjs/browser/browserStorage.js +5 -5
  13. package/cjs/browser/browserStorage.js.map +1 -1
  14. package/cjs/builderUtil.js +6 -0
  15. package/cjs/builderUtil.js.map +1 -1
  16. package/cjs/constants.js +5 -1
  17. package/cjs/constants.js.map +1 -1
  18. package/cjs/fetch/fetchRequest.js +10 -3
  19. package/cjs/fetch/fetchRequest.js.map +1 -1
  20. package/cjs/http/request.js +4 -0
  21. package/cjs/http/request.js.map +1 -1
  22. package/cjs/idx/interact.js +5 -2
  23. package/cjs/idx/interact.js.map +1 -1
  24. package/cjs/idx/introspect.js +24 -7
  25. package/cjs/idx/introspect.js.map +1 -1
  26. package/cjs/idx/remediate.js +35 -41
  27. package/cjs/idx/remediate.js.map +1 -1
  28. package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -7
  29. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  30. package/cjs/idx/remediators/Base/Remediator.js +13 -7
  31. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  32. package/cjs/idx/remediators/Base/SelectAuthenticator.js +6 -6
  33. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  34. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +18 -14
  35. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  36. package/cjs/idx/remediators/EnrollProfile.js +14 -0
  37. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  38. package/cjs/idx/remediators/Identify.js +5 -2
  39. package/cjs/idx/remediators/Identify.js.map +1 -1
  40. package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -1
  41. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  42. package/cjs/idx/run.js +28 -6
  43. package/cjs/idx/run.js.map +1 -1
  44. package/cjs/idx/transactionMeta.js +24 -9
  45. package/cjs/idx/transactionMeta.js.map +1 -1
  46. package/cjs/idx/types/idx-js.js +5 -0
  47. package/cjs/idx/types/idx-js.js.map +1 -1
  48. package/cjs/idx/types/index.js +17 -6
  49. package/cjs/idx/types/index.js.map +1 -1
  50. package/cjs/oidc/getToken.js +14 -9
  51. package/cjs/oidc/getToken.js.map +1 -1
  52. package/cjs/oidc/getWithPopup.js +9 -2
  53. package/cjs/oidc/getWithPopup.js.map +1 -1
  54. package/cjs/oidc/getWithRedirect.js.map +1 -1
  55. package/cjs/oidc/parseFromUrl.js +59 -20
  56. package/cjs/oidc/parseFromUrl.js.map +1 -1
  57. package/cjs/oidc/renewTokens.js +28 -5
  58. package/cjs/oidc/renewTokens.js.map +1 -1
  59. package/cjs/oidc/util/browser.js +1 -13
  60. package/cjs/oidc/util/browser.js.map +1 -1
  61. package/cjs/oidc/util/loginRedirect.js +9 -5
  62. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  63. package/cjs/oidc/util/urlParams.js +1 -1
  64. package/cjs/oidc/util/urlParams.js.map +1 -1
  65. package/cjs/oidc/util/validateClaims.js +8 -6
  66. package/cjs/oidc/util/validateClaims.js.map +1 -1
  67. package/cjs/options.js +15 -2
  68. package/cjs/options.js.map +1 -1
  69. package/cjs/server/serverStorage.js +2 -1
  70. package/cjs/server/serverStorage.js.map +1 -1
  71. package/cjs/tx/AuthTransaction.js +1 -3
  72. package/cjs/tx/AuthTransaction.js.map +1 -1
  73. package/cjs/tx/api.js +3 -0
  74. package/cjs/tx/api.js.map +1 -1
  75. package/cjs/types/Transaction.js.map +1 -1
  76. package/cjs/util/emailVerify.js +28 -0
  77. package/cjs/util/emailVerify.js.map +1 -0
  78. package/cjs/util/index.js +13 -0
  79. package/cjs/util/index.js.map +1 -1
  80. package/cjs/util/sharedStorage.js +54 -0
  81. package/cjs/util/sharedStorage.js.map +1 -0
  82. package/dist/okta-auth-js.min.js +2 -74
  83. package/dist/okta-auth-js.min.js.LICENSE.txt +32 -0
  84. package/dist/okta-auth-js.min.js.map +1 -1
  85. package/dist/okta-auth-js.polyfill.js +2 -18
  86. package/dist/okta-auth-js.polyfill.js.LICENSE.txt +18 -0
  87. package/dist/okta-auth-js.polyfill.js.map +1 -1
  88. package/dist/okta-auth-js.umd.js +2 -74
  89. package/dist/okta-auth-js.umd.js.LICENSE.txt +32 -0
  90. package/dist/okta-auth-js.umd.js.map +1 -1
  91. package/esm/AuthStateManager.js +5 -0
  92. package/esm/AuthStateManager.js.map +1 -1
  93. package/esm/OktaAuth.js +75 -31
  94. package/esm/OktaAuth.js.map +1 -1
  95. package/esm/OktaUserAgent.js +2 -2
  96. package/esm/StorageManager.js +17 -1
  97. package/esm/StorageManager.js.map +1 -1
  98. package/esm/TransactionManager.js +43 -8
  99. package/esm/TransactionManager.js.map +1 -1
  100. package/esm/browser/browserStorage.js +5 -5
  101. package/esm/browser/browserStorage.js.map +1 -1
  102. package/esm/builderUtil.js +6 -0
  103. package/esm/builderUtil.js.map +1 -1
  104. package/esm/constants.js +2 -0
  105. package/esm/constants.js.map +1 -1
  106. package/esm/fetch/fetchRequest.js +10 -3
  107. package/esm/fetch/fetchRequest.js.map +1 -1
  108. package/esm/http/request.js +4 -0
  109. package/esm/http/request.js.map +1 -1
  110. package/esm/idx/interact.js +5 -2
  111. package/esm/idx/interact.js.map +1 -1
  112. package/esm/idx/introspect.js +22 -6
  113. package/esm/idx/introspect.js.map +1 -1
  114. package/esm/idx/remediate.js +36 -37
  115. package/esm/idx/remediate.js.map +1 -1
  116. package/esm/idx/remediators/Base/AuthenticatorData.js +7 -7
  117. package/esm/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  118. package/esm/idx/remediators/Base/Remediator.js +13 -8
  119. package/esm/idx/remediators/Base/Remediator.js.map +1 -1
  120. package/esm/idx/remediators/Base/SelectAuthenticator.js +6 -6
  121. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  122. package/esm/idx/remediators/Base/VerifyAuthenticator.js +18 -15
  123. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  124. package/esm/idx/remediators/EnrollProfile.js +21 -4
  125. package/esm/idx/remediators/EnrollProfile.js.map +1 -1
  126. package/esm/idx/remediators/Identify.js +4 -2
  127. package/esm/idx/remediators/Identify.js.map +1 -1
  128. package/esm/idx/remediators/ReEnrollAuthenticator.js +1 -1
  129. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  130. package/esm/idx/run.js +27 -6
  131. package/esm/idx/run.js.map +1 -1
  132. package/esm/idx/transactionMeta.js +23 -10
  133. package/esm/idx/transactionMeta.js.map +1 -1
  134. package/esm/idx/types/idx-js.js +3 -0
  135. package/esm/idx/types/idx-js.js.map +1 -1
  136. package/esm/idx/types/index.js +15 -5
  137. package/esm/idx/types/index.js.map +1 -1
  138. package/esm/oidc/getToken.js +15 -10
  139. package/esm/oidc/getToken.js.map +1 -1
  140. package/esm/oidc/getWithPopup.js +8 -2
  141. package/esm/oidc/getWithPopup.js.map +1 -1
  142. package/esm/oidc/getWithRedirect.js.map +1 -1
  143. package/esm/oidc/parseFromUrl.js +59 -17
  144. package/esm/oidc/parseFromUrl.js.map +1 -1
  145. package/esm/oidc/renewTokens.js +27 -5
  146. package/esm/oidc/renewTokens.js.map +1 -1
  147. package/esm/oidc/util/browser.js +1 -12
  148. package/esm/oidc/util/browser.js.map +1 -1
  149. package/esm/oidc/util/loginRedirect.js +9 -5
  150. package/esm/oidc/util/loginRedirect.js.map +1 -1
  151. package/esm/oidc/util/urlParams.js +1 -1
  152. package/esm/oidc/util/urlParams.js.map +1 -1
  153. package/esm/oidc/util/validateClaims.js +8 -6
  154. package/esm/oidc/util/validateClaims.js.map +1 -1
  155. package/esm/options.js +15 -2
  156. package/esm/options.js.map +1 -1
  157. package/esm/server/serverStorage.js +2 -1
  158. package/esm/server/serverStorage.js.map +1 -1
  159. package/esm/tx/AuthTransaction.js +1 -3
  160. package/esm/tx/AuthTransaction.js.map +1 -1
  161. package/esm/tx/api.js +3 -0
  162. package/esm/tx/api.js.map +1 -1
  163. package/esm/types/Transaction.js.map +1 -1
  164. package/esm/util/emailVerify.js +21 -0
  165. package/esm/util/emailVerify.js.map +1 -0
  166. package/esm/util/index.js +1 -0
  167. package/esm/util/index.js.map +1 -1
  168. package/esm/util/sharedStorage.js +43 -0
  169. package/esm/util/sharedStorage.js.map +1 -0
  170. package/lib/AuthStateManager.d.ts +4 -2
  171. package/lib/OktaAuth.d.ts +9 -5
  172. package/lib/StorageManager.d.ts +2 -0
  173. package/lib/TransactionManager.d.ts +5 -1
  174. package/lib/constants.d.ts +2 -0
  175. package/lib/crypto/base64.d.ts +2 -2
  176. package/lib/crypto/oidcHash.d.ts +1 -1
  177. package/lib/crypto/verifyToken.d.ts +1 -1
  178. package/lib/idx/introspect.d.ts +2 -1
  179. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +2 -5
  180. package/lib/idx/remediators/Base/Remediator.d.ts +3 -6
  181. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +3 -6
  182. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +1 -1
  183. package/lib/idx/remediators/EnrollProfile.d.ts +1 -0
  184. package/lib/idx/remediators/Identify.d.ts +1 -5
  185. package/lib/idx/run.d.ts +1 -0
  186. package/lib/idx/transactionMeta.d.ts +4 -3
  187. package/lib/idx/types/idx-js.d.ts +2 -0
  188. package/lib/idx/types/index.d.ts +20 -9
  189. package/lib/oidc/getToken.d.ts +2 -2
  190. package/lib/oidc/parseFromUrl.d.ts +4 -1
  191. package/lib/oidc/renewTokens.d.ts +0 -12
  192. package/lib/oidc/util/loginRedirect.d.ts +1 -1
  193. package/lib/types/AuthState.d.ts +1 -0
  194. package/lib/types/OktaAuthOptions.d.ts +2 -1
  195. package/lib/types/Storage.d.ts +3 -0
  196. package/lib/types/Transaction.d.ts +5 -1
  197. package/lib/types/api.d.ts +9 -4
  198. package/lib/types/http.d.ts +1 -0
  199. package/lib/util/emailVerify.d.ts +17 -0
  200. package/lib/util/index.d.ts +1 -0
  201. package/lib/util/sharedStorage.d.ts +6 -0
  202. package/package.json +12 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.8.0
4
+
5
+ ### Features
6
+
7
+ - [#990](https://github.com/okta/okta-auth-js/pull/990) Supports email verify callback
8
+
9
+ ## 5.7.0
10
+
11
+ ### Features
12
+
13
+ - [#983](https://github.com/okta/okta-auth-js/pull/983) Adds new method `setHeaders`
14
+ - [#990](https://github.com/okta/okta-auth-js/pull/990) Supports email verify callback
15
+
16
+ ### Fixes
17
+
18
+ - [#988](https://github.com/okta/okta-auth-js/pull/988) Fixes Safari & Firefox browsers block `getWithPopup` issue
19
+ - [#995](https://github.com/okta/okta-auth-js/pull/995) Sends cookie for `authn` related requests
20
+ - [#985](https://github.com/okta/okta-auth-js/pull/985) Fixes issue with renewTokens that would drop scopes passed to `getToken`
21
+
22
+ ### Other
23
+
24
+ - [#981](https://github.com/okta/okta-auth-js/pull/981) TypeScript: Allows optional paramters for IDX methods
25
+ - [#986](https://github.com/okta/okta-auth-js/pull/986) TypeScript: Interface `SignInWithRedirectOptions` should extend `TokenParams`
26
+ - [#992](https://github.com/okta/okta-auth-js/pull/992) TypeScript: Adds fields for `Input` type in NextStep object
27
+ - [#997](https://github.com/okta/okta-auth-js/pull/997) Validates `scopes` config param is an `array`
28
+
29
+ ## 5.6.0
30
+
31
+ ### Features
32
+
33
+ - [#963](https://github.com/okta/okta-auth-js/pull/963)
34
+ - Adds `getPreviousAuthState` method to `AuthStateManager`
35
+ - Allows null type for authState related methods / fields
36
+ - [#948](https://github.com/okta/okta-auth-js/pull/948) Adds `Google Authenticator` support in idx module
37
+
38
+ ### Other
39
+
40
+ - [#947](https://github.com/okta/okta-auth-js/pull/947) TypeScript: Allow custom keys in `AuthState` interface
41
+
42
+ ### Bug Fixes
43
+
44
+ - [#967](https://github.com/okta/okta-auth-js/pull/967) Throw error in `parseFromUrl` if can't load transaction meta
45
+
46
+ ## 5.5.0
47
+
48
+ ### Features
49
+
50
+ - [#933](https://github.com/okta/okta-auth-js/pull/933) Adds `ignoreLifetime` option to disable token lifetime validation
51
+ - [#932](https://github.com/okta/okta-auth-js/pull/932) Adds `headers` with response headers to all responses
52
+
53
+ ### Bug Fixes
54
+
55
+ - [#936](https://github.com/okta/okta-auth-js/pull/936) Fixes getting mutiple memory storages issue in browser environment
56
+
57
+
3
58
  ## 5.4.3
4
59
 
5
60
  ### Bug Fixes
@@ -312,7 +367,7 @@
312
367
  - `autoRemove`
313
368
  - `devMode`
314
369
  - [#469](https://github.com/okta/okta-auth-js/pull/469) Adds "rate limiting" logic to token autoRenew process to prevent too many requests be sent out which may cause application rate limit issue.
315
- - [#503](https://github.com/okta/okta-auth-js/pull/503) Supports relative uri for [options.redirectUri](README.md#additional-options)
370
+ - [#503](https://github.com/okta/okta-auth-js/pull/503) Supports relative uri for [options.redirectUri](README.md#configuration-options)
316
371
  - [#478](https://github.com/okta/okta-auth-js/pull/478) Adds cross tabs communication to sync `AuthState`.
317
372
  - [#525](https://github.com/okta/okta-auth-js/pull/525) Adds new methods `hasResponseType`, `isPKCE`, `isAuthorizationCodeFlow`. The option `responseType` is now accepted in the constructor.
318
373
 
@@ -352,7 +407,7 @@
352
407
 
353
408
  - [#444](https://github.com/okta/okta-auth-js/pull/444)
354
409
  - Implements "active" autoRenew. Previously tokens would be renewed or removed when calling `tokenManager.get`. Now they will be renewed or removed in the background. If autoRenew is true, tokens will be renewed before expiration. If autoRenew is false, tokens will be removed from storage on expiration.
355
- - `onSessionExpired` option has been removed. [TokenManager events](#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.
410
+ - `onSessionExpired` option has been removed. [TokenManager events](README.md#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.
356
411
  - `tokenManager.get` no longer implements autoRenew functionality (autoRenew is done by a separate process within `TokenManager`). Even with `autoRenew`, it is possible that the token returned from the TokenManager may be expired, since renewal is an asynchronous process. New method `tokenManager.hasExpired` can be used to test the token and avoid this potential race condition.
357
412
 
358
413
  ## 3.2.6
@@ -451,7 +506,7 @@
451
506
 
452
507
  ### Features
453
508
 
454
- New [option](README.md#additional-options) `cookies` allows overriding default `secure` and `sameSite` values.
509
+ New [option](README.md#configuration-options) `cookies` allows overriding default `secure` and `sameSite` values.
455
510
 
456
511
  ### Breaking Changes
457
512
 
@@ -471,7 +526,7 @@ New [option](README.md#additional-options) `cookies` allows overriding default `
471
526
 
472
527
  - [#316](https://github.com/okta/okta-auth-js/pull/316) - Option `issuer` is [required](README.md#configuration-reference). Option `url` has been deprecated and is no longer used.
473
528
 
474
- - [#317](https://github.com/okta/okta-auth-js/pull/317) - `pkce` [option](README.md#additional-options) is now `true` by default. `grantType` option is removed.
529
+ - [#317](https://github.com/okta/okta-auth-js/pull/317) - `pkce` [option](README.md#configuration-options) is now `true` by default. `grantType` option is removed.
475
530
 
476
531
  - [#320](https://github.com/okta/okta-auth-js/pull/320) - `getWithRedirect`, `getWithPopup`, and `getWithoutPrompt` previously took 2 sets of option objects as parameters, a set of "oauthOptions" and additional options. These methods now take a single options object which can hold all [available options](README.md#authorize-options). Passing a second options object will cause an exception to be thrown.
477
532