@okta/okta-auth-js 5.6.0 → 5.9.1

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 (405) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +28 -1
  3. package/cjs/OktaAuth.js +69 -35
  4. package/cjs/OktaAuth.js.map +1 -1
  5. package/cjs/OktaUserAgent.js +2 -2
  6. package/cjs/StorageManager.js +8 -0
  7. package/cjs/StorageManager.js.map +1 -1
  8. package/cjs/TransactionManager.js +24 -12
  9. package/cjs/TransactionManager.js.map +1 -1
  10. package/cjs/builderUtil.js +6 -0
  11. package/cjs/builderUtil.js.map +1 -1
  12. package/cjs/constants.js +3 -1
  13. package/cjs/constants.js.map +1 -1
  14. package/cjs/features.js +1 -1
  15. package/cjs/features.js.map +1 -1
  16. package/cjs/idx/authenticate.js +3 -18
  17. package/cjs/idx/authenticate.js.map +1 -1
  18. package/cjs/idx/flow/AuthenticationFlow.js +30 -0
  19. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
  20. package/cjs/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.js +0 -0
  21. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +1 -0
  22. package/cjs/idx/{flowMonitors → flow}/FlowMonitor.js +0 -0
  23. package/cjs/idx/flow/FlowMonitor.js.map +1 -0
  24. package/cjs/idx/flow/FlowSpecification.js +49 -0
  25. package/cjs/idx/flow/FlowSpecification.js.map +1 -0
  26. package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
  27. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
  28. package/cjs/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.js +0 -0
  29. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +1 -0
  30. package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +15 -12
  31. package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
  32. package/cjs/idx/{flowMonitors → flow}/RegistrationFlowMonitor.js +0 -0
  33. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +1 -0
  34. package/cjs/idx/flow/RemediationFlow.js +2 -0
  35. package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
  36. package/cjs/idx/flow/index.js +119 -0
  37. package/cjs/idx/flow/index.js.map +1 -0
  38. package/cjs/idx/index.js +26 -0
  39. package/cjs/idx/index.js.map +1 -1
  40. package/cjs/idx/interact.js +5 -2
  41. package/cjs/idx/interact.js.map +1 -1
  42. package/cjs/idx/introspect.js +24 -7
  43. package/cjs/idx/introspect.js.map +1 -1
  44. package/cjs/idx/proceed.js +49 -0
  45. package/cjs/idx/proceed.js.map +1 -0
  46. package/cjs/idx/recoverPassword.js +3 -17
  47. package/cjs/idx/recoverPassword.js.map +1 -1
  48. package/cjs/idx/register.js +7 -16
  49. package/cjs/idx/register.js.map +1 -1
  50. package/cjs/idx/remediate.js +33 -37
  51. package/cjs/idx/remediate.js.map +1 -1
  52. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  53. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +3 -1
  54. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  55. package/cjs/idx/remediators/Identify.js +4 -2
  56. package/cjs/idx/remediators/Identify.js.map +1 -1
  57. package/cjs/idx/run.js +36 -8
  58. package/cjs/idx/run.js.map +1 -1
  59. package/cjs/idx/startTransaction.js +2 -0
  60. package/cjs/idx/startTransaction.js.map +1 -1
  61. package/cjs/idx/transactionMeta.js +77 -39
  62. package/cjs/idx/transactionMeta.js.map +1 -1
  63. package/cjs/idx/types/FlowIdentifier.js +2 -0
  64. package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
  65. package/cjs/idx/types/idx-js.js +5 -0
  66. package/cjs/idx/types/idx-js.js.map +1 -1
  67. package/cjs/idx/types/index.js +16 -0
  68. package/cjs/idx/types/index.js.map +1 -1
  69. package/cjs/oidc/endpoints/authorize.js +4 -1
  70. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  71. package/cjs/oidc/getToken.js +14 -9
  72. package/cjs/oidc/getToken.js.map +1 -1
  73. package/cjs/oidc/getWithPopup.js +9 -2
  74. package/cjs/oidc/getWithPopup.js.map +1 -1
  75. package/cjs/oidc/getWithRedirect.js +2 -6
  76. package/cjs/oidc/getWithRedirect.js.map +1 -1
  77. package/cjs/oidc/renewTokens.js +28 -5
  78. package/cjs/oidc/renewTokens.js.map +1 -1
  79. package/cjs/oidc/util/browser.js +1 -13
  80. package/cjs/oidc/util/browser.js.map +1 -1
  81. package/cjs/oidc/util/loginRedirect.js +9 -5
  82. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  83. package/cjs/oidc/util/urlParams.js +1 -1
  84. package/cjs/oidc/util/urlParams.js.map +1 -1
  85. package/cjs/options.js +12 -2
  86. package/cjs/options.js.map +1 -1
  87. package/cjs/server/serverStorage.js +2 -1
  88. package/cjs/server/serverStorage.js.map +1 -1
  89. package/cjs/tx/AuthTransaction.js +1 -3
  90. package/cjs/tx/AuthTransaction.js.map +1 -1
  91. package/cjs/tx/api.js +3 -0
  92. package/cjs/tx/api.js.map +1 -1
  93. package/cjs/types/Transaction.js.map +1 -1
  94. package/{esm/clock.js → cjs/util/emailVerify.js} +14 -18
  95. package/cjs/util/emailVerify.js.map +1 -0
  96. package/cjs/util/index.js +13 -0
  97. package/cjs/util/index.js.map +1 -1
  98. package/dist/okta-auth-js.min.js +2 -74
  99. package/dist/okta-auth-js.min.js.LICENSE.txt +32 -0
  100. package/dist/okta-auth-js.min.js.map +1 -1
  101. package/dist/okta-auth-js.polyfill.js +2 -18
  102. package/{esm/crypto/webcrypto.js → dist/okta-auth-js.polyfill.js.LICENSE.txt} +8 -4
  103. package/dist/okta-auth-js.polyfill.js.map +1 -1
  104. package/dist/okta-auth-js.umd.js +2 -74
  105. package/dist/okta-auth-js.umd.js.LICENSE.txt +32 -0
  106. package/dist/okta-auth-js.umd.js.map +1 -1
  107. package/esm/index.js +8368 -16
  108. package/esm/index.js.map +1 -1
  109. package/lib/OktaAuth.d.ts +7 -3
  110. package/lib/StorageManager.d.ts +1 -0
  111. package/lib/TransactionManager.d.ts +5 -1
  112. package/lib/constants.d.ts +1 -0
  113. package/lib/crypto/base64.d.ts +2 -2
  114. package/lib/crypto/oidcHash.d.ts +1 -1
  115. package/lib/crypto/verifyToken.d.ts +1 -1
  116. package/{esm/oidc/endpoints/index.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -5
  117. package/lib/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.d.ts +0 -0
  118. package/lib/idx/{flowMonitors → flow}/FlowMonitor.d.ts +0 -0
  119. package/lib/idx/flow/FlowSpecification.d.ts +10 -0
  120. package/{esm/crypto/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -6
  121. package/lib/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.d.ts +0 -0
  122. package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
  123. package/lib/idx/{flowMonitors → flow}/RegistrationFlowMonitor.d.ts +0 -0
  124. package/lib/idx/flow/RemediationFlow.d.ts +13 -0
  125. package/lib/idx/{flowMonitors → flow}/index.d.ts +7 -2
  126. package/lib/idx/index.d.ts +2 -0
  127. package/lib/idx/introspect.d.ts +2 -1
  128. package/{esm/errors/AuthApiError.js → lib/idx/proceed.d.ts} +9 -19
  129. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +1 -4
  130. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +1 -4
  131. package/lib/idx/remediators/Identify.d.ts +1 -0
  132. package/lib/idx/run.d.ts +9 -9
  133. package/lib/idx/transactionMeta.d.ts +28 -4
  134. package/lib/idx/types/FlowIdentifier.d.ts +1 -0
  135. package/lib/idx/types/idx-js.d.ts +4 -0
  136. package/lib/idx/types/index.d.ts +14 -3
  137. package/lib/oidc/getToken.d.ts +2 -2
  138. package/lib/oidc/renewTokens.d.ts +0 -12
  139. package/lib/oidc/util/loginRedirect.d.ts +1 -1
  140. package/lib/types/OktaAuthOptions.d.ts +2 -0
  141. package/lib/types/Transaction.d.ts +2 -0
  142. package/lib/types/api.d.ts +20 -5
  143. package/{esm/errors/AuthPollStopError.js → lib/util/emailVerify.d.ts} +5 -8
  144. package/lib/util/index.d.ts +1 -0
  145. package/package.json +26 -14
  146. package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  147. package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
  148. package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  149. package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  150. package/cjs/idx/flowMonitors/index.js +0 -54
  151. package/cjs/idx/flowMonitors/index.js.map +0 -1
  152. package/esm/AuthStateManager.js +0 -214
  153. package/esm/AuthStateManager.js.map +0 -1
  154. package/esm/OktaAuth.js +0 -679
  155. package/esm/OktaAuth.js.map +0 -1
  156. package/esm/OktaUserAgent.js +0 -49
  157. package/esm/OktaUserAgent.js.map +0 -1
  158. package/esm/PromiseQueue.js +0 -71
  159. package/esm/PromiseQueue.js.map +0 -1
  160. package/esm/SavedObject.js +0 -91
  161. package/esm/SavedObject.js.map +0 -1
  162. package/esm/StorageManager.js +0 -182
  163. package/esm/StorageManager.js.map +0 -1
  164. package/esm/TokenManager.js +0 -455
  165. package/esm/TokenManager.js.map +0 -1
  166. package/esm/TransactionManager.js +0 -316
  167. package/esm/TransactionManager.js.map +0 -1
  168. package/esm/browser/browserStorage.js +0 -256
  169. package/esm/browser/browserStorage.js.map +0 -1
  170. package/esm/browser/fingerprint.js +0 -74
  171. package/esm/browser/fingerprint.js.map +0 -1
  172. package/esm/builderUtil.js +0 -50
  173. package/esm/builderUtil.js.map +0 -1
  174. package/esm/clock.js.map +0 -1
  175. package/esm/constants.js +0 -35
  176. package/esm/constants.js.map +0 -1
  177. package/esm/crypto/base64.js +0 -66
  178. package/esm/crypto/base64.js.map +0 -1
  179. package/esm/crypto/browser.js.map +0 -1
  180. package/esm/crypto/index.js.map +0 -1
  181. package/esm/crypto/node.js +0 -54
  182. package/esm/crypto/node.js.map +0 -1
  183. package/esm/crypto/oidcHash.js +0 -27
  184. package/esm/crypto/oidcHash.js.map +0 -1
  185. package/esm/crypto/verifyToken.js +0 -39
  186. package/esm/crypto/verifyToken.js.map +0 -1
  187. package/esm/crypto/webcrypto.js.map +0 -1
  188. package/esm/errors/AuthApiError.js.map +0 -1
  189. package/esm/errors/AuthPollStopError.js.map +0 -1
  190. package/esm/errors/AuthSdkError.js +0 -29
  191. package/esm/errors/AuthSdkError.js.map +0 -1
  192. package/esm/errors/CustomError.js +0 -21
  193. package/esm/errors/CustomError.js.map +0 -1
  194. package/esm/errors/OAuthError.js +0 -22
  195. package/esm/errors/OAuthError.js.map +0 -1
  196. package/esm/errors/index.js +0 -22
  197. package/esm/errors/index.js.map +0 -1
  198. package/esm/features.js +0 -64
  199. package/esm/features.js.map +0 -1
  200. package/esm/fetch/fetchRequest.js +0 -92
  201. package/esm/fetch/fetchRequest.js.map +0 -1
  202. package/esm/http/headers.js +0 -17
  203. package/esm/http/headers.js.map +0 -1
  204. package/esm/http/index.js +0 -3
  205. package/esm/http/index.js.map +0 -1
  206. package/esm/http/request.js +0 -145
  207. package/esm/http/request.js.map +0 -1
  208. package/esm/idx/authenticate.js +0 -47
  209. package/esm/idx/authenticate.js.map +0 -1
  210. package/esm/idx/cancel.js +0 -32
  211. package/esm/idx/cancel.js.map +0 -1
  212. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
  213. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  214. package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
  215. package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
  216. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
  217. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  218. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
  219. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  220. package/esm/idx/flowMonitors/index.js +0 -16
  221. package/esm/idx/flowMonitors/index.js.map +0 -1
  222. package/esm/idx/handleInteractionCodeRedirect.js +0 -64
  223. package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
  224. package/esm/idx/headers.js +0 -39
  225. package/esm/idx/headers.js.map +0 -1
  226. package/esm/idx/index.js +0 -20
  227. package/esm/idx/index.js.map +0 -1
  228. package/esm/idx/interact.js +0 -83
  229. package/esm/idx/interact.js.map +0 -1
  230. package/esm/idx/introspect.js +0 -45
  231. package/esm/idx/introspect.js.map +0 -1
  232. package/esm/idx/recoverPassword.js +0 -46
  233. package/esm/idx/recoverPassword.js.map +0 -1
  234. package/esm/idx/register.js +0 -63
  235. package/esm/idx/register.js.map +0 -1
  236. package/esm/idx/remediate.js +0 -302
  237. package/esm/idx/remediate.js.map +0 -1
  238. package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
  239. package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
  240. package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
  241. package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
  242. package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
  243. package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
  244. package/esm/idx/remediators/Base/Remediator.js +0 -221
  245. package/esm/idx/remediators/Base/Remediator.js.map +0 -1
  246. package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
  247. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
  248. package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -63
  249. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
  250. package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
  251. package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
  252. package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
  253. package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
  254. package/esm/idx/remediators/EnrollProfile.js +0 -79
  255. package/esm/idx/remediators/EnrollProfile.js.map +0 -1
  256. package/esm/idx/remediators/Identify.js +0 -86
  257. package/esm/idx/remediators/Identify.js.map +0 -1
  258. package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
  259. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
  260. package/esm/idx/remediators/RedirectIdp.js +0 -38
  261. package/esm/idx/remediators/RedirectIdp.js.map +0 -1
  262. package/esm/idx/remediators/ResetAuthenticator.js +0 -18
  263. package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
  264. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
  265. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
  266. package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
  267. package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
  268. package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
  269. package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
  270. package/esm/idx/remediators/Skip.js +0 -23
  271. package/esm/idx/remediators/Skip.js.map +0 -1
  272. package/esm/idx/remediators/index.js +0 -26
  273. package/esm/idx/remediators/index.js.map +0 -1
  274. package/esm/idx/remediators/util.js +0 -35
  275. package/esm/idx/remediators/util.js.map +0 -1
  276. package/esm/idx/run.js +0 -201
  277. package/esm/idx/run.js.map +0 -1
  278. package/esm/idx/startTransaction.js +0 -27
  279. package/esm/idx/startTransaction.js.map +0 -1
  280. package/esm/idx/transactionMeta.js +0 -114
  281. package/esm/idx/transactionMeta.js.map +0 -1
  282. package/esm/idx/types/idx-js.js +0 -17
  283. package/esm/idx/types/idx-js.js.map +0 -1
  284. package/esm/idx/types/index.js +0 -44
  285. package/esm/idx/types/index.js.map +0 -1
  286. package/esm/oidc/decodeToken.js +0 -31
  287. package/esm/oidc/decodeToken.js.map +0 -1
  288. package/esm/oidc/endpoints/authorize.js +0 -61
  289. package/esm/oidc/endpoints/authorize.js.map +0 -1
  290. package/esm/oidc/endpoints/index.js.map +0 -1
  291. package/esm/oidc/endpoints/token.js +0 -97
  292. package/esm/oidc/endpoints/token.js.map +0 -1
  293. package/esm/oidc/endpoints/well-known.js +0 -58
  294. package/esm/oidc/endpoints/well-known.js.map +0 -1
  295. package/esm/oidc/exchangeCodeForTokens.js +0 -69
  296. package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
  297. package/esm/oidc/getToken.js +0 -175
  298. package/esm/oidc/getToken.js.map +0 -1
  299. package/esm/oidc/getUserInfo.js +0 -82
  300. package/esm/oidc/getUserInfo.js.map +0 -1
  301. package/esm/oidc/getWithPopup.js +0 -28
  302. package/esm/oidc/getWithPopup.js.map +0 -1
  303. package/esm/oidc/getWithRedirect.js +0 -65
  304. package/esm/oidc/getWithRedirect.js.map +0 -1
  305. package/esm/oidc/getWithoutPrompt.js +0 -29
  306. package/esm/oidc/getWithoutPrompt.js.map +0 -1
  307. package/esm/oidc/handleOAuthResponse.js +0 -148
  308. package/esm/oidc/handleOAuthResponse.js.map +0 -1
  309. package/esm/oidc/index.js +0 -29
  310. package/esm/oidc/index.js.map +0 -1
  311. package/esm/oidc/parseFromUrl.js +0 -144
  312. package/esm/oidc/parseFromUrl.js.map +0 -1
  313. package/esm/oidc/renewToken.js +0 -85
  314. package/esm/oidc/renewToken.js.map +0 -1
  315. package/esm/oidc/renewTokens.js +0 -52
  316. package/esm/oidc/renewTokens.js.map +0 -1
  317. package/esm/oidc/renewTokensWithRefresh.js +0 -55
  318. package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
  319. package/esm/oidc/revokeToken.js +0 -57
  320. package/esm/oidc/revokeToken.js.map +0 -1
  321. package/esm/oidc/util/browser.js +0 -85
  322. package/esm/oidc/util/browser.js.map +0 -1
  323. package/esm/oidc/util/defaultTokenParams.js +0 -42
  324. package/esm/oidc/util/defaultTokenParams.js.map +0 -1
  325. package/esm/oidc/util/errors.js +0 -31
  326. package/esm/oidc/util/errors.js.map +0 -1
  327. package/esm/oidc/util/index.js +0 -25
  328. package/esm/oidc/util/index.js.map +0 -1
  329. package/esm/oidc/util/loginRedirect.js +0 -84
  330. package/esm/oidc/util/loginRedirect.js.map +0 -1
  331. package/esm/oidc/util/oauth.js +0 -70
  332. package/esm/oidc/util/oauth.js.map +0 -1
  333. package/esm/oidc/util/pkce.js +0 -55
  334. package/esm/oidc/util/pkce.js.map +0 -1
  335. package/esm/oidc/util/prepareTokenParams.js +0 -75
  336. package/esm/oidc/util/prepareTokenParams.js.map +0 -1
  337. package/esm/oidc/util/refreshToken.js +0 -24
  338. package/esm/oidc/util/refreshToken.js.map +0 -1
  339. package/esm/oidc/util/urlParams.js +0 -54
  340. package/esm/oidc/util/urlParams.js.map +0 -1
  341. package/esm/oidc/util/validateClaims.js +0 -53
  342. package/esm/oidc/util/validateClaims.js.map +0 -1
  343. package/esm/oidc/util/validateToken.js +0 -21
  344. package/esm/oidc/util/validateToken.js.map +0 -1
  345. package/esm/oidc/verifyToken.js +0 -78
  346. package/esm/oidc/verifyToken.js.map +0 -1
  347. package/esm/options.js +0 -134
  348. package/esm/options.js.map +0 -1
  349. package/esm/server/serverStorage.js +0 -110
  350. package/esm/server/serverStorage.js.map +0 -1
  351. package/esm/services/TokenService.js +0 -103
  352. package/esm/services/TokenService.js.map +0 -1
  353. package/esm/session.js +0 -81
  354. package/esm/session.js.map +0 -1
  355. package/esm/tx/AuthTransaction.js +0 -215
  356. package/esm/tx/AuthTransaction.js.map +0 -1
  357. package/esm/tx/TransactionState.js.map +0 -1
  358. package/esm/tx/api.js +0 -84
  359. package/esm/tx/api.js.map +0 -1
  360. package/esm/tx/index.js +0 -18
  361. package/esm/tx/index.js.map +0 -1
  362. package/esm/tx/poll.js +0 -124
  363. package/esm/tx/poll.js.map +0 -1
  364. package/esm/tx/util.js +0 -26
  365. package/esm/tx/util.js.map +0 -1
  366. package/esm/types/AuthState.js +0 -3
  367. package/esm/types/Cookies.js +0 -3
  368. package/esm/types/EventEmitter.js +0 -3
  369. package/esm/types/EventEmitter.js.map +0 -1
  370. package/esm/types/JWT.js +0 -3
  371. package/esm/types/JWT.js.map +0 -1
  372. package/esm/types/OAuth.js +0 -3
  373. package/esm/types/OAuth.js.map +0 -1
  374. package/esm/types/OktaAuthOptions.js +0 -3
  375. package/esm/types/OktaAuthOptions.js.map +0 -1
  376. package/esm/types/Storage.js +0 -3
  377. package/esm/types/Storage.js.map +0 -1
  378. package/esm/types/Token.js +0 -29
  379. package/esm/types/Token.js.map +0 -1
  380. package/esm/types/TokenManager.js +0 -3
  381. package/esm/types/TokenManager.js.map +0 -1
  382. package/esm/types/Transaction.js +0 -57
  383. package/esm/types/Transaction.js.map +0 -1
  384. package/esm/types/UserClaims.js +0 -3
  385. package/esm/types/UserClaims.js.map +0 -1
  386. package/esm/types/api.js +0 -3
  387. package/esm/types/api.js.map +0 -1
  388. package/esm/types/http.js +0 -3
  389. package/esm/types/http.js.map +0 -1
  390. package/esm/types/index.js +0 -27
  391. package/esm/types/index.js.map +0 -1
  392. package/esm/util/console.js +0 -53
  393. package/esm/util/console.js.map +0 -1
  394. package/esm/util/index.js +0 -17
  395. package/esm/util/index.js.map +0 -1
  396. package/esm/util/misc.js +0 -33
  397. package/esm/util/misc.js.map +0 -1
  398. package/esm/util/object.js +0 -117
  399. package/esm/util/object.js.map +0 -1
  400. package/esm/util/sharedStorage.js +0 -43
  401. package/esm/util/sharedStorage.js.map +0 -1
  402. package/esm/util/types.js +0 -27
  403. package/esm/util/types.js.map +0 -1
  404. package/esm/util/url.js +0 -64
  405. package/esm/util/url.js.map +0 -1
package/esm/oidc/index.js DELETED
@@ -1,29 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- *
12
- */
13
- export * from './endpoints';
14
- export * from './util';
15
- export { decodeToken } from './decodeToken';
16
- export { revokeToken } from './revokeToken';
17
- export { renewToken } from './renewToken';
18
- export { renewTokensWithRefresh } from './renewTokensWithRefresh';
19
- export { renewTokens } from './renewTokens';
20
- export { verifyToken } from './verifyToken';
21
- export { getUserInfo } from './getUserInfo';
22
- export { handleOAuthResponse } from './handleOAuthResponse';
23
- export { exchangeCodeForTokens } from './exchangeCodeForTokens';
24
- export { getToken } from './getToken';
25
- export { getWithoutPrompt } from './getWithoutPrompt';
26
- export { getWithPopup } from './getWithPopup';
27
- export { getWithRedirect } from './getWithRedirect';
28
- export { parseFromUrl } from './parseFromUrl';
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/index.ts"],"names":["decodeToken","revokeToken","renewToken","renewTokensWithRefresh","renewTokens","verifyToken","getUserInfo","handleOAuthResponse","exchangeCodeForTokens","getToken","getWithoutPrompt","getWithPopup","getWithRedirect","parseFromUrl"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,aAAd;AACA,cAAc,QAAd;AAEA,SAASA,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,qBAAT,QAAsC,yBAAtC;AACA,SAASC,QAAT,QAAyB,YAAzB;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,YAAT,QAA6B,gBAA7B","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n *\n */\nexport * from './endpoints';\nexport * from './util';\n\nexport { decodeToken } from './decodeToken';\nexport { revokeToken } from './revokeToken';\nexport { renewToken } from './renewToken';\nexport { renewTokensWithRefresh } from './renewTokensWithRefresh';\nexport { renewTokens } from './renewTokens';\nexport { verifyToken } from './verifyToken';\nexport { getUserInfo } from './getUserInfo';\nexport { handleOAuthResponse } from './handleOAuthResponse';\nexport { exchangeCodeForTokens } from './exchangeCodeForTokens';\nexport { getToken } from './getToken';\nexport { getWithoutPrompt } from './getWithoutPrompt';\nexport { getWithPopup } from './getWithPopup';\nexport { getWithRedirect } from './getWithRedirect';\nexport { parseFromUrl } from './parseFromUrl';\n"],"file":"index.js"}
@@ -1,144 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
-
3
- /* eslint-disable complexity */
4
-
5
- /*!
6
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
7
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
8
- *
9
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- *
14
- * See the License for the specific language governing permissions and limitations under the License.
15
- *
16
- */
17
- import { AuthSdkError } from '../errors';
18
- import { isInteractionRequiredError, urlParamsToObject } from './util';
19
- import { isString } from '../util';
20
- import { handleOAuthResponse } from './handleOAuthResponse';
21
-
22
- function removeHash(sdk) {
23
- var nativeHistory = sdk.token.parseFromUrl._getHistory();
24
-
25
- var nativeDoc = sdk.token.parseFromUrl._getDocument();
26
-
27
- var nativeLoc = sdk.token.parseFromUrl._getLocation();
28
-
29
- if (nativeHistory && nativeHistory.replaceState) {
30
- nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.search);
31
- } else {
32
- nativeLoc.hash = '';
33
- }
34
- }
35
-
36
- function removeSearch(sdk) {
37
- var nativeHistory = sdk.token.parseFromUrl._getHistory();
38
-
39
- var nativeDoc = sdk.token.parseFromUrl._getDocument();
40
-
41
- var nativeLoc = sdk.token.parseFromUrl._getLocation();
42
-
43
- if (nativeHistory && nativeHistory.replaceState) {
44
- nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.hash);
45
- } else {
46
- nativeLoc.search = '';
47
- }
48
- }
49
-
50
- export function getResponseMode(sdk) {
51
- // https://openid.net/specs/openid-connect-core-1_0.html#Authentication
52
- var defaultResponseMode = sdk.options.pkce ? 'query' : 'fragment';
53
- var responseMode = sdk.options.responseMode || defaultResponseMode;
54
- return responseMode;
55
- }
56
- export function parseOAuthResponseFromUrl(sdk, options) {
57
- options = options || {};
58
-
59
- if (isString(options)) {
60
- options = {
61
- url: options
62
- };
63
- } else {
64
- options = options;
65
- }
66
-
67
- var url = options.url;
68
- var responseMode = options.responseMode || getResponseMode(sdk);
69
-
70
- var nativeLoc = sdk.token.parseFromUrl._getLocation();
71
-
72
- var paramStr;
73
-
74
- if (responseMode === 'query') {
75
- paramStr = url ? url.substring(url.indexOf('?')) : nativeLoc.search;
76
- } else {
77
- paramStr = url ? url.substring(url.indexOf('#')) : nativeLoc.hash;
78
- }
79
-
80
- if (!paramStr) {
81
- throw new AuthSdkError('Unable to parse a token from the url');
82
- }
83
-
84
- return urlParamsToObject(paramStr);
85
- }
86
- export function cleanOAuthResponseFromUrl(sdk, options) {
87
- // Clean hash or search from the url
88
- var responseMode = options.responseMode || getResponseMode(sdk);
89
- responseMode === 'query' ? removeSearch(sdk) : removeHash(sdk);
90
- }
91
- export function parseFromUrl(_x, _x2) {
92
- return _parseFromUrl.apply(this, arguments);
93
- }
94
-
95
- function _parseFromUrl() {
96
- _parseFromUrl = _asyncToGenerator(function* (sdk, options) {
97
- options = options || {};
98
-
99
- if (isString(options)) {
100
- options = {
101
- url: options
102
- };
103
- } else {
104
- options = options;
105
- }
106
-
107
- var res = parseOAuthResponseFromUrl(sdk, options);
108
- var state = res.state;
109
- var oauthParams = sdk.transactionManager.load({
110
- oauth: true,
111
- pkce: sdk.options.pkce,
112
- state
113
- });
114
-
115
- if (!oauthParams) {
116
- return Promise.reject(new AuthSdkError('Unable to retrieve OAuth redirect params from storage'));
117
- }
118
-
119
- var urls = oauthParams.urls;
120
- delete oauthParams.urls;
121
-
122
- if (!options.url) {
123
- // Clean hash or search from the url
124
- cleanOAuthResponseFromUrl(sdk, options);
125
- }
126
-
127
- return handleOAuthResponse(sdk, oauthParams, res, urls).catch(err => {
128
- if (!isInteractionRequiredError(err)) {
129
- sdk.transactionManager.clear({
130
- state
131
- });
132
- }
133
-
134
- throw err;
135
- }).then(res => {
136
- sdk.transactionManager.clear({
137
- state
138
- });
139
- return res;
140
- });
141
- });
142
- return _parseFromUrl.apply(this, arguments);
143
- }
144
- //# sourceMappingURL=parseFromUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/parseFromUrl.ts"],"names":["AuthSdkError","isInteractionRequiredError","urlParamsToObject","isString","handleOAuthResponse","removeHash","sdk","nativeHistory","token","parseFromUrl","_getHistory","nativeDoc","_getDocument","nativeLoc","_getLocation","replaceState","title","pathname","search","hash","removeSearch","getResponseMode","defaultResponseMode","options","pkce","responseMode","parseOAuthResponseFromUrl","url","paramStr","substring","indexOf","cleanOAuthResponseFromUrl","res","state","oauthParams","transactionManager","load","oauth","Promise","reject","urls","catch","err","clear","then"],"mappings":"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","sourcesContent":["/* eslint-disable complexity */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n *\n */\nimport { AuthSdkError } from '../errors';\nimport { isInteractionRequiredError, urlParamsToObject } from './util';\nimport {\n ParseFromUrlOptions,\n TokenResponse,\n CustomUrls,\n TransactionMeta,\n OAuthResponse\n} from '../types';\nimport { isString } from '../util';\nimport { handleOAuthResponse } from './handleOAuthResponse';\n\nfunction removeHash(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.search);\n } else {\n nativeLoc.hash = '';\n }\n}\n\nfunction removeSearch(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.hash);\n } else {\n nativeLoc.search = '';\n }\n}\n\nexport function getResponseMode(sdk): 'query' | 'fragment' {\n // https://openid.net/specs/openid-connect-core-1_0.html#Authentication\n var defaultResponseMode = sdk.options.pkce ? 'query' : 'fragment';\n var responseMode = sdk.options.responseMode || defaultResponseMode;\n return responseMode;\n}\n\nexport function parseOAuthResponseFromUrl(sdk, options: string | ParseFromUrlOptions): OAuthResponse {\n options = options || {};\n if (isString(options)) {\n options = { url: options } as ParseFromUrlOptions;\n } else {\n options = options as ParseFromUrlOptions;\n }\n\n var url = options.url;\n var responseMode = options.responseMode || getResponseMode(sdk);\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n var paramStr;\n\n if (responseMode === 'query') {\n paramStr = url ? url.substring(url.indexOf('?')) : nativeLoc.search;\n } else {\n paramStr = url ? url.substring(url.indexOf('#')) : nativeLoc.hash;\n }\n\n if (!paramStr) {\n throw new AuthSdkError('Unable to parse a token from the url');\n }\n\n return urlParamsToObject(paramStr);\n}\n\nexport function cleanOAuthResponseFromUrl(sdk, options: ParseFromUrlOptions) {\n // Clean hash or search from the url\n const responseMode = options.responseMode || getResponseMode(sdk);\n responseMode === 'query' ? removeSearch(sdk) : removeHash(sdk);\n}\n\nexport async function parseFromUrl(sdk, options: string | ParseFromUrlOptions): Promise<TokenResponse> {\n options = options || {};\n if (isString(options)) {\n options = { url: options } as ParseFromUrlOptions;\n } else {\n options = options as ParseFromUrlOptions;\n }\n\n const res: OAuthResponse = parseOAuthResponseFromUrl(sdk, options);\n const state = res.state;\n const oauthParams: TransactionMeta = sdk.transactionManager.load({\n oauth: true,\n pkce: sdk.options.pkce,\n state\n });\n if (!oauthParams) {\n return Promise.reject(new AuthSdkError('Unable to retrieve OAuth redirect params from storage'));\n }\n const urls: CustomUrls = oauthParams.urls as CustomUrls;\n delete oauthParams.urls;\n\n if (!options.url) {\n // Clean hash or search from the url\n cleanOAuthResponseFromUrl(sdk, options);\n }\n\n return handleOAuthResponse(sdk, oauthParams, res, urls)\n .catch(err => {\n if (!isInteractionRequiredError(err)) {\n sdk.transactionManager.clear({\n state\n });\n }\n throw err;\n })\n .then(res => {\n sdk.transactionManager.clear({\n state\n });\n return res;\n });\n\n}\n"],"file":"parseFromUrl.js"}
@@ -1,85 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
-
3
- /*!
4
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
6
- *
7
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- *
12
- * See the License for the specific language governing permissions and limitations under the License.
13
- *
14
- */
15
- import { AuthSdkError } from '../errors';
16
- import { isAccessToken, isIDToken } from '../types';
17
- import { getWithoutPrompt } from './getWithoutPrompt';
18
- import { renewTokensWithRefresh } from './renewTokensWithRefresh';
19
-
20
- function throwInvalidTokenError() {
21
- throw new AuthSdkError('Renew must be passed a token with an array of scopes and an accessToken or idToken');
22
- } // Multiple tokens may have come back. Return only the token which was requested.
23
-
24
-
25
- function getSingleToken(originalToken, tokens) {
26
- if (isIDToken(originalToken)) {
27
- return tokens.idToken;
28
- }
29
-
30
- if (isAccessToken(originalToken)) {
31
- return tokens.accessToken;
32
- }
33
-
34
- throwInvalidTokenError();
35
- } // If we have a refresh token, renew using that, otherwise getWithoutPrompt
36
-
37
-
38
- export function renewToken(_x, _x2) {
39
- return _renewToken.apply(this, arguments);
40
- }
41
-
42
- function _renewToken() {
43
- _renewToken = _asyncToGenerator(function* (sdk, token) {
44
- if (!isIDToken(token) && !isAccessToken(token)) {
45
- throwInvalidTokenError();
46
- }
47
-
48
- var tokens = sdk.tokenManager.getTokensSync();
49
-
50
- if (tokens.refreshToken) {
51
- tokens = yield renewTokensWithRefresh(sdk, {
52
- scopes: token.scopes
53
- }, tokens.refreshToken);
54
- return getSingleToken(token, tokens);
55
- }
56
-
57
- var responseType;
58
-
59
- if (sdk.options.pkce) {
60
- responseType = 'code';
61
- } else if (isAccessToken(token)) {
62
- responseType = 'token';
63
- } else {
64
- responseType = 'id_token';
65
- }
66
-
67
- var {
68
- scopes,
69
- authorizeUrl,
70
- userinfoUrl,
71
- issuer
72
- } = token;
73
- return getWithoutPrompt(sdk, {
74
- responseType,
75
- scopes,
76
- authorizeUrl,
77
- userinfoUrl,
78
- issuer
79
- }).then(function (res) {
80
- return getSingleToken(token, res.tokens);
81
- });
82
- });
83
- return _renewToken.apply(this, arguments);
84
- }
85
- //# sourceMappingURL=renewToken.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/renewToken.ts"],"names":["AuthSdkError","isAccessToken","isIDToken","getWithoutPrompt","renewTokensWithRefresh","throwInvalidTokenError","getSingleToken","originalToken","tokens","idToken","accessToken","renewToken","sdk","token","tokenManager","getTokensSync","refreshToken","scopes","responseType","options","pkce","authorizeUrl","userinfoUrl","issuer","then","res"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,WAA7B;AACA,SAAkCC,aAAlC,EAAuEC,SAAvE,QAAwF,UAAxF;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;;AAEA,SAASC,sBAAT,GAAkC;AAChC,QAAM,IAAIL,YAAJ,CACJ,oFADI,CAAN;AAGD,C,CAED;;;AACA,SAASM,cAAT,CAAwBC,aAAxB,EAA8CC,MAA9C,EAA8D;AAC5D,MAAIN,SAAS,CAACK,aAAD,CAAb,EAA8B;AAC5B,WAAOC,MAAM,CAACC,OAAd;AACD;;AACD,MAAIR,aAAa,CAACM,aAAD,CAAjB,EAAkC;AAChC,WAAOC,MAAM,CAACE,WAAd;AACD;;AACDL,EAAAA,sBAAsB;AACvB,C,CAED;;;AACA,gBAAsBM,UAAtB;AAAA;AAAA;;;kCAAO,WAA0BC,GAA1B,EAAyCC,KAAzC,EAAuE;AAC5E,QAAI,CAACX,SAAS,CAACW,KAAD,CAAV,IAAqB,CAACZ,aAAa,CAACY,KAAD,CAAvC,EAAgD;AAC9CR,MAAAA,sBAAsB;AACvB;;AAED,QAAIG,MAAM,GAAGI,GAAG,CAACE,YAAJ,CAAiBC,aAAjB,EAAb;;AACA,QAAIP,MAAM,CAACQ,YAAX,EAAyB;AACvBR,MAAAA,MAAM,SAASJ,sBAAsB,CAACQ,GAAD,EAAM;AACzCK,QAAAA,MAAM,EAAEJ,KAAK,CAACI;AAD2B,OAAN,EAElCT,MAAM,CAACQ,YAF2B,CAArC;AAGA,aAAOV,cAAc,CAACO,KAAD,EAAQL,MAAR,CAArB;AACD;;AAED,QAAIU,YAAJ;;AACA,QAAIN,GAAG,CAACO,OAAJ,CAAYC,IAAhB,EAAsB;AACpBF,MAAAA,YAAY,GAAG,MAAf;AACD,KAFD,MAEO,IAAIjB,aAAa,CAACY,KAAD,CAAjB,EAA0B;AAC/BK,MAAAA,YAAY,GAAG,OAAf;AACD,KAFM,MAEA;AACLA,MAAAA,YAAY,GAAG,UAAf;AACD;;AAED,QAAM;AAAED,MAAAA,MAAF;AAAUI,MAAAA,YAAV;AAAwBC,MAAAA,WAAxB;AAAqCC,MAAAA;AAArC,QAAgDV,KAAtD;AACA,WAAOV,gBAAgB,CAACS,GAAD,EAAM;AAC3BM,MAAAA,YAD2B;AAE3BD,MAAAA,MAF2B;AAG3BI,MAAAA,YAH2B;AAI3BC,MAAAA,WAJ2B;AAK3BC,MAAAA;AAL2B,KAAN,CAAhB,CAOJC,IAPI,CAOC,UAAUC,GAAV,EAAe;AACnB,aAAOnB,cAAc,CAACO,KAAD,EAAQY,GAAG,CAACjB,MAAZ,CAArB;AACD,KATI,CAAP;AAUD,G","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 { AuthSdkError } from '../errors';\nimport { OktaAuth, Token, Tokens, isAccessToken, AccessToken, IDToken, isIDToken } from '../types';\nimport { getWithoutPrompt } from './getWithoutPrompt';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh';\n\nfunction throwInvalidTokenError() {\n throw new AuthSdkError(\n 'Renew must be passed a token with an array of scopes and an accessToken or idToken'\n );\n}\n\n// Multiple tokens may have come back. Return only the token which was requested.\nfunction getSingleToken(originalToken: Token, tokens: Tokens) {\n if (isIDToken(originalToken)) {\n return tokens.idToken;\n }\n if (isAccessToken(originalToken)) {\n return tokens.accessToken;\n }\n throwInvalidTokenError();\n}\n\n// If we have a refresh token, renew using that, otherwise getWithoutPrompt\nexport async function renewToken(sdk: OktaAuth, token: Token): Promise<Token> {\n if (!isIDToken(token) && !isAccessToken(token)) {\n throwInvalidTokenError();\n }\n\n let tokens = sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n tokens = await renewTokensWithRefresh(sdk, {\n scopes: token.scopes,\n }, tokens.refreshToken);\n return getSingleToken(token, tokens);\n }\n\n var responseType;\n if (sdk.options.pkce) {\n responseType = 'code';\n } else if (isAccessToken(token)) {\n responseType = 'token';\n } else {\n responseType = 'id_token';\n }\n\n const { scopes, authorizeUrl, userinfoUrl, issuer } = token as (AccessToken & IDToken);\n return getWithoutPrompt(sdk, {\n responseType,\n scopes,\n authorizeUrl,\n userinfoUrl,\n issuer\n })\n .then(function (res) {\n return getSingleToken(token, res.tokens);\n });\n}\n"],"file":"renewToken.js"}
@@ -1,52 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
-
3
- /*!
4
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
6
- *
7
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- *
12
- * See the License for the specific language governing permissions and limitations under the License.
13
- *
14
- */
15
- import { getWithoutPrompt } from './getWithoutPrompt';
16
- import { renewTokensWithRefresh } from './renewTokensWithRefresh';
17
- import { getDefaultTokenParams } from './util'; // If we have a refresh token, renew using that, otherwise getWithoutPrompt
18
-
19
- export function renewTokens(_x, _x2) {
20
- return _renewTokens.apply(this, arguments);
21
- }
22
-
23
- function _renewTokens() {
24
- _renewTokens = _asyncToGenerator(function* (sdk, options) {
25
- var tokens = sdk.tokenManager.getTokensSync();
26
-
27
- if (tokens.refreshToken) {
28
- return renewTokensWithRefresh(sdk, options, tokens.refreshToken);
29
- } // Get tokens using the SSO cookie
30
-
31
-
32
- options = Object.assign({
33
- scopes: sdk.options.scopes,
34
- authorizeUrl: sdk.options.authorizeUrl,
35
- userinfoUrl: sdk.options.userinfoUrl,
36
- issuer: sdk.options.issuer
37
- }, options);
38
-
39
- if (sdk.options.pkce) {
40
- options.responseType = 'code';
41
- } else {
42
- var {
43
- responseType
44
- } = getDefaultTokenParams(sdk);
45
- options.responseType = responseType;
46
- }
47
-
48
- return getWithoutPrompt(sdk, options).then(res => res.tokens);
49
- });
50
- return _renewTokens.apply(this, arguments);
51
- }
52
- //# sourceMappingURL=renewTokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/renewTokens.ts"],"names":["getWithoutPrompt","renewTokensWithRefresh","getDefaultTokenParams","renewTokens","sdk","options","tokens","tokenManager","getTokensSync","refreshToken","Object","assign","scopes","authorizeUrl","userinfoUrl","issuer","pkce","responseType","then","res"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,gBAAT,QAAiC,oBAAjC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,qBAAT,QAAsC,QAAtC,C,CAEA;;AACA,gBAAsBC,WAAtB;AAAA;AAAA;;;mCAAO,WAA2BC,GAA3B,EAAgCC,OAAhC,EAAuE;AAC5E,QAAMC,MAAM,GAAGF,GAAG,CAACG,YAAJ,CAAiBC,aAAjB,EAAf;;AACA,QAAIF,MAAM,CAACG,YAAX,EAAyB;AACvB,aAAOR,sBAAsB,CAACG,GAAD,EAAMC,OAAN,EAAeC,MAAM,CAACG,YAAtB,CAA7B;AACD,KAJ2E,CAM5E;;;AACAJ,IAAAA,OAAO,GAAGK,MAAM,CAACC,MAAP,CAAc;AACtBC,MAAAA,MAAM,EAAER,GAAG,CAACC,OAAJ,CAAYO,MADE;AAEtBC,MAAAA,YAAY,EAAET,GAAG,CAACC,OAAJ,CAAYQ,YAFJ;AAGtBC,MAAAA,WAAW,EAAEV,GAAG,CAACC,OAAJ,CAAYS,WAHH;AAItBC,MAAAA,MAAM,EAAEX,GAAG,CAACC,OAAJ,CAAYU;AAJE,KAAd,EAKPV,OALO,CAAV;;AAOA,QAAID,GAAG,CAACC,OAAJ,CAAYW,IAAhB,EAAsB;AACpBX,MAAAA,OAAO,CAACY,YAAR,GAAuB,MAAvB;AACD,KAFD,MAEO;AACL,UAAM;AAAEA,QAAAA;AAAF,UAAmBf,qBAAqB,CAACE,GAAD,CAA9C;AACAC,MAAAA,OAAO,CAACY,YAAR,GAAuBA,YAAvB;AACD;;AAED,WAAOjB,gBAAgB,CAACI,GAAD,EAAMC,OAAN,CAAhB,CACJa,IADI,CACCC,GAAG,IAAIA,GAAG,CAACb,MADZ,CAAP;AAGD,G","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 { TokenParams, Tokens } from '../types';\nimport { getWithoutPrompt } from './getWithoutPrompt';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh';\nimport { getDefaultTokenParams } from './util';\n\n// If we have a refresh token, renew using that, otherwise getWithoutPrompt\nexport async function renewTokens(sdk, options: TokenParams): Promise<Tokens> {\n const tokens = sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n return renewTokensWithRefresh(sdk, options, tokens.refreshToken);\n }\n\n // Get tokens using the SSO cookie\n options = Object.assign({\n scopes: sdk.options.scopes,\n authorizeUrl: sdk.options.authorizeUrl,\n userinfoUrl: sdk.options.userinfoUrl,\n issuer: sdk.options.issuer\n }, options);\n\n if (sdk.options.pkce) {\n options.responseType = 'code';\n } else {\n const { responseType } = getDefaultTokenParams(sdk);\n options.responseType = responseType;\n }\n\n return getWithoutPrompt(sdk, options)\n .then(res => res.tokens);\n \n}\n"],"file":"renewTokens.js"}
@@ -1,55 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
-
3
- /*!
4
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
6
- *
7
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- *
12
- * See the License for the specific language governing permissions and limitations under the License.
13
- *
14
- */
15
- import { AuthSdkError } from '../errors';
16
- import { getOAuthUrls } from './util/oauth';
17
- import { isSameRefreshToken } from './util/refreshToken';
18
- import { handleOAuthResponse } from './handleOAuthResponse';
19
- import { postRefreshToken } from './endpoints/token';
20
- export function renewTokensWithRefresh(_x, _x2, _x3) {
21
- return _renewTokensWithRefresh.apply(this, arguments);
22
- }
23
-
24
- function _renewTokensWithRefresh() {
25
- _renewTokensWithRefresh = _asyncToGenerator(function* (sdk, tokenParams, refreshTokenObject) {
26
- var {
27
- clientId
28
- } = sdk.options;
29
-
30
- if (!clientId) {
31
- throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to renew tokens');
32
- }
33
-
34
- var renewTokenParams = Object.assign({}, tokenParams, {
35
- clientId
36
- });
37
- var tokenResponse = yield postRefreshToken(sdk, renewTokenParams, refreshTokenObject);
38
- var urls = getOAuthUrls(sdk, tokenParams);
39
- var {
40
- tokens
41
- } = yield handleOAuthResponse(sdk, renewTokenParams, tokenResponse, urls); // Support rotating refresh tokens
42
-
43
- var {
44
- refreshToken
45
- } = tokens;
46
-
47
- if (refreshToken && !isSameRefreshToken(refreshToken, refreshTokenObject)) {
48
- sdk.tokenManager.updateRefreshToken(refreshToken);
49
- }
50
-
51
- return tokens;
52
- });
53
- return _renewTokensWithRefresh.apply(this, arguments);
54
- }
55
- //# sourceMappingURL=renewTokensWithRefresh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/renewTokensWithRefresh.ts"],"names":["AuthSdkError","getOAuthUrls","isSameRefreshToken","handleOAuthResponse","postRefreshToken","renewTokensWithRefresh","sdk","tokenParams","refreshTokenObject","clientId","options","renewTokenParams","Object","assign","tokenResponse","urls","tokens","refreshToken","tokenManager","updateRefreshToken"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,WAA7B;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,SAASC,kBAAT,QAAmC,qBAAnC;AAEA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,mBAAjC;AAEA,gBAAsBC,sBAAtB;AAAA;AAAA;;;8CAAO,WACLC,GADK,EAELC,WAFK,EAGLC,kBAHK,EAIY;AACjB,QAAM;AAAEC,MAAAA;AAAF,QAAeH,GAAG,CAACI,OAAzB;;AACA,QAAI,CAACD,QAAL,EAAe;AACb,YAAM,IAAIT,YAAJ,CAAiB,0EAAjB,CAAN;AACD;;AAED,QAAMW,gBAA6B,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBN,WAAlB,EAA+B;AACnEE,MAAAA;AADmE,KAA/B,CAAtC;AAGA,QAAMK,aAAa,SAASV,gBAAgB,CAACE,GAAD,EAAMK,gBAAN,EAAwBH,kBAAxB,CAA5C;AACA,QAAMO,IAAI,GAAGd,YAAY,CAACK,GAAD,EAAMC,WAAN,CAAzB;AACA,QAAM;AAAES,MAAAA;AAAF,cAAmBb,mBAAmB,CAACG,GAAD,EAAMK,gBAAN,EAAwBG,aAAxB,EAAuCC,IAAvC,CAA5C,CAXiB,CAajB;;AACA,QAAM;AAAEE,MAAAA;AAAF,QAAmBD,MAAzB;;AACA,QAAIC,YAAY,IAAI,CAACf,kBAAkB,CAACe,YAAD,EAAeT,kBAAf,CAAvC,EAA2E;AACzEF,MAAAA,GAAG,CAACY,YAAJ,CAAiBC,kBAAjB,CAAoCF,YAApC;AACD;;AAED,WAAOD,MAAP;AACD,G","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 { AuthSdkError } from '../errors';\nimport { getOAuthUrls } from './util/oauth';\nimport { isSameRefreshToken } from './util/refreshToken';\nimport { OktaAuth, TokenParams, RefreshToken, Tokens } from '../types';\nimport { handleOAuthResponse } from './handleOAuthResponse';\nimport { postRefreshToken } from './endpoints/token';\n\nexport async function renewTokensWithRefresh(\n sdk: OktaAuth,\n tokenParams: TokenParams,\n refreshTokenObject: RefreshToken\n): Promise<Tokens> {\n const { clientId } = sdk.options;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to renew tokens');\n }\n\n const renewTokenParams: TokenParams = Object.assign({}, tokenParams, {\n clientId,\n });\n const tokenResponse = await postRefreshToken(sdk, renewTokenParams, refreshTokenObject);\n const urls = getOAuthUrls(sdk, tokenParams);\n const { tokens } = await handleOAuthResponse(sdk, renewTokenParams, tokenResponse, urls);\n\n // Support rotating refresh tokens\n const { refreshToken } = tokens;\n if (refreshToken && !isSameRefreshToken(refreshToken, refreshTokenObject)) {\n sdk.tokenManager.updateRefreshToken(refreshToken);\n }\n\n return tokens;\n}\n"],"file":"renewTokensWithRefresh.js"}
@@ -1,57 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- *
12
- */
13
-
14
- /* eslint complexity:[0,8] */
15
- import { post } from '../http';
16
- import { toQueryString } from '../util';
17
- import { getOAuthUrls } from './util/oauth';
18
- import { btoa } from '../crypto';
19
- import AuthSdkError from '../errors/AuthSdkError';
20
- // refresh tokens have precedence to be revoked if no token is specified
21
- export function revokeToken(sdk, token) {
22
- return Promise.resolve().then(function () {
23
- var accessToken;
24
- var refreshToken;
25
-
26
- if (token) {
27
- accessToken = token.accessToken;
28
- refreshToken = token.refreshToken;
29
- }
30
-
31
- if (!accessToken && !refreshToken) {
32
- throw new AuthSdkError('A valid access or refresh token object is required');
33
- }
34
-
35
- var clientId = sdk.options.clientId;
36
- var clientSecret = sdk.options.clientSecret;
37
-
38
- if (!clientId) {
39
- throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to revoke a token');
40
- }
41
-
42
- var revokeUrl = getOAuthUrls(sdk).revokeUrl;
43
- var args = toQueryString({
44
- // eslint-disable-next-line camelcase
45
- token_type_hint: refreshToken ? 'refresh_token' : 'access_token',
46
- token: refreshToken || accessToken
47
- }).slice(1);
48
- var creds = clientSecret ? btoa("".concat(clientId, ":").concat(clientSecret)) : btoa(clientId);
49
- return post(sdk, revokeUrl, args, {
50
- headers: {
51
- 'Content-Type': 'application/x-www-form-urlencoded',
52
- 'Authorization': 'Basic ' + creds
53
- }
54
- });
55
- });
56
- }
57
- //# sourceMappingURL=revokeToken.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/oidc/revokeToken.ts"],"names":["post","toQueryString","getOAuthUrls","btoa","AuthSdkError","revokeToken","sdk","token","Promise","resolve","then","accessToken","refreshToken","clientId","options","clientSecret","revokeUrl","args","token_type_hint","slice","creds","headers"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,IAAT,QAAqB,SAArB;AACA,SAASC,aAAT,QAA8B,SAA9B;AACA,SACEC,YADF,QAEO,cAFP;AAGA,SAASC,IAAT,QAAqB,WAArB;AACA,OAAOC,YAAP,MAAyB,wBAAzB;AAQA;AACA,OAAO,SAASC,WAAT,CAAqBC,GAArB,EAAoCC,KAApC,EAAyE;AAC9E,SAAOC,OAAO,CAACC,OAAR,GACJC,IADI,CACC,YAAY;AAChB,QAAIC,WAAJ;AACA,QAAIC,YAAJ;;AACA,QAAIL,KAAJ,EAAW;AACPI,MAAAA,WAAW,GAAIJ,KAAD,CAAuBI,WAArC;AACAC,MAAAA,YAAY,GAAIL,KAAD,CAAwBK,YAAvC;AACH;;AAED,QAAG,CAACD,WAAD,IAAgB,CAACC,YAApB,EAAkC;AAChC,YAAM,IAAIR,YAAJ,CAAiB,oDAAjB,CAAN;AACD;;AACD,QAAIS,QAAQ,GAAGP,GAAG,CAACQ,OAAJ,CAAYD,QAA3B;AACA,QAAIE,YAAY,GAAGT,GAAG,CAACQ,OAAJ,CAAYC,YAA/B;;AACA,QAAI,CAACF,QAAL,EAAe;AACb,YAAM,IAAIT,YAAJ,CAAiB,4EAAjB,CAAN;AACD;;AACD,QAAIY,SAAS,GAAGd,YAAY,CAACI,GAAD,CAAZ,CAAkBU,SAAlC;AACA,QAAIC,IAAI,GAAGhB,aAAa,CAAC;AACvB;AACAiB,MAAAA,eAAe,EAAEN,YAAY,GAAG,eAAH,GAAqB,cAF3B;AAGvBL,MAAAA,KAAK,EAAEK,YAAY,IAAID;AAHA,KAAD,CAAb,CAIRQ,KAJQ,CAIF,CAJE,CAAX;AAKA,QAAIC,KAAK,GAAGL,YAAY,GAAGZ,IAAI,WAAIU,QAAJ,cAAgBE,YAAhB,EAAP,GAAyCZ,IAAI,CAACU,QAAD,CAArE;AACA,WAAOb,IAAI,CAACM,GAAD,EAAMU,SAAN,EAAiBC,IAAjB,EAAuB;AAChCI,MAAAA,OAAO,EAAE;AACP,wBAAgB,mCADT;AAEP,yBAAiB,WAAWD;AAFrB;AADuB,KAAvB,CAAX;AAMD,GA9BI,CAAP;AA+BD","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/* eslint complexity:[0,8] */\nimport { post } from '../http';\nimport { toQueryString } from '../util';\nimport {\n getOAuthUrls,\n} from './util/oauth';\nimport { btoa } from '../crypto';\nimport AuthSdkError from '../errors/AuthSdkError';\nimport {\n OktaAuth,\n RevocableToken,\n AccessToken,\n RefreshToken\n} from '../types';\n\n// refresh tokens have precedence to be revoked if no token is specified\nexport function revokeToken(sdk: OktaAuth, token: RevocableToken): Promise<any> {\n return Promise.resolve()\n .then(function () {\n var accessToken: string;\n var refreshToken: string;\n if (token) { \n accessToken = (token as AccessToken).accessToken;\n refreshToken = (token as RefreshToken).refreshToken; \n }\n \n if(!accessToken && !refreshToken) { \n throw new AuthSdkError('A valid access or refresh token object is required');\n }\n var clientId = sdk.options.clientId;\n var clientSecret = sdk.options.clientSecret;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to revoke a token');\n }\n var revokeUrl = getOAuthUrls(sdk).revokeUrl;\n var args = toQueryString({\n // eslint-disable-next-line camelcase\n token_type_hint: refreshToken ? 'refresh_token' : 'access_token', \n token: refreshToken || accessToken,\n }).slice(1);\n var creds = clientSecret ? btoa(`${clientId}:${clientSecret}`) : btoa(clientId);\n return post(sdk, revokeUrl, args, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Basic ' + creds\n }\n });\n });\n}"],"file":"revokeToken.js"}
@@ -1,85 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- *
12
- */
13
-
14
- /* global window, document */
15
-
16
- /* eslint-disable complexity, max-statements */
17
- import { AuthSdkError } from '../../errors';
18
- import { isIE11OrLess } from '../../features';
19
- export function addListener(eventTarget, name, fn) {
20
- if (eventTarget.addEventListener) {
21
- eventTarget.addEventListener(name, fn);
22
- } else {
23
- eventTarget.attachEvent('on' + name, fn);
24
- }
25
- }
26
- export function removeListener(eventTarget, name, fn) {
27
- if (eventTarget.removeEventListener) {
28
- eventTarget.removeEventListener(name, fn);
29
- } else {
30
- eventTarget.detachEvent('on' + name, fn);
31
- }
32
- }
33
- export function loadFrame(src) {
34
- var iframe = document.createElement('iframe');
35
- iframe.style.display = 'none';
36
- iframe.src = src;
37
- return document.body.appendChild(iframe);
38
- }
39
- export function loadPopup(src, options) {
40
- var title = options.popupTitle || 'External Identity Provider User Authentication';
41
- var appearance = 'toolbar=no, scrollbars=yes, resizable=yes, ' + 'top=100, left=500, width=600, height=600';
42
-
43
- if (isIE11OrLess()) {
44
- // IE<=11 doesn't fully support postMessage at time of writting.
45
- // the following simple solution happened to solve the issue
46
- // without adding another proxy layer which makes flow more complecated.
47
- var winEl = window.open('/', title, appearance);
48
- winEl.location.href = src;
49
- return winEl;
50
- } else {
51
- return window.open(src, title, appearance);
52
- }
53
- }
54
- export function addPostMessageListener(sdk, timeout, state) {
55
- var responseHandler;
56
- var timeoutId;
57
- var msgReceivedOrTimeout = new Promise(function (resolve, reject) {
58
- responseHandler = function responseHandler(e) {
59
- if (!e.data || e.data.state !== state) {
60
- // A message not meant for us
61
- return;
62
- } // Configuration mismatch between saved token and current app instance
63
- // This may happen if apps with different issuers are running on the same host url
64
- // If they share the same storage key, they may read and write tokens in the same location.
65
- // Common when developing against http://localhost
66
-
67
-
68
- if (e.origin !== sdk.getIssuerOrigin()) {
69
- return reject(new AuthSdkError('The request does not match client configuration'));
70
- }
71
-
72
- resolve(e.data);
73
- };
74
-
75
- addListener(window, 'message', responseHandler);
76
- timeoutId = setTimeout(function () {
77
- reject(new AuthSdkError('OAuth flow timed out'));
78
- }, timeout || 120000);
79
- });
80
- return msgReceivedOrTimeout.finally(function () {
81
- clearTimeout(timeoutId);
82
- removeListener(window, 'message', responseHandler);
83
- });
84
- }
85
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/browser.ts"],"names":["AuthSdkError","isIE11OrLess","addListener","eventTarget","name","fn","addEventListener","attachEvent","removeListener","removeEventListener","detachEvent","loadFrame","src","iframe","document","createElement","style","display","body","appendChild","loadPopup","options","title","popupTitle","appearance","winEl","window","open","location","href","addPostMessageListener","sdk","timeout","state","responseHandler","timeoutId","msgReceivedOrTimeout","Promise","resolve","reject","e","data","origin","getIssuerOrigin","setTimeout","finally","clearTimeout"],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n *\n */\n/* global window, document */\n/* eslint-disable complexity, max-statements */\nimport { AuthSdkError } from '../../errors';\nimport { OktaAuth } from '../../types';\nimport { isIE11OrLess } from '../../features';\n\nexport function addListener(eventTarget, name, fn) {\n if (eventTarget.addEventListener) {\n eventTarget.addEventListener(name, fn);\n } else {\n eventTarget.attachEvent('on' + name, fn);\n }\n}\n\nexport function removeListener(eventTarget, name, fn) {\n if (eventTarget.removeEventListener) {\n eventTarget.removeEventListener(name, fn);\n } else {\n eventTarget.detachEvent('on' + name, fn);\n }\n}\n\nexport function loadFrame(src) {\n var iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n iframe.src = src;\n\n return document.body.appendChild(iframe);\n}\n\nexport function loadPopup(src, options) {\n var title = options.popupTitle || 'External Identity Provider User Authentication';\n var appearance = 'toolbar=no, scrollbars=yes, resizable=yes, ' +\n 'top=100, left=500, width=600, height=600';\n\n if (isIE11OrLess()) {\n // IE<=11 doesn't fully support postMessage at time of writting.\n // the following simple solution happened to solve the issue\n // without adding another proxy layer which makes flow more complecated.\n var winEl = window.open('/', title, appearance);\n winEl.location.href = src;\n return winEl;\n } else {\n return window.open(src, title, appearance);\n }\n}\n\nexport function addPostMessageListener(sdk: OktaAuth, timeout, state) {\n var responseHandler;\n var timeoutId;\n var msgReceivedOrTimeout = new Promise(function (resolve, reject) {\n\n responseHandler = function responseHandler(e) {\n if (!e.data || e.data.state !== state) {\n // A message not meant for us\n return;\n }\n\n // Configuration mismatch between saved token and current app instance\n // This may happen if apps with different issuers are running on the same host url\n // If they share the same storage key, they may read and write tokens in the same location.\n // Common when developing against http://localhost\n if (e.origin !== sdk.getIssuerOrigin()) {\n return reject(new AuthSdkError('The request does not match client configuration'));\n }\n resolve(e.data);\n };\n\n addListener(window, 'message', responseHandler);\n\n timeoutId = setTimeout(function () {\n reject(new AuthSdkError('OAuth flow timed out'));\n }, timeout || 120000);\n });\n\n return msgReceivedOrTimeout\n .finally(function () {\n clearTimeout(timeoutId);\n removeListener(window, 'message', responseHandler);\n });\n}\n"],"file":"browser.js"}
@@ -1,42 +0,0 @@
1
- /* global window */
2
-
3
- /*!
4
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
6
- *
7
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8
- * Unless required by applicable law or agreed to in writing, software
9
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- *
12
- * See the License for the specific language governing permissions and limitations under the License.
13
- *
14
- */
15
- import { generateNonce, generateState } from './oauth';
16
- import { isBrowser } from '../../features';
17
- import { removeNils } from '../../util';
18
- export function getDefaultTokenParams(sdk) {
19
- var {
20
- pkce,
21
- clientId,
22
- redirectUri,
23
- responseType,
24
- responseMode,
25
- scopes,
26
- state,
27
- ignoreSignature
28
- } = sdk.options;
29
- var defaultRedirectUri = isBrowser() ? window.location.href : undefined;
30
- return removeNils({
31
- pkce,
32
- clientId,
33
- redirectUri: redirectUri || defaultRedirectUri,
34
- responseType: responseType || ['token', 'id_token'],
35
- responseMode,
36
- state: state || generateState(),
37
- nonce: generateNonce(),
38
- scopes: scopes || ['openid', 'email'],
39
- ignoreSignature
40
- });
41
- }
42
- //# sourceMappingURL=defaultTokenParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/defaultTokenParams.ts"],"names":["generateNonce","generateState","isBrowser","removeNils","getDefaultTokenParams","sdk","pkce","clientId","redirectUri","responseType","responseMode","scopes","state","ignoreSignature","options","defaultRedirectUri","window","location","href","undefined","nonce"],"mappings":"AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,aAAxB,QAA6C,SAA7C;AAEA,SAASC,SAAT,QAA0B,gBAA1B;AACA,SAASC,UAAT,QAA2B,YAA3B;AAEA,OAAO,SAASC,qBAAT,CAA+BC,GAA/B,EAA2D;AAChE,MAAM;AACJC,IAAAA,IADI;AAEJC,IAAAA,QAFI;AAGJC,IAAAA,WAHI;AAIJC,IAAAA,YAJI;AAKJC,IAAAA,YALI;AAMJC,IAAAA,MANI;AAOJC,IAAAA,KAPI;AAQJC,IAAAA;AARI,MASFR,GAAG,CAACS,OATR;AAUA,MAAMC,kBAAkB,GAAGb,SAAS,KAAKc,MAAM,CAACC,QAAP,CAAgBC,IAArB,GAA4BC,SAAhE;AACA,SAAOhB,UAAU,CAAC;AAChBG,IAAAA,IADgB;AAEhBC,IAAAA,QAFgB;AAGhBC,IAAAA,WAAW,EAAEA,WAAW,IAAIO,kBAHZ;AAIhBN,IAAAA,YAAY,EAAEA,YAAY,IAAI,CAAC,OAAD,EAAU,UAAV,CAJd;AAKhBC,IAAAA,YALgB;AAMhBE,IAAAA,KAAK,EAAEA,KAAK,IAAIX,aAAa,EANb;AAOhBmB,IAAAA,KAAK,EAAEpB,aAAa,EAPJ;AAQhBW,IAAAA,MAAM,EAAEA,MAAM,IAAI,CAAC,QAAD,EAAW,OAAX,CARF;AAShBE,IAAAA;AATgB,GAAD,CAAjB;AAWD","sourcesContent":["\n/* global window */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n *\n */\nimport { generateNonce, generateState } from './oauth';\nimport { OktaAuth, TokenParams } from '../../types';\nimport { isBrowser } from '../../features';\nimport { removeNils } from '../../util';\n\nexport function getDefaultTokenParams(sdk: OktaAuth): TokenParams {\n const {\n pkce,\n clientId,\n redirectUri,\n responseType,\n responseMode,\n scopes,\n state,\n ignoreSignature\n } = sdk.options;\n const defaultRedirectUri = isBrowser() ? window.location.href : undefined;\n return removeNils({\n pkce,\n clientId,\n redirectUri: redirectUri || defaultRedirectUri,\n responseType: responseType || ['token', 'id_token'],\n responseMode,\n state: state || generateState(),\n nonce: generateNonce(),\n scopes: scopes || ['openid', 'email'],\n ignoreSignature\n });\n}"],"file":"defaultTokenParams.js"}