@okta/okta-auth-js 6.2.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 (137) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/cjs/AuthStateManager.js +9 -3
  3. package/cjs/AuthStateManager.js.map +1 -1
  4. package/cjs/OktaUserAgent.js +2 -2
  5. package/cjs/PromiseQueue.js +9 -2
  6. package/cjs/PromiseQueue.js.map +1 -1
  7. package/cjs/ServiceManager.js +3 -3
  8. package/cjs/ServiceManager.js.map +1 -1
  9. package/cjs/TransactionManager.js +8 -2
  10. package/cjs/TransactionManager.js.map +1 -1
  11. package/cjs/browser/browserStorage.js +19 -18
  12. package/cjs/browser/browserStorage.js.map +1 -1
  13. package/cjs/idx/authenticator/Authenticator.js.map +1 -1
  14. package/cjs/idx/authenticator/OktaPassword.js +12 -3
  15. package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
  16. package/cjs/idx/authenticator/OktaVerifyTotp.js +9 -1
  17. package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
  18. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +14 -1
  19. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
  20. package/cjs/idx/authenticator/SecurityQuestionVerification.js +9 -1
  21. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  22. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +13 -3
  23. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  24. package/cjs/idx/authenticator/WebauthnEnrollment.js +5 -0
  25. package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
  26. package/cjs/idx/authenticator/WebauthnVerification.js +5 -0
  27. package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
  28. package/cjs/idx/authenticator/util.js +64 -0
  29. package/cjs/idx/authenticator/util.js.map +1 -0
  30. package/cjs/idx/idx-js/index.js +0 -122
  31. package/cjs/idx/idx-js/index.js.map +1 -1
  32. package/cjs/idx/idx-js/introspect.js +10 -6
  33. package/cjs/idx/idx-js/introspect.js.map +1 -1
  34. package/cjs/idx/idx-js/v1/generateIdxAction.js +17 -23
  35. package/cjs/idx/idx-js/v1/generateIdxAction.js.map +1 -1
  36. package/cjs/idx/idx-js/v1/makeIdxState.js +5 -4
  37. package/cjs/idx/idx-js/v1/makeIdxState.js.map +1 -1
  38. package/cjs/idx/introspect.js +13 -3
  39. package/cjs/idx/introspect.js.map +1 -1
  40. package/cjs/idx/proceed.js +14 -11
  41. package/cjs/idx/proceed.js.map +1 -1
  42. package/cjs/idx/remediate.js +65 -72
  43. package/cjs/idx/remediate.js.map +1 -1
  44. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +6 -2
  45. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  46. package/cjs/idx/remediators/AuthenticatorVerificationData.js +23 -19
  47. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  48. package/cjs/idx/remediators/Base/AuthenticatorData.js +22 -14
  49. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  50. package/cjs/idx/remediators/Base/Remediator.js +85 -85
  51. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  52. package/cjs/idx/remediators/Base/SelectAuthenticator.js +24 -15
  53. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  54. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +15 -4
  55. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  56. package/cjs/idx/remediators/ChallengePoll.js +8 -1
  57. package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
  58. package/cjs/idx/remediators/EnrollPoll.js +1 -1
  59. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  60. package/cjs/idx/remediators/EnrollProfile.js +15 -9
  61. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  62. package/cjs/idx/remediators/EnrollmentChannelData.js +0 -8
  63. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
  64. package/cjs/idx/remediators/Identify.js +12 -5
  65. package/cjs/idx/remediators/Identify.js.map +1 -1
  66. package/cjs/idx/remediators/ReEnrollAuthenticator.js +9 -8
  67. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  68. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +4 -3
  69. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  70. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +0 -1
  71. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
  72. package/cjs/idx/remediators/Skip.js +1 -8
  73. package/cjs/idx/remediators/Skip.js.map +1 -1
  74. package/cjs/idx/remediators/util.js.map +1 -1
  75. package/cjs/idx/run.js +267 -198
  76. package/cjs/idx/run.js.map +1 -1
  77. package/cjs/idx/types/idx-js.js.map +1 -1
  78. package/cjs/idx/types/index.js +37 -0
  79. package/cjs/idx/types/index.js.map +1 -1
  80. package/cjs/idx/util.js +198 -0
  81. package/cjs/idx/util.js.map +1 -0
  82. package/cjs/options/browser.js +11 -6
  83. package/cjs/options/browser.js.map +1 -1
  84. package/cjs/options/index.js +1 -1
  85. package/cjs/options/index.js.map +1 -1
  86. package/cjs/options/node.js +5 -6
  87. package/cjs/options/node.js.map +1 -1
  88. package/cjs/options.js +170 -0
  89. package/cjs/options.js.map +1 -0
  90. package/dist/okta-auth-js.min.js +1 -1
  91. package/dist/okta-auth-js.min.js.map +1 -1
  92. package/dist/okta-auth-js.umd.js +1 -1
  93. package/dist/okta-auth-js.umd.js.map +1 -1
  94. package/esm/esm.browser.js +1178 -794
  95. package/esm/esm.browser.js.map +1 -1
  96. package/esm/esm.node.mjs +1099 -781
  97. package/esm/esm.node.mjs.map +1 -1
  98. package/lib/AuthStateManager.d.ts +2 -0
  99. package/lib/PromiseQueue.d.ts +6 -2
  100. package/lib/TransactionManager.d.ts +3 -4
  101. package/lib/idx/authenticator/Authenticator.d.ts +1 -1
  102. package/lib/idx/authenticator/OktaPassword.d.ts +2 -1
  103. package/lib/idx/authenticator/OktaVerifyTotp.d.ts +1 -1
  104. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +3 -5
  105. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +1 -1
  106. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +2 -1
  107. package/lib/idx/authenticator/WebauthnEnrollment.d.ts +1 -1
  108. package/lib/idx/authenticator/WebauthnVerification.d.ts +1 -1
  109. package/lib/idx/authenticator/util.d.ts +4 -0
  110. package/lib/idx/idx-js/index.d.ts +1 -17
  111. package/lib/idx/idx-js/introspect.d.ts +2 -1
  112. package/lib/idx/idx-js/v1/generateIdxAction.d.ts +1 -1
  113. package/lib/idx/idx-js/v1/makeIdxState.d.ts +2 -2
  114. package/lib/idx/proceed.d.ts +1 -3
  115. package/lib/idx/remediate.d.ts +2 -2
  116. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -0
  117. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +0 -3
  118. package/lib/idx/remediators/Base/Remediator.d.ts +5 -4
  119. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +7 -9
  120. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -4
  121. package/lib/idx/remediators/ChallengePoll.d.ts +1 -0
  122. package/lib/idx/remediators/EnrollProfile.d.ts +0 -3
  123. package/lib/idx/remediators/EnrollmentChannelData.d.ts +0 -4
  124. package/lib/idx/remediators/Identify.d.ts +3 -5
  125. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -5
  126. package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +2 -1
  127. package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +1 -2
  128. package/lib/idx/remediators/Skip.d.ts +0 -3
  129. package/lib/idx/types/idx-js.d.ts +5 -1
  130. package/lib/idx/types/index.d.ts +7 -3
  131. package/lib/idx/util.d.ts +11 -0
  132. package/lib/options/browser.d.ts +2 -2
  133. package/lib/options/node.d.ts +2 -2
  134. package/lib/options.d.ts +14 -0
  135. package/lib/types/Storage.d.ts +7 -5
  136. package/lib/types/api.d.ts +1 -3
  137. package/package.json +7 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/types/idx-js.ts"],"names":["isRawIdxResponse","obj","version","isIdxResponse","rawIdxState"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AA0KA;AAaO,SAASA,gBAAT,CAA0BC,GAA1B,EAA2D;AAChE,SAAOA,GAAG,IAAIA,GAAG,CAACC,OAAlB;AACD;;AAoBM,SAASC,aAAT,CAAuBF,GAAvB,EAAqD;AAC1D,SAAOA,GAAG,IAAID,gBAAgB,CAACC,GAAG,CAACG,WAAL,CAA9B;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// TODO: remove when idx-js provides type information\n\nexport interface ChallengeData {\n challenge: string; \n userVerification: string; \n extensions?: {\n appid: string;\n };\n}\nexport interface ActivationData {\n challenge: string;\n rp: {\n name: string;\n };\n user: {\n id: string;\n name: string;\n displayName: string;\n };\n pubKeyCredParams: {\n type: string;\n alg: number;\n }[];\n attestation?: string;\n authenticatorSelection?: {\n userVerification?: string;\n authenticatorAttachment?: string;\n requireResidentKey?: boolean;\n residentKey?: string;\n };\n excludeCredentials?: {\n id: string;\n type: string;\n }[];\n}\nexport interface IdxAuthenticatorMethod {\n type: string;\n}\nexport interface IdxAuthenticator {\n displayName: string;\n id: string;\n key: string;\n methods: IdxAuthenticatorMethod[];\n type: string;\n settings?: {\n complexity?: unknown;\n age?: unknown;\n };\n contextualData?: {\n enrolledQuestion?: {\n question: string;\n questionKey: string;\n };\n qrcode?: { \n href: string; \n method: string; \n type: string; \n };\n sharedSecret?: string;\n questions?: {\n questionKey: string;\n question: string;\n }[];\n questionKeys?: string[];\n selectedChannel?: string;\n activationData?: ActivationData;\n challengeData?: ChallengeData;\n };\n credentialId?: string;\n}\n\nexport interface IdxForm {\n value: IdxRemediationValue[];\n}\n\nexport interface IdxOption {\n value: string | { form: IdxForm };\n label: string;\n relatesTo?: IdxAuthenticator;\n}\n\nexport interface IdpConfig {\n id: string;\n name: string;\n}\n\nexport interface IdxRemediationValueForm {\n form: IdxForm;\n}\n\nexport interface IdxRemediationValue {\n name: string;\n type?: string;\n required?: boolean;\n secret?: boolean;\n visible?: boolean;\n mutable?: boolean;\n value?: string | IdxRemediationValueForm;\n label?: string;\n form?: IdxForm;\n options?: IdxOption[];\n messages?: IdxMessages;\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface IdxRemediation {\n name: string;\n label?: string;\n value?: IdxRemediationValue[];\n relatesTo?: {\n type?: string;\n value: IdxAuthenticator;\n };\n idp?: IdpConfig;\n href?: string;\n method?: string;\n type?: string;\n accepts?: string;\n refresh?: number;\n}\n\nexport interface IdxContext {\n version: string;\n stateHandle: string;\n expiresAt: string;\n intent: string;\n currentAuthenticator: {\n type: string;\n value: IdxAuthenticator;\n };\n authenticators: {\n type: string;\n value: IdxAuthenticator[];\n };\n authenticatorEnrollments: {\n type: string;\n value: IdxAuthenticator[];\n };\n enrollmentAuthenticator: {\n type: string;\n value: IdxAuthenticator;\n };\n user: {\n type: string;\n value: Record<string, unknown>;\n };\n app: {\n type: string;\n value: Record<string, unknown>;\n };\n messages?: IdxMessages;\n success?: IdxRemediation;\n failure?: IdxRemediation;\n}\n\nexport interface IdxMessage {\n message: string;\n class: string;\n i18n: {\n key: string;\n params?: unknown[];\n };\n}\n\nexport interface IdxMessages {\n type: 'array';\n value: IdxMessage[];\n}\n\n// JSON response from the server\nexport interface RawIdxResponse {\n version: string;\n stateHandle: string;\n intent?: string;\n expiresAt?: string;\n remediation?: {\n type: 'array';\n value: IdxRemediation[];\n };\n messages?: IdxMessages;\n}\n\nexport function isRawIdxResponse(obj: any): obj is RawIdxResponse {\n return obj && obj.version;\n}\n\n\nexport interface IdxActions {\n [key: string]: Function;\n}\n\n// Object returned from idx-js\nexport interface IdxResponse {\n proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;\n neededToProceed: IdxRemediation[];\n rawIdxState: RawIdxResponse;\n interactionCode?: string;\n actions: IdxActions;\n toPersist: {\n interactionHandle?: string;\n };\n context?: IdxContext;\n}\n\nexport function isIdxResponse(obj: any): obj is IdxResponse {\n return obj && isRawIdxResponse(obj.rawIdxState);\n}\n"],"file":"idx-js.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/types/idx-js.ts"],"names":["isRawIdxResponse","obj","version","isIdxResponse","rawIdxState"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AA2KA;AAeO,SAASA,gBAAT,CAA0BC,GAA1B,EAA2D;AAChE,SAAOA,GAAG,IAAIA,GAAG,CAACC,OAAlB;AACD;;AAqBM,SAASC,aAAT,CAAuBF,GAAvB,EAAqD;AAC1D,SAAOA,GAAG,IAAID,gBAAgB,CAACC,GAAG,CAACG,WAAL,CAA9B;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// TODO: remove when idx-js provides type information\n\nexport interface ChallengeData {\n challenge: string; \n userVerification: string; \n extensions?: {\n appid: string;\n };\n}\nexport interface ActivationData {\n challenge: string;\n rp: {\n name: string;\n };\n user: {\n id: string;\n name: string;\n displayName: string;\n };\n pubKeyCredParams: {\n type: string;\n alg: number;\n }[];\n attestation?: string;\n authenticatorSelection?: {\n userVerification?: string;\n authenticatorAttachment?: string;\n requireResidentKey?: boolean;\n residentKey?: string;\n };\n excludeCredentials?: {\n id: string;\n type: string;\n }[];\n}\nexport interface IdxAuthenticatorMethod {\n type: string;\n}\nexport interface IdxAuthenticator {\n displayName: string;\n id: string;\n key: string;\n methods: IdxAuthenticatorMethod[];\n type: string;\n settings?: {\n complexity?: unknown;\n age?: unknown;\n };\n contextualData?: {\n enrolledQuestion?: {\n question: string;\n questionKey: string;\n };\n qrcode?: { \n href: string; \n method: string; \n type: string; \n };\n sharedSecret?: string;\n questions?: {\n questionKey: string;\n question: string;\n }[];\n questionKeys?: string[];\n selectedChannel?: string;\n activationData?: ActivationData;\n challengeData?: ChallengeData;\n };\n credentialId?: string;\n enrollmentId?: string;\n}\n\nexport interface IdxForm {\n value: IdxRemediationValue[];\n}\n\nexport interface IdxOption {\n value: string | { form: IdxForm };\n label: string;\n relatesTo?: IdxAuthenticator;\n}\n\nexport interface IdpConfig {\n id: string;\n name: string;\n}\n\nexport interface IdxRemediationValueForm {\n form: IdxForm;\n}\n\nexport interface IdxRemediationValue {\n name: string;\n type?: string;\n required?: boolean;\n secret?: boolean;\n visible?: boolean;\n mutable?: boolean;\n value?: string | IdxRemediationValueForm;\n label?: string;\n form?: IdxForm;\n options?: IdxOption[];\n messages?: IdxMessages;\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface IdxRemediation {\n name: string;\n label?: string;\n value?: IdxRemediationValue[];\n relatesTo?: {\n type?: string;\n value: IdxAuthenticator;\n };\n idp?: IdpConfig;\n href?: string;\n method?: string;\n type?: string;\n accepts?: string;\n refresh?: number;\n}\n\nexport interface IdxContext {\n version: string;\n stateHandle: string;\n expiresAt: string;\n intent: string;\n currentAuthenticator: {\n type: string;\n value: IdxAuthenticator;\n };\n authenticators: {\n type: string;\n value: IdxAuthenticator[];\n };\n authenticatorEnrollments: {\n type: string;\n value: IdxAuthenticator[];\n };\n enrollmentAuthenticator: {\n type: string;\n value: IdxAuthenticator;\n };\n user: {\n type: string;\n value: Record<string, unknown>;\n };\n app: {\n type: string;\n value: Record<string, unknown>;\n };\n messages?: IdxMessages;\n success?: IdxRemediation;\n failure?: IdxRemediation;\n}\n\nexport interface IdxMessage {\n message: string;\n class: string;\n i18n: {\n key: string;\n params?: unknown[];\n };\n}\n\nexport interface IdxMessages {\n type: 'array';\n value: IdxMessage[];\n}\n\n// JSON response from the server\nexport interface RawIdxResponse {\n version: string;\n stateHandle: string;\n intent?: string;\n expiresAt?: string;\n remediation?: {\n type: 'array';\n value: IdxRemediation[];\n };\n messages?: IdxMessages;\n success?: boolean;\n successWithInteractionCode?: IdxRemediation;\n}\n\nexport function isRawIdxResponse(obj: any): obj is RawIdxResponse {\n return obj && obj.version;\n}\n\n\nexport interface IdxActions {\n [key: string]: () => Promise<IdxResponse>;\n}\n\n// Object returned from auth-js\nexport interface IdxResponse {\n proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;\n neededToProceed: IdxRemediation[];\n rawIdxState: RawIdxResponse;\n interactionCode?: string;\n actions: IdxActions;\n toPersist: {\n interactionHandle?: string;\n };\n context?: IdxContext;\n requestDidSucceed?: boolean;\n}\n\nexport function isIdxResponse(obj: any): obj is IdxResponse {\n return obj && isRawIdxResponse(obj.rawIdxState);\n}\n"],"file":"idx-js.js"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ exports.isAuthenticator = isAuthenticator;
3
4
  Object.defineProperty(exports, "IdxAuthenticator", {
4
5
  enumerable: true,
5
6
  get: function () {
@@ -12,6 +13,12 @@ Object.defineProperty(exports, "IdxMessage", {
12
13
  return _idxJs.IdxMessage;
13
14
  }
14
15
  });
16
+ Object.defineProperty(exports, "IdxMessages", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _idxJs.IdxMessages;
20
+ }
21
+ });
15
22
  Object.defineProperty(exports, "ChallengeData", {
16
23
  enumerable: true,
17
24
  get: function () {
@@ -24,6 +31,24 @@ Object.defineProperty(exports, "ActivationData", {
24
31
  return _idxJs.ActivationData;
25
32
  }
26
33
  });
34
+ Object.defineProperty(exports, "IdxResponse", {
35
+ enumerable: true,
36
+ get: function () {
37
+ return _idxJs.IdxResponse;
38
+ }
39
+ });
40
+ Object.defineProperty(exports, "IdxContext", {
41
+ enumerable: true,
42
+ get: function () {
43
+ return _idxJs.IdxContext;
44
+ }
45
+ });
46
+ Object.defineProperty(exports, "RawIdxResponse", {
47
+ enumerable: true,
48
+ get: function () {
49
+ return _idxJs.RawIdxResponse;
50
+ }
51
+ });
27
52
  Object.defineProperty(exports, "FlowIdentifier", {
28
53
  enumerable: true,
29
54
  get: function () {
@@ -66,6 +91,12 @@ Object.defineProperty(exports, "CancelOptions", {
66
91
  return _cancel.CancelOptions;
67
92
  }
68
93
  });
94
+ Object.defineProperty(exports, "RemediateOptions", {
95
+ enumerable: true,
96
+ get: function () {
97
+ return _remediate.RemediateOptions;
98
+ }
99
+ });
69
100
  Object.defineProperty(exports, "EmailVerifyCallbackResponse", {
70
101
  enumerable: true,
71
102
  get: function () {
@@ -102,6 +133,8 @@ var _proceed = require("../proceed");
102
133
 
103
134
  var _cancel = require("../cancel");
104
135
 
136
+ var _remediate = require("../remediate");
137
+
105
138
  var _emailVerify = require("../emailVerify");
106
139
 
107
140
  var _WebauthnEnrollment = require("../authenticator/WebauthnEnrollment");
@@ -152,4 +185,8 @@ exports.IdxFeature = IdxFeature;
152
185
  IdxFeature["SOCIAL_IDP"] = "redirect-idp";
153
186
  IdxFeature["ACCOUNT_UNLOCK"] = "unlock-account";
154
187
  })(IdxFeature || (exports.IdxFeature = IdxFeature = {}));
188
+
189
+ function isAuthenticator(obj) {
190
+ return obj && (obj.key || obj.id);
191
+ }
155
192
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/types/index.ts"],"names":["IdxStatus","AuthenticatorKey","IdxFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;AAWA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AAzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IAiCYA,S;;;WAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,yBAAAA,S;;IAQAC,gB;;;WAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;GAAAA,gB,gCAAAA,gB;;IAgCAC,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U","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 { InteractOptions } from '../interact';\nimport { IntrospectOptions } from '../introspect';\nimport { APIError, Tokens } from '../../types';\nimport { PKCETransactionMeta } from '../../types/Transaction';\nimport { \n IdxActions, \n IdxAuthenticator, \n IdxContext,\n IdxForm,\n IdxMessage, \n IdxOption, \n IdxRemediation, \n IdxResponse, \n RawIdxResponse \n} from './idx-js';\nimport { FlowIdentifier } from './FlowIdentifier';\n\nexport { IdxMessage, ChallengeData, ActivationData } from './idx-js';\nexport { AuthenticationOptions } from '../authenticate';\nexport { RegistrationOptions } from '../register';\nexport { PasswordRecoveryOptions } from '../recoverPassword';\nexport { AccountUnlockOptions } from '../unlockAccount';\nexport { ProceedOptions } from '../proceed';\nexport { CancelOptions } from '../cancel';\nexport { FlowIdentifier };\nexport { IdxAuthenticator };\nexport { EmailVerifyCallbackResponse } from '../emailVerify';\nexport { WebauthnEnrollValues } from '../authenticator/WebauthnEnrollment';\nexport { WebauthnVerificationValues } from '../authenticator/WebauthnVerification';\n\nexport enum IdxStatus {\n SUCCESS = 'SUCCESS',\n PENDING = 'PENDING',\n FAILURE = 'FAILURE',\n TERMINAL = 'TERMINAL',\n CANCELED = 'CANCELED',\n}\n\nexport enum AuthenticatorKey {\n OKTA_PASSWORD = 'okta_password',\n OKTA_EMAIL = 'okta_email',\n PHONE_NUMBER = 'phone_number',\n GOOGLE_AUTHENTICATOR = 'google_otp',\n SECURITY_QUESTION = 'security_question',\n OKTA_VERIFY = 'okta_verify',\n WEBAUTHN = 'webauthn',\n}\n\nexport type Input = {\n name: string;\n type?: string;\n label?: string;\n value?: string | {form: IdxForm};\n minLength?: number;\n maxLength?: number;\n secret?: boolean;\n required?: boolean;\n}\n\nexport type NextStep = {\n name: string;\n authenticator?: IdxAuthenticator;\n canSkip?: boolean;\n canResend?: boolean;\n inputs?: Input[];\n options?: IdxOption[];\n poll?: IdxPollOptions;\n authenticatorEnrollments?: IdxAuthenticator[];\n}\n\nexport enum IdxFeature {\n PASSWORD_RECOVERY = 'recover-password',\n REGISTRATION = 'enroll-profile',\n SOCIAL_IDP = 'redirect-idp',\n ACCOUNT_UNLOCK = 'unlock-account',\n}\n\nexport interface IdxTransactionMeta extends PKCETransactionMeta {\n interactionHandle?: string;\n remediations?: string[];\n flow?: FlowIdentifier;\n withCredentials?: boolean;\n activationToken?: string;\n recoveryToken?: string;\n}\n\nexport interface IdxTransaction {\n status: IdxStatus;\n tokens?: Tokens;\n nextStep?: NextStep;\n messages?: IdxMessage[];\n error?: APIError;\n meta?: IdxTransactionMeta;\n enabledFeatures?: IdxFeature[];\n availableSteps?: NextStep[];\n\n // from idx-js, used by signin widget\n proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;\n neededToProceed: IdxRemediation[];\n rawIdxState: RawIdxResponse;\n interactionCode?: string;\n actions: IdxActions;\n context: IdxContext;\n}\n\nexport type IdxOptions = InteractOptions & IntrospectOptions & {\n flow?: FlowIdentifier;\n exchangeCodeForTokens?: boolean;\n autoRemediate?: boolean;\n};\n\nexport interface IdxPollOptions {\n required?: boolean;\n refresh?: number;\n}\n\nexport type Authenticator = {\n key: string;\n methodType?: string;\n phoneNumber?: string;\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/types/index.ts"],"names":["IdxStatus","AuthenticatorKey","IdxFeature","isAuthenticator","obj","key","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;AAWA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AAlDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IA0CYA,S;;;WAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,yBAAAA,S;;IAQAC,gB;;;WAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;GAAAA,gB,gCAAAA,gB;;IAgCAC,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U;;AAsDL,SAASC,eAAT,CAAyBC,GAAzB,EAAyD;AAC9D,SAAOA,GAAG,KAAKA,GAAG,CAACC,GAAJ,IAAWD,GAAG,CAACE,EAApB,CAAV;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 { InteractOptions } from '../interact';\nimport { IntrospectOptions } from '../introspect';\nimport { APIError, Tokens } from '../../types';\nimport { PKCETransactionMeta } from '../../types/Transaction';\nimport { \n IdxActions, \n IdxAuthenticator, \n IdxContext,\n IdxForm,\n IdxMessage, \n IdxOption, \n IdxRemediation, \n IdxResponse, \n RawIdxResponse \n} from './idx-js';\nimport { FlowIdentifier } from './FlowIdentifier';\n\nexport {\n IdxMessage,\n IdxMessages,\n ChallengeData,\n ActivationData,\n IdxResponse,\n IdxContext,\n RawIdxResponse\n} from './idx-js';\nexport { AuthenticationOptions } from '../authenticate';\nexport { RegistrationOptions } from '../register';\nexport { PasswordRecoveryOptions } from '../recoverPassword';\nexport { AccountUnlockOptions } from '../unlockAccount';\nexport { ProceedOptions } from '../proceed';\nexport { CancelOptions } from '../cancel';\nexport { RemediateOptions } from '../remediate';\nexport { FlowIdentifier };\nexport { IdxAuthenticator };\nexport { EmailVerifyCallbackResponse } from '../emailVerify';\nexport { WebauthnEnrollValues } from '../authenticator/WebauthnEnrollment';\nexport { WebauthnVerificationValues } from '../authenticator/WebauthnVerification';\n\nexport enum IdxStatus {\n SUCCESS = 'SUCCESS',\n PENDING = 'PENDING',\n FAILURE = 'FAILURE',\n TERMINAL = 'TERMINAL',\n CANCELED = 'CANCELED',\n}\n\nexport enum AuthenticatorKey {\n OKTA_PASSWORD = 'okta_password',\n OKTA_EMAIL = 'okta_email',\n PHONE_NUMBER = 'phone_number',\n GOOGLE_AUTHENTICATOR = 'google_otp',\n SECURITY_QUESTION = 'security_question',\n OKTA_VERIFY = 'okta_verify',\n WEBAUTHN = 'webauthn',\n}\n\nexport type Input = {\n name: string;\n type?: string;\n label?: string;\n value?: string | {form: IdxForm};\n minLength?: number;\n maxLength?: number;\n secret?: boolean;\n required?: boolean;\n}\n\nexport type NextStep = {\n name: string;\n authenticator?: IdxAuthenticator;\n canSkip?: boolean;\n canResend?: boolean;\n inputs?: Input[];\n options?: IdxOption[];\n poll?: IdxPollOptions;\n authenticatorEnrollments?: IdxAuthenticator[];\n}\n\nexport enum IdxFeature {\n PASSWORD_RECOVERY = 'recover-password',\n REGISTRATION = 'enroll-profile',\n SOCIAL_IDP = 'redirect-idp',\n ACCOUNT_UNLOCK = 'unlock-account',\n}\n\nexport interface IdxTransactionMeta extends PKCETransactionMeta {\n interactionHandle?: string;\n remediations?: string[];\n flow?: FlowIdentifier;\n withCredentials?: boolean;\n activationToken?: string;\n recoveryToken?: string;\n}\n\nexport interface IdxTransaction {\n status: IdxStatus;\n tokens?: Tokens;\n nextStep?: NextStep;\n messages?: IdxMessage[];\n error?: APIError | IdxResponse;\n meta?: IdxTransactionMeta;\n enabledFeatures?: IdxFeature[];\n availableSteps?: NextStep[];\n\n // from idx-js, used by signin widget\n proceed: (remediationName: string, params: unknown) => Promise<IdxResponse>;\n neededToProceed: IdxRemediation[];\n rawIdxState: RawIdxResponse;\n interactionCode?: string;\n actions: IdxActions;\n context: IdxContext;\n}\n\nexport type IdxOptions = InteractOptions & IntrospectOptions & {\n flow?: FlowIdentifier;\n exchangeCodeForTokens?: boolean;\n autoRemediate?: boolean;\n step?: string;\n};\n\nexport interface IdxPollOptions {\n required?: boolean;\n refresh?: number;\n}\n\nexport type Authenticator = {\n id?: string;\n key?: string;\n methodType?: string;\n phoneNumber?: string;\n};\n\nexport function isAuthenticator(obj: any): obj is Authenticator {\n return obj && (obj.key || obj.id);\n}\n"],"file":"index.js"}
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+
3
+ var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
4
+
5
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
6
+
7
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
8
+
9
+ exports.isTerminalResponse = isTerminalResponse;
10
+ exports.canSkipFn = canSkipFn;
11
+ exports.canResendFn = canResendFn;
12
+ exports.getMessagesFromIdxRemediationValue = getMessagesFromIdxRemediationValue;
13
+ exports.getMessagesFromResponse = getMessagesFromResponse;
14
+ exports.getEnabledFeatures = getEnabledFeatures;
15
+ exports.getAvailableSteps = getAvailableSteps;
16
+ exports.filterValuesForRemediation = filterValuesForRemediation;
17
+
18
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
19
+
20
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
21
+
22
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
23
+
24
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
25
+
26
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
27
+
28
+ var remediators = _interopRequireWildcard(require("./remediators"));
29
+
30
+ var _types = require("./types");
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
36
+ function isTerminalResponse(idxResponse) {
37
+ const {
38
+ neededToProceed,
39
+ interactionCode
40
+ } = idxResponse;
41
+ return !neededToProceed.length && !interactionCode;
42
+ }
43
+
44
+ function canSkipFn(idxResponse) {
45
+ return idxResponse.neededToProceed.some(({
46
+ name
47
+ }) => name === 'skip');
48
+ }
49
+
50
+ function canResendFn(idxResponse) {
51
+ return (0, _keys.default)(idxResponse.actions).some(actionName => (0, _includes.default)(actionName).call(actionName, 'resend'));
52
+ }
53
+
54
+ function getMessagesFromIdxRemediationValue(value) {
55
+ if (!value || !Array.isArray(value)) {
56
+ return;
57
+ }
58
+
59
+ return (0, _reduce.default)(value).call(value, (messages, value) => {
60
+ if (value.messages) {
61
+ messages = [...messages, ...value.messages.value];
62
+ }
63
+
64
+ if (value.form) {
65
+ const messagesFromForm = getMessagesFromIdxRemediationValue(value.form.value) || [];
66
+ messages = [...messages, ...messagesFromForm];
67
+ }
68
+
69
+ if (value.options) {
70
+ let optionValues = [];
71
+ value.options.forEach(option => {
72
+ if (!option.value || typeof option.value === 'string') {
73
+ return;
74
+ }
75
+
76
+ optionValues = [...optionValues, option.value];
77
+ });
78
+ const messagesFromOptions = getMessagesFromIdxRemediationValue(optionValues) || [];
79
+ messages = [...messages, ...messagesFromOptions];
80
+ }
81
+
82
+ return messages;
83
+ }, []);
84
+ }
85
+
86
+ function getMessagesFromResponse(idxResponse) {
87
+ var _rawIdxState$messages, _context;
88
+
89
+ let messages = [];
90
+ const {
91
+ rawIdxState,
92
+ neededToProceed
93
+ } = idxResponse; // Handle global messages
94
+
95
+ const globalMessages = (_rawIdxState$messages = rawIdxState.messages) === null || _rawIdxState$messages === void 0 ? void 0 : (0, _map.default)(_context = _rawIdxState$messages.value).call(_context, message => message);
96
+
97
+ if (globalMessages) {
98
+ messages = [...messages, ...globalMessages];
99
+ } // Handle field messages for current flow
100
+
101
+
102
+ for (let remediation of neededToProceed) {
103
+ const fieldMessages = getMessagesFromIdxRemediationValue(remediation.value);
104
+
105
+ if (fieldMessages) {
106
+ messages = [...messages, ...fieldMessages];
107
+ }
108
+ } // API may return identical error on same field, filter by i18n key
109
+
110
+
111
+ const seen = {};
112
+ messages = (0, _reduce.default)(messages).call(messages, (filtered, message) => {
113
+ var _message$i18n;
114
+
115
+ const key = (_message$i18n = message.i18n) === null || _message$i18n === void 0 ? void 0 : _message$i18n.key;
116
+
117
+ if (key && seen[key]) {
118
+ return filtered;
119
+ }
120
+
121
+ seen[key] = message;
122
+ filtered = [...filtered, message];
123
+ return filtered;
124
+ }, []);
125
+ return messages;
126
+ }
127
+
128
+ function getEnabledFeatures(idxResponse) {
129
+ const res = [];
130
+ const {
131
+ actions,
132
+ neededToProceed
133
+ } = idxResponse;
134
+
135
+ if (actions['currentAuthenticator-recover']) {
136
+ res.push(_types.IdxFeature.PASSWORD_RECOVERY);
137
+ }
138
+
139
+ if (neededToProceed.some(({
140
+ name
141
+ }) => name === 'select-enroll-profile')) {
142
+ res.push(_types.IdxFeature.REGISTRATION);
143
+ }
144
+
145
+ if (neededToProceed.some(({
146
+ name
147
+ }) => name === 'redirect-idp')) {
148
+ res.push(_types.IdxFeature.SOCIAL_IDP);
149
+ }
150
+
151
+ if (neededToProceed.some(({
152
+ name
153
+ }) => name === 'unlock-account')) {
154
+ res.push(_types.IdxFeature.ACCOUNT_UNLOCK);
155
+ }
156
+
157
+ return res;
158
+ }
159
+
160
+ function getAvailableSteps(idxResponse) {
161
+ var _context2;
162
+
163
+ const res = [];
164
+ const remediatorMap = (0, _reduce.default)(_context2 = (0, _values.default)(remediators)).call(_context2, (map, remediatorClass) => {
165
+ // Only add concrete subclasses to the map
166
+ if (remediatorClass.remediationName) {
167
+ map[remediatorClass.remediationName] = remediatorClass;
168
+ }
169
+
170
+ return map;
171
+ }, {});
172
+
173
+ for (let remediation of idxResponse.neededToProceed) {
174
+ const T = remediatorMap[remediation.name];
175
+
176
+ if (T) {
177
+ const remediator = new T(remediation);
178
+ res.push(remediator.getNextStep(idxResponse.context));
179
+ }
180
+ }
181
+
182
+ return res;
183
+ }
184
+
185
+ function filterValuesForRemediation(idxResponse, values) {
186
+ var _context3;
187
+
188
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
189
+ const valuesForRemediation = (0, _reduce.default)(_context3 = idxResponse.neededToProceed[0].value).call(_context3, (res, entry) => {
190
+ const {
191
+ name
192
+ } = entry;
193
+ res[name] = values[name];
194
+ return res;
195
+ }, {});
196
+ return valuesForRemediation;
197
+ }
198
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../lib/idx/util.ts"],"names":["isTerminalResponse","idxResponse","neededToProceed","interactionCode","length","canSkipFn","some","name","canResendFn","actions","actionName","getMessagesFromIdxRemediationValue","value","Array","isArray","messages","form","messagesFromForm","options","optionValues","forEach","option","messagesFromOptions","getMessagesFromResponse","rawIdxState","globalMessages","message","remediation","fieldMessages","seen","filtered","key","i18n","getEnabledFeatures","res","push","IdxFeature","PASSWORD_RECOVERY","REGISTRATION","SOCIAL_IDP","ACCOUNT_UNLOCK","getAvailableSteps","remediatorMap","remediators","map","remediatorClass","remediationName","T","remediator","getNextStep","context","filterValuesForRemediation","values","valuesForRemediation","entry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;AAGO,SAASA,kBAAT,CAA4BC,WAA5B,EAAsD;AAC3D,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,MAAuCF,WAA7C;AACA,SAAO,CAACC,eAAe,CAACE,MAAjB,IAA2B,CAACD,eAAnC;AACD;;AAEM,SAASE,SAAT,CAAmBJ,WAAnB,EAA6C;AAClD,SAAOA,WAAW,CAACC,eAAZ,CAA4BI,IAA5B,CAAiC,CAAC;AAAEC,IAAAA;AAAF,GAAD,KAAcA,IAAI,KAAK,MAAxD,CAAP;AACD;;AAEM,SAASC,WAAT,CAAqBP,WAArB,EAA+C;AACpD,SAAO,mBAAYA,WAAW,CAACQ,OAAxB,EAAiCH,IAAjC,CAAsCI,UAAU,IAAI,uBAAAA,UAAU,MAAV,CAAAA,UAAU,EAAU,QAAV,CAA9D,CAAP;AACD;;AAEM,SAASC,kCAAT,CACLC,KADK,EAEqB;AAC1B,MAAI,CAACA,KAAD,IAAU,CAACC,KAAK,CAACC,OAAN,CAAcF,KAAd,CAAf,EAAqC;AACnC;AACD;;AACD,SAAO,qBAAAA,KAAK,MAAL,CAAAA,KAAK,EAAQ,CAACG,QAAD,EAAWH,KAAX,KAAqB;AACvC,QAAIA,KAAK,CAACG,QAAV,EAAoB;AAClBA,MAAAA,QAAQ,GAAG,CAAC,GAAGA,QAAJ,EAAc,GAAGH,KAAK,CAACG,QAAN,CAAeH,KAAhC,CAAX;AACD;;AACD,QAAIA,KAAK,CAACI,IAAV,EAAgB;AACd,YAAMC,gBAAgB,GAAGN,kCAAkC,CAACC,KAAK,CAACI,IAAN,CAAWJ,KAAZ,CAAlC,IAAwD,EAAjF;AACAG,MAAAA,QAAQ,GAAG,CAAC,GAAGA,QAAJ,EAAc,GAAGE,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cAApB;AACD;;AAED,SAAON,GAAP;AACD;;AAEM,SAASO,iBAAT,CAA2BxC,WAA3B,EAAiE;AAAA;;AACtE,QAAMiC,GAAG,GAAG,EAAZ;AAEA,QAAMQ,aAAa,GAAG,sDAAcC,WAAd,mBAAkC,CAACC,GAAD,EAAMC,eAAN,KAA0B;AAChF;AACA,QAAIA,eAAe,CAACC,eAApB,EAAqC;AACnCF,MAAAA,GAAG,CAACC,eAAe,CAACC,eAAjB,CAAH,GAAuCD,eAAvC;AACD;;AACD,WAAOD,GAAP;AACD,GANqB,EAMnB,EANmB,CAAtB;;AAQA,OAAK,IAAIjB,WAAT,IAAwB1B,WAAW,CAACC,eAApC,EAAqD;AACnD,UAAM6C,CAAC,GAAGL,aAAa,CAACf,WAAW,CAACpB,IAAb,CAAvB;;AACA,QAAIwC,CAAJ,EAAO;AACL,YAAMC,UAAU,GAAG,IAAID,CAAJ,CAAMpB,WAAN,CAAnB;AACAO,MAAAA,GAAG,CAACC,IAAJ,CAAUa,UAAU,CAACC,WAAX,CAAuBhD,WAAW,CAACiD,OAAnC,CAAV;AACD;AACF;;AAED,SAAOhB,GAAP;AACD;;AAEM,SAASiB,0BAAT,CAAoClD,WAApC,EAA8DmD,MAA9D,EAA4G;AAAA;;AACjH;AACA,QAAMC,oBAAoB,GAAG,iCAAApD,WAAW,CAACC,eAAZ,CAA6B,CAA7B,EAAiCU,KAAjC,kBAA+C,CAACsB,GAAD,EAAMoB,KAAN,KAAgB;AAC1F,UAAM;AAAE/C,MAAAA;AAAF,QAAW+C,KAAjB;AACApB,IAAAA,GAAG,CAAC3B,IAAD,CAAH,GAAY6C,MAAM,CAAC7C,IAAD,CAAlB;AACA,WAAO2B,GAAP;AACD,GAJ4B,EAI1B,EAJ0B,CAA7B;AAKA,SAAOmB,oBAAP;AACD","sourcesContent":["import * as remediators from './remediators';\nimport { RemediationValues } from './remediators';\nimport { IdxFeature, NextStep } from './types';\nimport { IdxMessage, IdxRemediationValue, IdxResponse } from './types/idx-js';\n\nexport function isTerminalResponse(idxResponse: IdxResponse) {\n const { neededToProceed, interactionCode } = idxResponse;\n return !neededToProceed.length && !interactionCode;\n}\n\nexport function canSkipFn(idxResponse: IdxResponse) {\n return idxResponse.neededToProceed.some(({ name }) => name === 'skip');\n}\n\nexport function canResendFn(idxResponse: IdxResponse) {\n return Object.keys(idxResponse.actions).some(actionName => actionName.includes('resend'));\n}\n\nexport function getMessagesFromIdxRemediationValue(\n value?: IdxRemediationValue[]\n): IdxMessage[] | undefined {\n if (!value || !Array.isArray(value)) {\n return;\n }\n return value.reduce((messages, value) => {\n if (value.messages) {\n messages = [...messages, ...value.messages.value] as never;\n }\n if (value.form) {\n const messagesFromForm = getMessagesFromIdxRemediationValue(value.form.value) || [];\n messages = [...messages, ...messagesFromForm] as never;\n } \n if (value.options) {\n let optionValues = [];\n value.options.forEach(option => {\n if (!option.value || typeof option.value === 'string') {\n return;\n }\n optionValues = [...optionValues, option.value] as never;\n });\n const messagesFromOptions = getMessagesFromIdxRemediationValue(optionValues) || [];\n messages = [...messages, ...messagesFromOptions] as never;\n }\n return messages;\n }, []);\n}\n\nexport function getMessagesFromResponse(idxResponse: IdxResponse): IdxMessage[] {\n let messages: IdxMessage[] = [];\n const { rawIdxState, neededToProceed } = idxResponse;\n\n // Handle global messages\n const globalMessages = rawIdxState.messages?.value.map(message => message);\n if (globalMessages) {\n messages = [...messages, ...globalMessages] as never;\n }\n\n // Handle field messages for current flow\n for (let remediation of neededToProceed) {\n const fieldMessages = getMessagesFromIdxRemediationValue(remediation.value);\n if (fieldMessages) {\n messages = [...messages, ...fieldMessages] as never;\n }\n }\n\n // API may return identical error on same field, filter by i18n key\n const seen = {};\n messages = messages.reduce((filtered, message) => {\n const key = message.i18n?.key;\n if (key && seen[key]) {\n return filtered;\n }\n seen[key] = message;\n filtered = [...filtered, message] as never;\n return filtered;\n }, []);\n return messages;\n}\n\n\nexport function getEnabledFeatures(idxResponse: IdxResponse): IdxFeature[] {\n const res = [];\n const { actions, neededToProceed } = idxResponse;\n\n if (actions['currentAuthenticator-recover']) {\n res.push(IdxFeature.PASSWORD_RECOVERY as never);\n }\n\n if (neededToProceed.some(({ name }) => name === 'select-enroll-profile')) {\n res.push(IdxFeature.REGISTRATION as never);\n }\n\n if (neededToProceed.some(({ name }) => name === 'redirect-idp')) {\n res.push(IdxFeature.SOCIAL_IDP as never);\n }\n\n if (neededToProceed.some(({ name }) => name === 'unlock-account')) {\n res.push(IdxFeature.ACCOUNT_UNLOCK as never);\n }\n\n return res;\n}\n\nexport function getAvailableSteps(idxResponse: IdxResponse): NextStep[] {\n const res = [];\n\n const remediatorMap = Object.values(remediators).reduce((map, remediatorClass) => {\n // Only add concrete subclasses to the map\n if (remediatorClass.remediationName) {\n map[remediatorClass.remediationName] = remediatorClass;\n }\n return map;\n }, {});\n\n for (let remediation of idxResponse.neededToProceed) {\n const T = remediatorMap[remediation.name];\n if (T) {\n const remediator = new T(remediation);\n res.push (remediator.getNextStep(idxResponse.context) as never);\n }\n }\n\n return res;\n}\n\nexport function filterValuesForRemediation(idxResponse: IdxResponse, values: RemediationValues): RemediationValues {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const valuesForRemediation = idxResponse.neededToProceed![0]!.value!.reduce((res, entry) => {\n const { name } = entry;\n res[name] = values[name];\n return res;\n }, {});\n return valuesForRemediation;\n}\n"],"file":"util.js"}
@@ -2,15 +2,12 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
+ exports.getStorage = getStorage;
5
6
  exports.getCookieSettings = getCookieSettings;
6
- Object.defineProperty(exports, "storage", {
7
- enumerable: true,
8
- get: function () {
9
- return _browserStorage.default;
10
- }
11
- });
12
7
  exports.enableSharedStorage = exports.STORAGE_MANAGER_OPTIONS = void 0;
13
8
 
9
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
10
+
14
11
  var _util = require("../util");
15
12
 
16
13
  var _browserStorage = _interopRequireDefault(require("../browser/browserStorage"));
@@ -28,6 +25,14 @@ var _browserStorage = _interopRequireDefault(require("../browser/browserStorage"
28
25
  */
29
26
 
30
27
  /* eslint-disable complexity */
28
+ function getStorage() {
29
+ const storageUtil = (0, _assign.default)({}, _browserStorage.default, {
30
+ inMemoryStore: {} // create unique storage for this instance
31
+
32
+ });
33
+ return storageUtil;
34
+ }
35
+
31
36
  const STORAGE_MANAGER_OPTIONS = {
32
37
  token: {
33
38
  storageTypes: ['localStorage', 'sessionStorage', 'cookie']
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/options/browser.ts"],"names":["STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","enableSharedStorage","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite"],"mappings":";;;;;;;;;;;;;AAcA;;AAEA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAMO,MAAMA,uBAA8C,GAAG;AAC5DC,EAAAA,KAAK,EAAE;AACLC,IAAAA,YAAY,EAAE,CACZ,cADY,EAEZ,gBAFY,EAGZ,QAHY;AADT,GADqD;AAQ5DC,EAAAA,KAAK,EAAE;AACLD,IAAAA,YAAY,EAAE,CACZ,cADY,EAEZ,gBAFY,EAGZ,QAHY;AADT,GARqD;AAe5DE,EAAAA,WAAW,EAAE;AACXF,IAAAA,YAAY,EAAE,CACZ,gBADY,EAEZ,cAFY,EAGZ,QAHY;AADH,GAf+C;AAsB5D,wBAAsB;AACpBA,IAAAA,YAAY,EAAE,CACZ,cADY;AADM,GAtBsC;AA2B5D,kBAAgB;AACdA,IAAAA,YAAY,EAAE,CACZ,cADY;AADA;AA3B4C,CAAvD;;AAkCA,MAAMG,mBAAmB,GAAG,IAA5B;;;AAEA,SAASC,iBAAT,CAA2BC,IAAqB,GAAG,EAAnD,EAAuDC,OAAvD,EAAyE;AAC9E;AACA;AACA;AACA,MAAIC,cAAc,GAAGF,IAAI,CAACG,OAAL,IAAgB,EAArC;;AACA,MAAI,OAAOD,cAAc,CAACE,MAAtB,KAAiC,WAArC,EAAkD;AAChDF,IAAAA,cAAc,CAACE,MAAf,GAAwBH,OAAxB;AACD;;AACD,MAAI,OAAOC,cAAc,CAACG,QAAtB,KAAmC,WAAvC,EAAoD;AAClDH,IAAAA,cAAc,CAACG,QAAf,GAA0BH,cAAc,CAACE,MAAf,GAAwB,MAAxB,GAAiC,KAA3D;AACD,GAV6E,CAY9E;;;AACA,MAAIF,cAAc,CAACE,MAAf,IAAyB,CAACH,OAA9B,EAAuC;AACrC;AACA,oBACE,oEACA,4DADA,GAEA,gEAHF;AAKAC,IAAAA,cAAc,CAACE,MAAf,GAAwB,KAAxB;AACD,GArB6E,CAuB9E;AACA;;;AACA,MAAIF,cAAc,CAACG,QAAf,KAA4B,MAA5B,IAAsC,CAACH,cAAc,CAACE,MAA1D,EAAkE;AAChEF,IAAAA,cAAc,CAACG,QAAf,GAA0B,KAA1B;AACD;;AAED,SAAOH,cAAP;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/* eslint-disable complexity */\nimport { StorageManagerOptions, OktaAuthOptions } from '../types';\nimport { warn } from '../util';\n\nexport { default as storage } from '../browser/browserStorage';\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport const enableSharedStorage = true;\n\nexport function getCookieSettings(args: OktaAuthOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"file":"browser.js"}
1
+ {"version":3,"sources":["../../../lib/options/browser.ts"],"names":["getStorage","storageUtil","browserStorage","inMemoryStore","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","enableSharedStorage","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite"],"mappings":";;;;;;;;;;AAcA;;AAEA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAMO,SAASA,UAAT,GAAmC;AACxC,QAAMC,WAAW,GAAG,qBAAc,EAAd,EAAkBC,uBAAlB,EAAkC;AACpDC,IAAAA,aAAa,EAAE,EADqC,CAClC;;AADkC,GAAlC,C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AAChEF,IAAAA,cAAc,CAACG,QAAf,GAA0B,KAA1B;AACD;;AAED,SAAOH,cAAP;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/* eslint-disable complexity */\nimport { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';\nimport { warn } from '../util';\n\nimport { default as browserStorage } from '../browser/browserStorage';\n\nexport function getStorage(): StorageUtil {\n const storageUtil = Object.assign({}, browserStorage, {\n inMemoryStore: {} // create unique storage for this instance\n });\n return storageUtil;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport const enableSharedStorage = true;\n\nexport function getCookieSettings(args: OktaAuthOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"file":"browser.js"}
@@ -32,7 +32,7 @@ function getDefaultOptions() {
32
32
  const options = {
33
33
  devMode: false,
34
34
  httpRequestClient: _fetchRequest.default,
35
- storageUtil: _node.storage,
35
+ storageUtil: (0, _node.getStorage)(),
36
36
  storageManager: _node.STORAGE_MANAGER_OPTIONS,
37
37
  transactionManager: {
38
38
  enableSharedStorage: _node.enableSharedStorage
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/options/index.ts"],"names":["getDefaultOptions","options","devMode","httpRequestClient","fetchRequest","storageUtil","storage","storageManager","STORAGE_MANAGER_OPTIONS","transactionManager","enableSharedStorage","mergeOptions","args","buildOptions","issuer","tokenUrl","authorizeUrl","userinfoUrl","revokeUrl","logoutUrl","clientId","redirectUri","state","scopes","postLogoutRedirectUri","responseMode","responseType","pkce","useInteractionCodeFlow","transformErrorXHR","transformAuthState","restoreOriginalUri","headers","cookies","flow","codeChallenge","codeChallengeMethod","recoveryToken","activationToken","ignoreSignature","clientSecret"],"mappings":";;;;;;;;;AAYA;;AACA;;AAGA;;AACA;;AACA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO,SAASA,iBAAT,GAA8C;AACnD,QAAMC,OAAO,GAAG;AACdC,IAAAA,OAAO,EAAE,KADK;AAEdC,IAAAA,iBAAiB,EAAEC,qBAFL;AAGdC,IAAAA,WAAW,EAAEC,aA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AC4B;AAvCH,GAAX,CAAP;AAyCD","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 { removeTrailingSlash, removeNils } from '../util';\nimport { assertValidConfig } from '../builderUtil';\nimport { OktaAuthOptions } from '../types';\n\nimport fetchRequest from '../fetch/fetchRequest';\nimport { storage, STORAGE_MANAGER_OPTIONS, enableSharedStorage, getCookieSettings } from './node';\nimport { isHTTPS } from '../features';\n\nexport function getDefaultOptions(): OktaAuthOptions {\n const options = {\n devMode: false,\n httpRequestClient: fetchRequest,\n storageUtil: storage,\n storageManager: STORAGE_MANAGER_OPTIONS,\n transactionManager: {\n enableSharedStorage\n }\n };\n return options;\n}\n\nfunction mergeOptions(options, args): OktaAuthOptions {\n return Object.assign({}, options, removeNils(args), {\n storageManager: Object.assign({}, options.storageManager, args.storageManager),\n transactionManager: Object.assign({}, options.transactionManager, args.transactionManager),\n });\n}\n\nexport function buildOptions(args: OktaAuthOptions = {}): OktaAuthOptions {\n assertValidConfig(args);\n args = mergeOptions(getDefaultOptions(), args);\n return removeNils({\n // OIDC configuration\n issuer: removeTrailingSlash(args.issuer),\n tokenUrl: removeTrailingSlash(args.tokenUrl),\n authorizeUrl: removeTrailingSlash(args.authorizeUrl),\n userinfoUrl: removeTrailingSlash(args.userinfoUrl),\n revokeUrl: removeTrailingSlash(args.revokeUrl),\n logoutUrl: removeTrailingSlash(args.logoutUrl),\n clientId: args.clientId,\n redirectUri: args.redirectUri,\n state: args.state,\n scopes: args.scopes,\n postLogoutRedirectUri: args.postLogoutRedirectUri,\n responseMode: args.responseMode,\n responseType: args.responseType,\n pkce: args.pkce === false ? false : true, // PKCE defaults to true\n useInteractionCodeFlow: args.useInteractionCodeFlow,\n\n // Internal options\n httpRequestClient: args.httpRequestClient,\n transformErrorXHR: args.transformErrorXHR,\n transformAuthState: args.transformAuthState,\n restoreOriginalUri: args.restoreOriginalUri,\n storageUtil: args.storageUtil,\n headers: args.headers,\n devMode: !!args.devMode,\n storageManager: args.storageManager,\n transactionManager: args.transactionManager,\n cookies: getCookieSettings(args, isHTTPS()),\n flow: args.flow,\n codeChallenge: args.codeChallenge,\n codeChallengeMethod: args.codeChallengeMethod,\n recoveryToken: args.recoveryToken,\n activationToken: args.activationToken,\n\n // Give the developer the ability to disable token signature validation.\n ignoreSignature: !!args.ignoreSignature,\n\n // Server-side web applications\n clientSecret: args.clientSecret\n });\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../lib/options/index.ts"],"names":["getDefaultOptions","options","devMode","httpRequestClient","fetchRequest","storageUtil","storageManager","STORAGE_MANAGER_OPTIONS","transactionManager","enableSharedStorage","mergeOptions","args","buildOptions","issuer","tokenUrl","authorizeUrl","userinfoUrl","revokeUrl","logoutUrl","clientId","redirectUri","state","scopes","postLogoutRedirectUri","responseMode","responseType","pkce","useInteractionCodeFlow","transformErrorXHR","transformAuthState","restoreOriginalUri","headers","cookies","flow","codeChallenge","codeChallengeMethod","recoveryToken","activationToken","ignoreSignature","clientSecret"],"mappings":";;;;;;;;;AAYA;;AACA;;AAGA;;AACA;;AACA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO,SAASA,iBAAT,GAA8C;AAGnD,QAAMC,OAAO,GAAG;AACdC,IAAAA,OAAO,EAAE,KADK;AAEdC,IAAAA,iBAAiB,EAAEC,qBAFL;AAGdC,IAAAA,WAAW,EAAE,uBAHC;AAIdC,IAAAA,cAAc,EAAEC,6BAJF;AAKdC,IAAAA,kBAAkB,EAAE;AAClBC,MAAAA,mBAAm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ights 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 { removeTrailingSlash, removeNils } from '../util';\nimport { assertValidConfig } from '../builderUtil';\nimport { OktaAuthOptions } from '../types';\n\nimport fetchRequest from '../fetch/fetchRequest';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, enableSharedStorage, getCookieSettings } from './node';\nimport { isHTTPS } from '../features';\n\nexport function getDefaultOptions(): OktaAuthOptions {\n\n \n const options = {\n devMode: false,\n httpRequestClient: fetchRequest,\n storageUtil: getStorage(),\n storageManager: STORAGE_MANAGER_OPTIONS,\n transactionManager: {\n enableSharedStorage\n }\n };\n return options;\n}\n\nfunction mergeOptions(options, args): OktaAuthOptions {\n return Object.assign({}, options, removeNils(args), {\n storageManager: Object.assign({}, options.storageManager, args.storageManager),\n transactionManager: Object.assign({}, options.transactionManager, args.transactionManager),\n });\n}\n\nexport function buildOptions(args: OktaAuthOptions = {}): OktaAuthOptions {\n assertValidConfig(args);\n args = mergeOptions(getDefaultOptions(), args);\n return removeNils({\n // OIDC configuration\n issuer: removeTrailingSlash(args.issuer),\n tokenUrl: removeTrailingSlash(args.tokenUrl),\n authorizeUrl: removeTrailingSlash(args.authorizeUrl),\n userinfoUrl: removeTrailingSlash(args.userinfoUrl),\n revokeUrl: removeTrailingSlash(args.revokeUrl),\n logoutUrl: removeTrailingSlash(args.logoutUrl),\n clientId: args.clientId,\n redirectUri: args.redirectUri,\n state: args.state,\n scopes: args.scopes,\n postLogoutRedirectUri: args.postLogoutRedirectUri,\n responseMode: args.responseMode,\n responseType: args.responseType,\n pkce: args.pkce === false ? false : true, // PKCE defaults to true\n useInteractionCodeFlow: args.useInteractionCodeFlow,\n\n // Internal options\n httpRequestClient: args.httpRequestClient,\n transformErrorXHR: args.transformErrorXHR,\n transformAuthState: args.transformAuthState,\n restoreOriginalUri: args.restoreOriginalUri,\n storageUtil: args.storageUtil,\n headers: args.headers,\n devMode: !!args.devMode,\n storageManager: args.storageManager,\n transactionManager: args.transactionManager,\n cookies: getCookieSettings(args, isHTTPS()),\n flow: args.flow,\n codeChallenge: args.codeChallenge,\n codeChallengeMethod: args.codeChallengeMethod,\n recoveryToken: args.recoveryToken,\n activationToken: args.activationToken,\n\n // Give the developer the ability to disable token signature validation.\n ignoreSignature: !!args.ignoreSignature,\n\n // Server-side web applications\n clientSecret: args.clientSecret\n });\n}\n"],"file":"index.js"}
@@ -2,13 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
+ exports.getStorage = getStorage;
5
6
  exports.getCookieSettings = getCookieSettings;
6
- Object.defineProperty(exports, "storage", {
7
- enumerable: true,
8
- get: function () {
9
- return _serverStorage.default;
10
- }
11
- });
12
7
  exports.enableSharedStorage = exports.STORAGE_MANAGER_OPTIONS = void 0;
13
8
 
14
9
  var _serverStorage = _interopRequireDefault(require("../server/serverStorage"));
@@ -24,6 +19,10 @@ var _serverStorage = _interopRequireDefault(require("../server/serverStorage"));
24
19
  *
25
20
  * See the License for the specific language governing permissions and limitations under the License.
26
21
  */
22
+ function getStorage() {
23
+ return _serverStorage.default;
24
+ }
25
+
27
26
  const STORAGE_MANAGER_OPTIONS = {
28
27
  token: {
29
28
  storageTypes: ['memory']
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/options/node.ts"],"names":["STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","enableSharedStorage","getCookieSettings","args","isHTTPS","cookies"],"mappings":";;;;;;;;;;;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAMA,uBAA8C,GAAG;AAC5DC,EAAAA,KAAK,EAAE;AACLC,IAAAA,YAAY,EAAE,CACZ,QADY;AADT,GADqD;AAM5DC,EAAAA,KAAK,EAAE;AACLD,IAAAA,YAAY,EAAE,CACZ,QADY;AADT,GANqD;AAW5DE,EAAAA,WAAW,EAAE;AACXF,IAAAA,YAAY,EAAE,CACZ,QADY;AADH;AAX+C,CAAvD;;AAkBA,MAAMG,mBAAmB,GAAG,KAA5B,C,CAEP;;;;AACO,SAASC,iBAAT,CAA2BC,IAAqB,GAAG,EAAnD,EAAuDC,OAAvD,EAA0E;AAC/E,SAAOD,IAAI,CAACE,OAAZ;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 { StorageManagerOptions, OktaAuthOptions } from '../types';\n\nexport { default as storage } from '../server/serverStorage';\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\nexport const enableSharedStorage = false;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"file":"node.js"}
1
+ {"version":3,"sources":["../../../lib/options/node.ts"],"names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","enableSharedStorage","getCookieSettings","args","isHTTPS","cookies"],"mappings":";;;;;;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,SAASA,UAAT,GAAmC;AACxC,SAAOC,sBAAP;AACD;;AAEM,MAAMC,uBAA8C,GAAG;AAC5DC,EAAAA,KAAK,EAAE;AACLC,IAAAA,YAAY,EAAE,CACZ,QADY;AADT,GADqD;AAM5DC,EAAAA,KAAK,EAAE;AACLD,IAAAA,YAAY,EAAE,CACZ,QADY;AADT,GANqD;AAW5DE,EAAAA,WAAW,EAAE;AACXF,IAAAA,YAAY,EAAE,CACZ,QADY;AADH;AAX+C,CAAvD;;AAkBA,MAAMG,mBAAmB,GAAG,KAA5B,C,CAEP;;;;AACO,SAASC,iBAAT,CAA2BC,IAAqB,GAAG,EAAnD,EAAuDC,OAAvD,EAA0E;AAC/E,SAAOD,IAAI,CAACE,OAAZ;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 { StorageManagerOptions, OktaAuthOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\nexport const enableSharedStorage = false;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"file":"node.js"}