@okta/okta-auth-js 5.4.2 → 5.7.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 (161) hide show
  1. package/CHANGELOG.md +60 -5
  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 +32 -11
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/StorageManager.js +8 -0
  9. package/cjs/StorageManager.js.map +1 -1
  10. package/cjs/TransactionManager.js +32 -4
  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 +3 -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/remediate.js +33 -23
  23. package/cjs/idx/remediate.js.map +1 -1
  24. package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -7
  25. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  26. package/cjs/idx/remediators/Base/Remediator.js +13 -7
  27. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  28. package/cjs/idx/remediators/Base/SelectAuthenticator.js +6 -6
  29. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  30. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +18 -14
  31. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  32. package/cjs/idx/remediators/EnrollProfile.js +14 -0
  33. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  34. package/cjs/idx/remediators/Identify.js +5 -2
  35. package/cjs/idx/remediators/Identify.js.map +1 -1
  36. package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -1
  37. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  38. package/cjs/idx/transactionMeta.js +3 -1
  39. package/cjs/idx/transactionMeta.js.map +1 -1
  40. package/cjs/idx/types/idx-js.js.map +1 -1
  41. package/cjs/idx/types/index.js +17 -6
  42. package/cjs/idx/types/index.js.map +1 -1
  43. package/cjs/index.js +6 -6
  44. package/cjs/index.js.map +1 -1
  45. package/cjs/oidc/getToken.js +14 -9
  46. package/cjs/oidc/getToken.js.map +1 -1
  47. package/cjs/oidc/getWithPopup.js +9 -2
  48. package/cjs/oidc/getWithPopup.js.map +1 -1
  49. package/cjs/oidc/getWithRedirect.js +6 -2
  50. package/cjs/oidc/getWithRedirect.js.map +1 -1
  51. package/cjs/oidc/parseFromUrl.js +59 -20
  52. package/cjs/oidc/parseFromUrl.js.map +1 -1
  53. package/cjs/oidc/renewTokens.js +28 -5
  54. package/cjs/oidc/renewTokens.js.map +1 -1
  55. package/cjs/oidc/util/browser.js +1 -13
  56. package/cjs/oidc/util/browser.js.map +1 -1
  57. package/cjs/oidc/util/validateClaims.js +8 -6
  58. package/cjs/oidc/util/validateClaims.js.map +1 -1
  59. package/cjs/options.js +3 -0
  60. package/cjs/options.js.map +1 -1
  61. package/cjs/tx/AuthTransaction.js +1 -3
  62. package/cjs/tx/AuthTransaction.js.map +1 -1
  63. package/cjs/tx/api.js +3 -0
  64. package/cjs/tx/api.js.map +1 -1
  65. package/cjs/types/Transaction.js.map +1 -1
  66. package/cjs/util/sharedStorage.js +54 -0
  67. package/cjs/util/sharedStorage.js.map +1 -0
  68. package/dist/okta-auth-js.min.js +8 -8
  69. package/dist/okta-auth-js.min.js.map +1 -1
  70. package/dist/okta-auth-js.umd.js +8 -8
  71. package/dist/okta-auth-js.umd.js.map +1 -1
  72. package/esm/AuthStateManager.js +5 -0
  73. package/esm/AuthStateManager.js.map +1 -1
  74. package/esm/OktaAuth.js +32 -12
  75. package/esm/OktaAuth.js.map +1 -1
  76. package/esm/OktaUserAgent.js +2 -2
  77. package/esm/StorageManager.js +9 -1
  78. package/esm/StorageManager.js.map +1 -1
  79. package/esm/TransactionManager.js +31 -4
  80. package/esm/TransactionManager.js.map +1 -1
  81. package/esm/browser/browserStorage.js +5 -5
  82. package/esm/browser/browserStorage.js.map +1 -1
  83. package/esm/builderUtil.js +6 -0
  84. package/esm/builderUtil.js.map +1 -1
  85. package/esm/constants.js +1 -0
  86. package/esm/constants.js.map +1 -1
  87. package/esm/fetch/fetchRequest.js +10 -3
  88. package/esm/fetch/fetchRequest.js.map +1 -1
  89. package/esm/http/request.js +4 -0
  90. package/esm/http/request.js.map +1 -1
  91. package/esm/idx/remediate.js +41 -29
  92. package/esm/idx/remediate.js.map +1 -1
  93. package/esm/idx/remediators/Base/AuthenticatorData.js +7 -7
  94. package/esm/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  95. package/esm/idx/remediators/Base/Remediator.js +13 -8
  96. package/esm/idx/remediators/Base/Remediator.js.map +1 -1
  97. package/esm/idx/remediators/Base/SelectAuthenticator.js +6 -6
  98. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  99. package/esm/idx/remediators/Base/VerifyAuthenticator.js +18 -15
  100. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  101. package/esm/idx/remediators/EnrollProfile.js +21 -4
  102. package/esm/idx/remediators/EnrollProfile.js.map +1 -1
  103. package/esm/idx/remediators/Identify.js +4 -2
  104. package/esm/idx/remediators/Identify.js.map +1 -1
  105. package/esm/idx/remediators/ReEnrollAuthenticator.js +1 -1
  106. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  107. package/esm/idx/transactionMeta.js +3 -1
  108. package/esm/idx/transactionMeta.js.map +1 -1
  109. package/esm/idx/types/idx-js.js.map +1 -1
  110. package/esm/idx/types/index.js +15 -5
  111. package/esm/idx/types/index.js.map +1 -1
  112. package/esm/index.js +2 -2
  113. package/esm/index.js.map +1 -1
  114. package/esm/oidc/getToken.js +15 -10
  115. package/esm/oidc/getToken.js.map +1 -1
  116. package/esm/oidc/getWithPopup.js +8 -2
  117. package/esm/oidc/getWithPopup.js.map +1 -1
  118. package/esm/oidc/getWithRedirect.js +6 -2
  119. package/esm/oidc/getWithRedirect.js.map +1 -1
  120. package/esm/oidc/parseFromUrl.js +59 -17
  121. package/esm/oidc/parseFromUrl.js.map +1 -1
  122. package/esm/oidc/renewTokens.js +27 -5
  123. package/esm/oidc/renewTokens.js.map +1 -1
  124. package/esm/oidc/util/browser.js +1 -12
  125. package/esm/oidc/util/browser.js.map +1 -1
  126. package/esm/oidc/util/validateClaims.js +8 -6
  127. package/esm/oidc/util/validateClaims.js.map +1 -1
  128. package/esm/options.js +3 -0
  129. package/esm/options.js.map +1 -1
  130. package/esm/tx/AuthTransaction.js +1 -3
  131. package/esm/tx/AuthTransaction.js.map +1 -1
  132. package/esm/tx/api.js +3 -0
  133. package/esm/tx/api.js.map +1 -1
  134. package/esm/types/Transaction.js.map +1 -1
  135. package/esm/util/sharedStorage.js +43 -0
  136. package/esm/util/sharedStorage.js.map +1 -0
  137. package/lib/AuthStateManager.d.ts +4 -2
  138. package/lib/OktaAuth.d.ts +3 -2
  139. package/lib/StorageManager.d.ts +1 -0
  140. package/lib/TransactionManager.d.ts +1 -0
  141. package/lib/constants.d.ts +1 -0
  142. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +2 -5
  143. package/lib/idx/remediators/Base/Remediator.d.ts +3 -6
  144. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +3 -6
  145. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +1 -1
  146. package/lib/idx/remediators/EnrollProfile.d.ts +1 -0
  147. package/lib/idx/remediators/Identify.d.ts +1 -5
  148. package/lib/idx/types/idx-js.d.ts +1 -0
  149. package/lib/idx/types/index.d.ts +19 -9
  150. package/lib/index.d.ts +2 -1
  151. package/lib/oidc/getToken.d.ts +2 -2
  152. package/lib/oidc/parseFromUrl.d.ts +4 -1
  153. package/lib/oidc/renewTokens.d.ts +0 -12
  154. package/lib/types/AuthState.d.ts +1 -0
  155. package/lib/types/OktaAuthOptions.d.ts +2 -1
  156. package/lib/types/Storage.d.ts +3 -0
  157. package/lib/types/Transaction.d.ts +5 -1
  158. package/lib/types/api.d.ts +9 -4
  159. package/lib/types/http.d.ts +1 -0
  160. package/lib/util/sharedStorage.d.ts +6 -0
  161. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.7.0
4
+
5
+ ### Features
6
+
7
+ - [#983](https://github.com/okta/okta-auth-js/pull/983) Adds new method `setHeaders`
8
+
9
+ ### Fixes
10
+
11
+ - [#988](https://github.com/okta/okta-auth-js/pull/988) Fixes Safari & Firefox browsers block `getWithPopup` issue
12
+ - [#995](https://github.com/okta/okta-auth-js/pull/995) Sends cookie for `authn` related requests
13
+
14
+ ### Other
15
+
16
+ - [#981](https://github.com/okta/okta-auth-js/pull/981) TypeScript: Allows optional paramters for IDX methods
17
+ - [#986](https://github.com/okta/okta-auth-js/pull/986) TypeScript: Interface `SignInWithRedirectOptions` should extend `TokenParams`
18
+ - [#992](https://github.com/okta/okta-auth-js/pull/992) TypeScript: Adds fields for `Input` type in NextStep object
19
+ - [#997](https://github.com/okta/okta-auth-js/pull/997) Validates `scopes` config param is an `array`
20
+
21
+ ## 5.6.0
22
+
23
+ ### Features
24
+
25
+ - [#963](https://github.com/okta/okta-auth-js/pull/963)
26
+ - Adds `getPreviousAuthState` method to `AuthStateManager`
27
+ - Allows null type for authState related methods / fields
28
+ - [#948](https://github.com/okta/okta-auth-js/pull/948) Adds `Google Authenticator` support in idx module
29
+
30
+ ### Other
31
+
32
+ - [#947](https://github.com/okta/okta-auth-js/pull/947) TypeScript: Allow custom keys in `AuthState` interface
33
+
34
+ ### Bug Fixes
35
+
36
+ - [#967](https://github.com/okta/okta-auth-js/pull/967) Throw error in `parseFromUrl` if can't load transaction meta
37
+
38
+ ## 5.5.0
39
+
40
+ ### Features
41
+
42
+ - [#933](https://github.com/okta/okta-auth-js/pull/933) Adds `ignoreLifetime` option to disable token lifetime validation
43
+ - [#932](https://github.com/okta/okta-auth-js/pull/932) Adds `headers` with response headers to all responses
44
+
45
+ ### Bug Fixes
46
+
47
+ - [#936](https://github.com/okta/okta-auth-js/pull/936) Fixes getting mutiple memory storages issue in browser environment
48
+
49
+
50
+ ## 5.4.3
51
+
52
+ ### Bug Fixes
53
+
54
+ - [#926](https://github.com/okta/okta-auth-js/pull/926) Fixes incorrect using of `tokenManager` config (options `autoRenew`, `autoRemove`) in `OktaAuth.isAuthenticated`.
55
+ - [#931](https://github.com/okta/okta-auth-js/pull/931) Fixes types compatibility issue with old typescript versions (< 3.8)
56
+ - [#930](https://github.com/okta/okta-auth-js/pull/930) Fixes incorrect error message in idx `AuthTransaction` when user is not assigned.
57
+
3
58
  ## 5.4.2
4
59
 
5
60
  ### Bug Fixes
@@ -8,7 +63,7 @@
8
63
 
9
64
  ## 5.4.1
10
65
 
11
- -[#916](https://github.com/okta/okta-auth-js/pull/916) Removes misleading warning message for TokenManager methods
66
+ - [#916](https://github.com/okta/okta-auth-js/pull/916) Removes misleading warning message for TokenManager methods
12
67
 
13
68
  ## 5.4.0
14
69
 
@@ -304,7 +359,7 @@
304
359
  - `autoRemove`
305
360
  - `devMode`
306
361
  - [#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.
307
- - [#503](https://github.com/okta/okta-auth-js/pull/503) Supports relative uri for [options.redirectUri](README.md#additional-options)
362
+ - [#503](https://github.com/okta/okta-auth-js/pull/503) Supports relative uri for [options.redirectUri](README.md#configuration-options)
308
363
  - [#478](https://github.com/okta/okta-auth-js/pull/478) Adds cross tabs communication to sync `AuthState`.
309
364
  - [#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.
310
365
 
@@ -344,7 +399,7 @@
344
399
 
345
400
  - [#444](https://github.com/okta/okta-auth-js/pull/444)
346
401
  - 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.
347
- - `onSessionExpired` option has been removed. [TokenManager events](#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.
402
+ - `onSessionExpired` option has been removed. [TokenManager events](README.md#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.
348
403
  - `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.
349
404
 
350
405
  ## 3.2.6
@@ -443,7 +498,7 @@
443
498
 
444
499
  ### Features
445
500
 
446
- New [option](README.md#additional-options) `cookies` allows overriding default `secure` and `sameSite` values.
501
+ New [option](README.md#configuration-options) `cookies` allows overriding default `secure` and `sameSite` values.
447
502
 
448
503
  ### Breaking Changes
449
504
 
@@ -463,7 +518,7 @@ New [option](README.md#additional-options) `cookies` allows overriding default `
463
518
 
464
519
  - [#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.
465
520
 
466
- - [#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.
521
+ - [#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.
467
522
 
468
523
  - [#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.
469
524