@okta/okta-auth-js 5.8.0 → 5.9.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 (350) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/cjs/OktaAuth.js +11 -3
  3. package/cjs/OktaAuth.js.map +1 -1
  4. package/cjs/OktaUserAgent.js +2 -2
  5. package/cjs/TransactionManager.js +6 -2
  6. package/cjs/TransactionManager.js.map +1 -1
  7. package/cjs/features.js +1 -1
  8. package/cjs/features.js.map +1 -1
  9. package/cjs/idx/authenticate.js +3 -18
  10. package/cjs/idx/authenticate.js.map +1 -1
  11. package/cjs/idx/flow/AuthenticationFlow.js +30 -0
  12. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
  13. package/cjs/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.js +0 -0
  14. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +1 -0
  15. package/cjs/idx/{flowMonitors → flow}/FlowMonitor.js +0 -0
  16. package/cjs/idx/flow/FlowMonitor.js.map +1 -0
  17. package/cjs/idx/flow/FlowSpecification.js +49 -0
  18. package/cjs/idx/flow/FlowSpecification.js.map +1 -0
  19. package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
  20. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
  21. package/cjs/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.js +0 -0
  22. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +1 -0
  23. package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +15 -12
  24. package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
  25. package/cjs/idx/{flowMonitors → flow}/RegistrationFlowMonitor.js +0 -0
  26. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +1 -0
  27. package/cjs/idx/flow/RemediationFlow.js +2 -0
  28. package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
  29. package/cjs/idx/flow/index.js +119 -0
  30. package/cjs/idx/flow/index.js.map +1 -0
  31. package/cjs/idx/index.js +26 -0
  32. package/cjs/idx/index.js.map +1 -1
  33. package/cjs/idx/interact.js.map +1 -1
  34. package/cjs/idx/proceed.js +49 -0
  35. package/cjs/idx/proceed.js.map +1 -0
  36. package/cjs/idx/recoverPassword.js +3 -17
  37. package/cjs/idx/recoverPassword.js.map +1 -1
  38. package/cjs/idx/register.js +7 -16
  39. package/cjs/idx/register.js.map +1 -1
  40. package/cjs/idx/remediate.js +13 -13
  41. package/cjs/idx/remediate.js.map +1 -1
  42. package/cjs/idx/remediators/Identify.js +2 -1
  43. package/cjs/idx/remediators/Identify.js.map +1 -1
  44. package/cjs/idx/run.js +18 -12
  45. package/cjs/idx/run.js.map +1 -1
  46. package/cjs/idx/startTransaction.js +2 -0
  47. package/cjs/idx/startTransaction.js.map +1 -1
  48. package/cjs/idx/transactionMeta.js +67 -42
  49. package/cjs/idx/transactionMeta.js.map +1 -1
  50. package/cjs/idx/types/FlowIdentifier.js +2 -0
  51. package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
  52. package/cjs/idx/types/idx-js.js.map +1 -1
  53. package/cjs/idx/types/index.js +16 -0
  54. package/cjs/idx/types/index.js.map +1 -1
  55. package/cjs/oidc/endpoints/authorize.js +4 -1
  56. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  57. package/cjs/types/Transaction.js.map +1 -1
  58. package/dist/okta-auth-js.min.js +1 -1
  59. package/dist/okta-auth-js.min.js.map +1 -1
  60. package/dist/okta-auth-js.umd.js +1 -1
  61. package/dist/okta-auth-js.umd.js.map +1 -1
  62. package/esm/index.js +8368 -16
  63. package/esm/index.js.map +1 -1
  64. package/lib/TransactionManager.d.ts +1 -0
  65. package/{esm/crypto/webcrypto.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -4
  66. package/lib/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.d.ts +0 -0
  67. package/lib/idx/{flowMonitors → flow}/FlowMonitor.d.ts +0 -0
  68. package/lib/idx/flow/FlowSpecification.d.ts +10 -0
  69. package/{esm/oidc/endpoints/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -5
  70. package/lib/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.d.ts +0 -0
  71. package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
  72. package/lib/idx/{flowMonitors → flow}/RegistrationFlowMonitor.d.ts +0 -0
  73. package/{esm/crypto/index.js → lib/idx/flow/RemediationFlow.d.ts} +3 -6
  74. package/lib/idx/{flowMonitors → flow}/index.d.ts +7 -2
  75. package/lib/idx/index.d.ts +2 -0
  76. package/{esm/errors/AuthPollStopError.js → lib/idx/proceed.d.ts} +9 -9
  77. package/lib/idx/remediators/Identify.d.ts +1 -0
  78. package/lib/idx/run.d.ts +9 -10
  79. package/lib/idx/transactionMeta.d.ts +24 -1
  80. package/lib/idx/types/FlowIdentifier.d.ts +1 -0
  81. package/lib/idx/types/idx-js.d.ts +3 -0
  82. package/lib/idx/types/index.d.ts +8 -1
  83. package/lib/types/OktaAuthOptions.d.ts +2 -0
  84. package/lib/types/Transaction.d.ts +2 -0
  85. package/lib/types/api.d.ts +12 -1
  86. package/package.json +18 -7
  87. package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  88. package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
  89. package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  90. package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  91. package/cjs/idx/flowMonitors/index.js +0 -54
  92. package/cjs/idx/flowMonitors/index.js.map +0 -1
  93. package/esm/AuthStateManager.js +0 -214
  94. package/esm/AuthStateManager.js.map +0 -1
  95. package/esm/OktaAuth.js +0 -705
  96. package/esm/OktaAuth.js.map +0 -1
  97. package/esm/OktaUserAgent.js +0 -49
  98. package/esm/OktaUserAgent.js.map +0 -1
  99. package/esm/PromiseQueue.js +0 -71
  100. package/esm/PromiseQueue.js.map +0 -1
  101. package/esm/SavedObject.js +0 -91
  102. package/esm/SavedObject.js.map +0 -1
  103. package/esm/StorageManager.js +0 -190
  104. package/esm/StorageManager.js.map +0 -1
  105. package/esm/TokenManager.js +0 -455
  106. package/esm/TokenManager.js.map +0 -1
  107. package/esm/TransactionManager.js +0 -324
  108. package/esm/TransactionManager.js.map +0 -1
  109. package/esm/browser/browserStorage.js +0 -256
  110. package/esm/browser/browserStorage.js.map +0 -1
  111. package/esm/browser/fingerprint.js +0 -74
  112. package/esm/browser/fingerprint.js.map +0 -1
  113. package/esm/builderUtil.js +0 -56
  114. package/esm/builderUtil.js.map +0 -1
  115. package/esm/clock.js +0 -32
  116. package/esm/clock.js.map +0 -1
  117. package/esm/constants.js +0 -36
  118. package/esm/constants.js.map +0 -1
  119. package/esm/crypto/base64.js +0 -66
  120. package/esm/crypto/base64.js.map +0 -1
  121. package/esm/crypto/browser.js.map +0 -1
  122. package/esm/crypto/index.js.map +0 -1
  123. package/esm/crypto/node.js +0 -54
  124. package/esm/crypto/node.js.map +0 -1
  125. package/esm/crypto/oidcHash.js +0 -27
  126. package/esm/crypto/oidcHash.js.map +0 -1
  127. package/esm/crypto/verifyToken.js +0 -39
  128. package/esm/crypto/verifyToken.js.map +0 -1
  129. package/esm/crypto/webcrypto.js.map +0 -1
  130. package/esm/errors/AuthApiError.js +0 -30
  131. package/esm/errors/AuthApiError.js.map +0 -1
  132. package/esm/errors/AuthPollStopError.js.map +0 -1
  133. package/esm/errors/AuthSdkError.js +0 -29
  134. package/esm/errors/AuthSdkError.js.map +0 -1
  135. package/esm/errors/CustomError.js +0 -21
  136. package/esm/errors/CustomError.js.map +0 -1
  137. package/esm/errors/OAuthError.js +0 -22
  138. package/esm/errors/OAuthError.js.map +0 -1
  139. package/esm/errors/index.js +0 -22
  140. package/esm/errors/index.js.map +0 -1
  141. package/esm/features.js +0 -64
  142. package/esm/features.js.map +0 -1
  143. package/esm/fetch/fetchRequest.js +0 -92
  144. package/esm/fetch/fetchRequest.js.map +0 -1
  145. package/esm/http/headers.js +0 -17
  146. package/esm/http/headers.js.map +0 -1
  147. package/esm/http/index.js +0 -3
  148. package/esm/http/index.js.map +0 -1
  149. package/esm/http/request.js +0 -145
  150. package/esm/http/request.js.map +0 -1
  151. package/esm/idx/authenticate.js +0 -47
  152. package/esm/idx/authenticate.js.map +0 -1
  153. package/esm/idx/cancel.js +0 -32
  154. package/esm/idx/cancel.js.map +0 -1
  155. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
  156. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  157. package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
  158. package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
  159. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
  160. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  161. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
  162. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  163. package/esm/idx/flowMonitors/index.js +0 -16
  164. package/esm/idx/flowMonitors/index.js.map +0 -1
  165. package/esm/idx/handleInteractionCodeRedirect.js +0 -64
  166. package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
  167. package/esm/idx/headers.js +0 -39
  168. package/esm/idx/headers.js.map +0 -1
  169. package/esm/idx/index.js +0 -20
  170. package/esm/idx/index.js.map +0 -1
  171. package/esm/idx/interact.js +0 -86
  172. package/esm/idx/interact.js.map +0 -1
  173. package/esm/idx/introspect.js +0 -61
  174. package/esm/idx/introspect.js.map +0 -1
  175. package/esm/idx/recoverPassword.js +0 -46
  176. package/esm/idx/recoverPassword.js.map +0 -1
  177. package/esm/idx/register.js +0 -63
  178. package/esm/idx/register.js.map +0 -1
  179. package/esm/idx/remediate.js +0 -302
  180. package/esm/idx/remediate.js.map +0 -1
  181. package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
  182. package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
  183. package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
  184. package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
  185. package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
  186. package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
  187. package/esm/idx/remediators/Base/Remediator.js +0 -221
  188. package/esm/idx/remediators/Base/Remediator.js.map +0 -1
  189. package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
  190. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
  191. package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -65
  192. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
  193. package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
  194. package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
  195. package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
  196. package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
  197. package/esm/idx/remediators/EnrollProfile.js +0 -79
  198. package/esm/idx/remediators/EnrollProfile.js.map +0 -1
  199. package/esm/idx/remediators/Identify.js +0 -87
  200. package/esm/idx/remediators/Identify.js.map +0 -1
  201. package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
  202. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
  203. package/esm/idx/remediators/RedirectIdp.js +0 -38
  204. package/esm/idx/remediators/RedirectIdp.js.map +0 -1
  205. package/esm/idx/remediators/ResetAuthenticator.js +0 -18
  206. package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
  207. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
  208. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
  209. package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
  210. package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
  211. package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
  212. package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
  213. package/esm/idx/remediators/Skip.js +0 -23
  214. package/esm/idx/remediators/Skip.js.map +0 -1
  215. package/esm/idx/remediators/index.js +0 -26
  216. package/esm/idx/remediators/index.js.map +0 -1
  217. package/esm/idx/remediators/util.js +0 -35
  218. package/esm/idx/remediators/util.js.map +0 -1
  219. package/esm/idx/run.js +0 -222
  220. package/esm/idx/run.js.map +0 -1
  221. package/esm/idx/startTransaction.js +0 -27
  222. package/esm/idx/startTransaction.js.map +0 -1
  223. package/esm/idx/transactionMeta.js +0 -125
  224. package/esm/idx/transactionMeta.js.map +0 -1
  225. package/esm/idx/types/idx-js.js +0 -20
  226. package/esm/idx/types/idx-js.js.map +0 -1
  227. package/esm/idx/types/index.js +0 -44
  228. package/esm/idx/types/index.js.map +0 -1
  229. package/esm/oidc/decodeToken.js +0 -31
  230. package/esm/oidc/decodeToken.js.map +0 -1
  231. package/esm/oidc/endpoints/authorize.js +0 -61
  232. package/esm/oidc/endpoints/authorize.js.map +0 -1
  233. package/esm/oidc/endpoints/index.js.map +0 -1
  234. package/esm/oidc/endpoints/token.js +0 -97
  235. package/esm/oidc/endpoints/token.js.map +0 -1
  236. package/esm/oidc/endpoints/well-known.js +0 -58
  237. package/esm/oidc/endpoints/well-known.js.map +0 -1
  238. package/esm/oidc/exchangeCodeForTokens.js +0 -69
  239. package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
  240. package/esm/oidc/getToken.js +0 -180
  241. package/esm/oidc/getToken.js.map +0 -1
  242. package/esm/oidc/getUserInfo.js +0 -82
  243. package/esm/oidc/getUserInfo.js.map +0 -1
  244. package/esm/oidc/getWithPopup.js +0 -34
  245. package/esm/oidc/getWithPopup.js.map +0 -1
  246. package/esm/oidc/getWithRedirect.js +0 -61
  247. package/esm/oidc/getWithRedirect.js.map +0 -1
  248. package/esm/oidc/getWithoutPrompt.js +0 -29
  249. package/esm/oidc/getWithoutPrompt.js.map +0 -1
  250. package/esm/oidc/handleOAuthResponse.js +0 -148
  251. package/esm/oidc/handleOAuthResponse.js.map +0 -1
  252. package/esm/oidc/index.js +0 -29
  253. package/esm/oidc/index.js.map +0 -1
  254. package/esm/oidc/parseFromUrl.js +0 -144
  255. package/esm/oidc/parseFromUrl.js.map +0 -1
  256. package/esm/oidc/renewToken.js +0 -85
  257. package/esm/oidc/renewToken.js.map +0 -1
  258. package/esm/oidc/renewTokens.js +0 -74
  259. package/esm/oidc/renewTokens.js.map +0 -1
  260. package/esm/oidc/renewTokensWithRefresh.js +0 -55
  261. package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
  262. package/esm/oidc/revokeToken.js +0 -57
  263. package/esm/oidc/revokeToken.js.map +0 -1
  264. package/esm/oidc/util/browser.js +0 -74
  265. package/esm/oidc/util/browser.js.map +0 -1
  266. package/esm/oidc/util/defaultTokenParams.js +0 -42
  267. package/esm/oidc/util/defaultTokenParams.js.map +0 -1
  268. package/esm/oidc/util/errors.js +0 -31
  269. package/esm/oidc/util/errors.js.map +0 -1
  270. package/esm/oidc/util/index.js +0 -25
  271. package/esm/oidc/util/index.js.map +0 -1
  272. package/esm/oidc/util/loginRedirect.js +0 -88
  273. package/esm/oidc/util/loginRedirect.js.map +0 -1
  274. package/esm/oidc/util/oauth.js +0 -70
  275. package/esm/oidc/util/oauth.js.map +0 -1
  276. package/esm/oidc/util/pkce.js +0 -55
  277. package/esm/oidc/util/pkce.js.map +0 -1
  278. package/esm/oidc/util/prepareTokenParams.js +0 -75
  279. package/esm/oidc/util/prepareTokenParams.js.map +0 -1
  280. package/esm/oidc/util/refreshToken.js +0 -24
  281. package/esm/oidc/util/refreshToken.js.map +0 -1
  282. package/esm/oidc/util/urlParams.js +0 -54
  283. package/esm/oidc/util/urlParams.js.map +0 -1
  284. package/esm/oidc/util/validateClaims.js +0 -53
  285. package/esm/oidc/util/validateClaims.js.map +0 -1
  286. package/esm/oidc/util/validateToken.js +0 -21
  287. package/esm/oidc/util/validateToken.js.map +0 -1
  288. package/esm/oidc/verifyToken.js +0 -78
  289. package/esm/oidc/verifyToken.js.map +0 -1
  290. package/esm/options.js +0 -144
  291. package/esm/options.js.map +0 -1
  292. package/esm/server/serverStorage.js +0 -111
  293. package/esm/server/serverStorage.js.map +0 -1
  294. package/esm/services/TokenService.js +0 -103
  295. package/esm/services/TokenService.js.map +0 -1
  296. package/esm/session.js +0 -81
  297. package/esm/session.js.map +0 -1
  298. package/esm/tx/AuthTransaction.js +0 -213
  299. package/esm/tx/AuthTransaction.js.map +0 -1
  300. package/esm/tx/TransactionState.js.map +0 -1
  301. package/esm/tx/api.js +0 -87
  302. package/esm/tx/api.js.map +0 -1
  303. package/esm/tx/index.js +0 -18
  304. package/esm/tx/index.js.map +0 -1
  305. package/esm/tx/poll.js +0 -124
  306. package/esm/tx/poll.js.map +0 -1
  307. package/esm/tx/util.js +0 -26
  308. package/esm/tx/util.js.map +0 -1
  309. package/esm/types/AuthState.js +0 -3
  310. package/esm/types/Cookies.js +0 -3
  311. package/esm/types/EventEmitter.js +0 -3
  312. package/esm/types/EventEmitter.js.map +0 -1
  313. package/esm/types/JWT.js +0 -3
  314. package/esm/types/JWT.js.map +0 -1
  315. package/esm/types/OAuth.js +0 -3
  316. package/esm/types/OAuth.js.map +0 -1
  317. package/esm/types/OktaAuthOptions.js +0 -3
  318. package/esm/types/OktaAuthOptions.js.map +0 -1
  319. package/esm/types/Storage.js +0 -3
  320. package/esm/types/Storage.js.map +0 -1
  321. package/esm/types/Token.js +0 -29
  322. package/esm/types/Token.js.map +0 -1
  323. package/esm/types/TokenManager.js +0 -3
  324. package/esm/types/TokenManager.js.map +0 -1
  325. package/esm/types/Transaction.js +0 -57
  326. package/esm/types/Transaction.js.map +0 -1
  327. package/esm/types/UserClaims.js +0 -3
  328. package/esm/types/UserClaims.js.map +0 -1
  329. package/esm/types/api.js +0 -3
  330. package/esm/types/api.js.map +0 -1
  331. package/esm/types/http.js +0 -3
  332. package/esm/types/http.js.map +0 -1
  333. package/esm/types/index.js +0 -27
  334. package/esm/types/index.js.map +0 -1
  335. package/esm/util/console.js +0 -53
  336. package/esm/util/console.js.map +0 -1
  337. package/esm/util/emailVerify.js +0 -21
  338. package/esm/util/emailVerify.js.map +0 -1
  339. package/esm/util/index.js +0 -18
  340. package/esm/util/index.js.map +0 -1
  341. package/esm/util/misc.js +0 -33
  342. package/esm/util/misc.js.map +0 -1
  343. package/esm/util/object.js +0 -117
  344. package/esm/util/object.js.map +0 -1
  345. package/esm/util/sharedStorage.js +0 -43
  346. package/esm/util/sharedStorage.js.map +0 -1
  347. package/esm/util/types.js +0 -27
  348. package/esm/util/types.js.map +0 -1
  349. package/esm/util/url.js +0 -64
  350. package/esm/util/url.js.map +0 -1
@@ -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,74 +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
- export function addListener(eventTarget, name, fn) {
19
- if (eventTarget.addEventListener) {
20
- eventTarget.addEventListener(name, fn);
21
- } else {
22
- eventTarget.attachEvent('on' + name, fn);
23
- }
24
- }
25
- export function removeListener(eventTarget, name, fn) {
26
- if (eventTarget.removeEventListener) {
27
- eventTarget.removeEventListener(name, fn);
28
- } else {
29
- eventTarget.detachEvent('on' + name, fn);
30
- }
31
- }
32
- export function loadFrame(src) {
33
- var iframe = document.createElement('iframe');
34
- iframe.style.display = 'none';
35
- iframe.src = src;
36
- return document.body.appendChild(iframe);
37
- }
38
- export function loadPopup(src, options) {
39
- var title = options.popupTitle || 'External Identity Provider User Authentication';
40
- var appearance = 'toolbar=no, scrollbars=yes, resizable=yes, ' + 'top=100, left=500, width=600, height=600';
41
- return window.open(src, title, appearance);
42
- }
43
- export function addPostMessageListener(sdk, timeout, state) {
44
- var responseHandler;
45
- var timeoutId;
46
- var msgReceivedOrTimeout = new Promise(function (resolve, reject) {
47
- responseHandler = function responseHandler(e) {
48
- if (!e.data || e.data.state !== state) {
49
- // A message not meant for us
50
- return;
51
- } // Configuration mismatch between saved token and current app instance
52
- // This may happen if apps with different issuers are running on the same host url
53
- // If they share the same storage key, they may read and write tokens in the same location.
54
- // Common when developing against http://localhost
55
-
56
-
57
- if (e.origin !== sdk.getIssuerOrigin()) {
58
- return reject(new AuthSdkError('The request does not match client configuration'));
59
- }
60
-
61
- resolve(e.data);
62
- };
63
-
64
- addListener(window, 'message', responseHandler);
65
- timeoutId = setTimeout(function () {
66
- reject(new AuthSdkError('OAuth flow timed out'));
67
- }, timeout || 120000);
68
- });
69
- return msgReceivedOrTimeout.finally(function () {
70
- clearTimeout(timeoutId);
71
- removeListener(window, 'message', responseHandler);
72
- });
73
- }
74
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/browser.ts"],"names":["AuthSdkError","addListener","eventTarget","name","fn","addEventListener","attachEvent","removeListener","removeEventListener","detachEvent","loadFrame","src","iframe","document","createElement","style","display","body","appendChild","loadPopup","options","title","popupTitle","appearance","window","open","addPostMessageListener","sdk","timeout","state","responseHandler","timeoutId","msgReceivedOrTimeout","Promise","resolve","reject","e","data","origin","getIssuerOrigin","setTimeout","finally","clearTimeout"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;;AACA;AACA,SAASA,YAAT,QAA6B,cAA7B;AAGA,OAAO,SAASC,WAAT,CAAqBC,WAArB,EAAkCC,IAAlC,EAAwCC,EAAxC,EAA4C;AACjD,MAAIF,WAAW,CAACG,gBAAhB,EAAkC;AAChCH,IAAAA,WAAW,CAACG,gBAAZ,CAA6BF,IAA7B,EAAmCC,EAAnC;AACD,GAFD,MAEO;AACLF,IAAAA,WAAW,CAACI,WAAZ,CAAwB,OAAOH,IAA/B,EAAqCC,EAArC;AACD;AACF;AAED,OAAO,SAASG,cAAT,CAAwBL,WAAxB,EAAqCC,IAArC,EAA2CC,EAA3C,EAA+C;AACpD,MAAIF,WAAW,CAACM,mBAAhB,EAAqC;AACnCN,IAAAA,WAAW,CAACM,mBAAZ,CAAgCL,IAAhC,EAAsCC,EAAtC;AACD,GAFD,MAEO;AACLF,IAAAA,WAAW,CAACO,WAAZ,CAAwB,OAAON,IAA/B,EAAqCC,EAArC;AACD;AACF;AAED,OAAO,SAASM,SAAT,CAAmBC,GAAnB,EAAwB;AAC7B,MAAIC,MAAM,GAAGC,QAAQ,CAACC,aAAT,CAAuB,QAAvB,CAAb;AACAF,EAAAA,MAAM,CAACG,KAAP,CAAaC,OAAb,GAAuB,MAAvB;AACAJ,EAAAA,MAAM,CAACD,GAAP,GAAaA,GAAb;AAEA,SAAOE,QAAQ,CAACI,IAAT,CAAcC,WAAd,CAA0BN,MAA1B,CAAP;AACD;AAED,OAAO,SAASO,SAAT,CAAmBR,GAAnB,EAAwBS,OAAxB,EAAiC;AACtC,MAAIC,KAAK,GAAGD,OAAO,CAACE,UAAR,IAAsB,gDAAlC;AACA,MAAIC,UAAU,GAAG,gDACf,0CADF;AAEA,SAAOC,MAAM,CAACC,IAAP,CAAYd,GAAZ,EAAiBU,KAAjB,EAAwBE,UAAxB,CAAP;AACD;AAED,OAAO,SAASG,sBAAT,CAAgCC,GAAhC,EAA+CC,OAA/C,EAAwDC,KAAxD,EAA+D;AACpE,MAAIC,eAAJ;AACA,MAAIC,SAAJ;AACA,MAAIC,oBAAoB,GAAG,IAAIC,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;AAEhEL,IAAAA,eAAe,GAAG,SAASA,eAAT,CAAyBM,CAAzB,EAA4B;AAC5C,UAAI,CAACA,CAAC,CAACC,IAAH,IAAWD,CAAC,CAACC,IAAF,CAAOR,KAAP,KAAiBA,KAAhC,EAAuC;AACrC;AACA;AACD,OAJ2C,CAM5C;AACA;AACA;AACA;;;AACA,UAAIO,CAAC,CAACE,MAAF,KAAaX,GAAG,CAACY,eAAJ,EAAjB,EAAwC;AACtC,eAAOJ,MAAM,CAAC,IAAInC,YAAJ,CAAiB,iDAAjB,CAAD,CAAb;AACD;;AACDkC,MAAAA,OAAO,CAACE,CAAC,CAACC,IAAH,CAAP;AACD,KAdD;;AAgBApC,IAAAA,WAAW,CAACuB,MAAD,EAAS,SAAT,EAAoBM,eAApB,CAAX;AAEAC,IAAAA,SAAS,GAAGS,UAAU,CAAC,YAAY;AACjCL,MAAAA,MAAM,CAAC,IAAInC,YAAJ,CAAiB,sBAAjB,CAAD,CAAN;AACD,KAFqB,EAEnB4B,OAAO,IAAI,MAFQ,CAAtB;AAGD,GAvB0B,CAA3B;AAyBA,SAAOI,oBAAoB,CACxBS,OADI,CACI,YAAY;AACnBC,IAAAA,YAAY,CAACX,SAAD,CAAZ;AACAxB,IAAAA,cAAc,CAACiB,MAAD,EAAS,SAAT,EAAoBM,eAApB,CAAd;AACD,GAJI,CAAP;AAKD","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';\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 return window.open(src, title, appearance);\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"}
@@ -1,31 +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
- export function isInteractionRequiredError(error) {
13
- if (error.name !== 'OAuthError') {
14
- return false;
15
- }
16
-
17
- var oauthError = error;
18
- return oauthError.errorCode === 'interaction_required';
19
- }
20
- export function isAuthorizationCodeError(sdk, error) {
21
- if (error.name !== 'AuthApiError') {
22
- return false;
23
- }
24
-
25
- var authApiError = error; // xhr property doesn't seem to match XMLHttpRequest type
26
-
27
- var errorResponse = authApiError.xhr;
28
- var responseJSON = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.responseJSON;
29
- return sdk.options.pkce && (responseJSON === null || responseJSON === void 0 ? void 0 : responseJSON.error) === 'invalid_grant';
30
- }
31
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/errors.ts"],"names":["isInteractionRequiredError","error","name","oauthError","errorCode","isAuthorizationCodeError","sdk","authApiError","errorResponse","xhr","responseJSON","options","pkce"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,OAAO,SAASA,0BAAT,CAAoCC,KAApC,EAAkD;AACvD,MAAIA,KAAK,CAACC,IAAN,KAAe,YAAnB,EAAiC;AAC/B,WAAO,KAAP;AACD;;AACD,MAAMC,UAAU,GAAGF,KAAnB;AACA,SAAQE,UAAU,CAACC,SAAX,KAAyB,sBAAjC;AACD;AAED,OAAO,SAASC,wBAAT,CAAkCC,GAAlC,EAAiDL,KAAjD,EAA+D;AACpE,MAAIA,KAAK,CAACC,IAAN,KAAe,cAAnB,EAAmC;AACjC,WAAO,KAAP;AACD;;AACD,MAAMK,YAAY,GAAGN,KAArB,CAJoE,CAKpE;;AACA,MAAMO,aAAa,GAAGD,YAAY,CAACE,GAAnC;AACA,MAAMC,YAAY,GAAGF,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAEE,YAApC;AACA,SAAOJ,GAAG,CAACK,OAAJ,CAAYC,IAAZ,IAAqB,CAAAF,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAET,KAAd,MAAkC,eAA9D;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 { OktaAuth } from '../../types';\nimport { OAuthError, AuthApiError } from '../../errors';\n\nexport function isInteractionRequiredError(error: Error) {\n if (error.name !== 'OAuthError') {\n return false;\n }\n const oauthError = error as OAuthError;\n return (oauthError.errorCode === 'interaction_required');\n}\n\nexport function isAuthorizationCodeError(sdk: OktaAuth, error: Error) {\n if (error.name !== 'AuthApiError') {\n return false;\n }\n const authApiError = error as AuthApiError;\n // xhr property doesn't seem to match XMLHttpRequest type\n const errorResponse = authApiError.xhr as unknown as Record<string, unknown>;\n const responseJSON = errorResponse?.responseJSON as Record<string, unknown>;\n return sdk.options.pkce && (responseJSON?.error as string === 'invalid_grant');\n}\n"],"file":"errors.js"}
@@ -1,25 +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 './browser';
14
- export * from './defaultTokenParams';
15
- export * from './errors';
16
- export * from './loginRedirect';
17
- export * from './oauth';
18
- import pkce from './pkce';
19
- export { pkce };
20
- export * from './prepareTokenParams';
21
- export * from './refreshToken';
22
- export * from './urlParams';
23
- export * from './validateClaims';
24
- export * from './validateToken';
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/index.ts"],"names":["pkce"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,WAAd;AACA,cAAc,sBAAd;AACA,cAAc,UAAd;AACA,cAAc,iBAAd;AACA,cAAc,SAAd;AACA,OAAOA,IAAP,MAAiB,QAAjB;AACA,SAASA,IAAT;AACA,cAAc,sBAAd;AACA,cAAc,gBAAd;AACA,cAAc,aAAd;AACA,cAAc,kBAAd;AACA,cAAc,iBAAd","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\nexport * from './browser';\nexport * from './defaultTokenParams';\nexport * from './errors';\nexport * from './loginRedirect';\nexport * from './oauth';\nimport pkce from './pkce';\nexport { pkce };\nexport * from './prepareTokenParams';\nexport * from './refreshToken';\nexport * from './urlParams';\nexport * from './validateClaims';\nexport * from './validateToken';\n"],"file":"index.js"}
@@ -1,88 +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 */
15
-
16
- /* eslint-disable complexity, max-statements */
17
- export function hasTokensInHash(hash) {
18
- return /((id|access)_token=)/i.test(hash);
19
- } // authorization_code
20
-
21
- export function hasAuthorizationCode(hashOrSearch) {
22
- return /(code=)/i.test(hashOrSearch);
23
- } // interaction_code
24
-
25
- export function hasInteractionCode(hashOrSearch) {
26
- return /(interaction_code=)/i.test(hashOrSearch);
27
- }
28
- export function hasErrorInUrl(hashOrSearch) {
29
- return /(error=)/i.test(hashOrSearch) || /(error_description)/i.test(hashOrSearch);
30
- }
31
- export function isRedirectUri(uri, sdk) {
32
- var authParams = sdk.options;
33
- return uri && uri.indexOf(authParams.redirectUri) === 0;
34
- }
35
- export function isCodeFlow(options) {
36
- return options.pkce || options.responseType === 'code' || options.responseMode === 'query';
37
- }
38
- export function getHashOrSearch(options) {
39
- var codeFlow = isCodeFlow(options);
40
- var useQuery = codeFlow && options.responseMode !== 'fragment';
41
- return useQuery ? window.location.search : window.location.hash;
42
- }
43
- /**
44
- * Check if tokens or a code have been passed back into the url, which happens in
45
- * the OIDC (including social auth IDP) redirect flow.
46
- */
47
-
48
- export function isLoginRedirect(sdk) {
49
- // First check, is this a redirect URI?
50
- if (!isRedirectUri(window.location.href, sdk)) {
51
- return false;
52
- } // The location contains either a code, token, or an error + error_description
53
-
54
-
55
- var codeFlow = isCodeFlow(sdk.options);
56
- var hashOrSearch = getHashOrSearch(sdk.options);
57
-
58
- if (hasErrorInUrl(hashOrSearch)) {
59
- return true;
60
- }
61
-
62
- if (codeFlow) {
63
- var hasCode = hasAuthorizationCode(hashOrSearch) || hasInteractionCode(hashOrSearch);
64
- return hasCode;
65
- } // implicit flow, will always be hash fragment
66
-
67
-
68
- return hasTokensInHash(window.location.hash);
69
- }
70
- /**
71
- * Check if error=interaction_required has been passed back in the url, which happens in
72
- * the social auth IDP redirect flow.
73
- */
74
-
75
- export function isInteractionRequired(sdk, hashOrSearch) {
76
- if (!hashOrSearch) {
77
- // web only
78
- // First check, is this a redirect URI?
79
- if (!isLoginRedirect(sdk)) {
80
- return false;
81
- }
82
-
83
- hashOrSearch = getHashOrSearch(sdk.options);
84
- }
85
-
86
- return /(error=interaction_required)/i.test(hashOrSearch);
87
- }
88
- //# sourceMappingURL=loginRedirect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/loginRedirect.ts"],"names":["hasTokensInHash","hash","test","hasAuthorizationCode","hashOrSearch","hasInteractionCode","hasErrorInUrl","isRedirectUri","uri","sdk","authParams","options","indexOf","redirectUri","isCodeFlow","pkce","responseType","responseMode","getHashOrSearch","codeFlow","useQuery","window","location","search","isLoginRedirect","href","hasCode","isInteractionRequired"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;;AACA;AAGA,OAAO,SAASA,eAAT,CAAyBC,IAAzB,EAAgD;AACrD,SAAO,wBAAwBC,IAAxB,CAA6BD,IAA7B,CAAP;AACD,C,CAED;;AACA,OAAO,SAASE,oBAAT,CAA8BC,YAA9B,EAA6D;AAClE,SAAO,WAAWF,IAAX,CAAgBE,YAAhB,CAAP;AACD,C,CAED;;AACA,OAAO,SAASC,kBAAT,CAA4BD,YAA5B,EAA2D;AAChE,SAAO,uBAAuBF,IAAvB,CAA4BE,YAA5B,CAAP;AACD;AAED,OAAO,SAASE,aAAT,CAAuBF,YAAvB,EAAsD;AAC3D,SAAO,YAAYF,IAAZ,CAAiBE,YAAjB,KAAkC,uBAAuBF,IAAvB,CAA4BE,YAA5B,CAAzC;AACD;AAED,OAAO,SAASG,aAAT,CAAuBC,GAAvB,EAAoCC,GAApC,EAA4D;AACjE,MAAIC,UAAU,GAAGD,GAAG,CAACE,OAArB;AACA,SAAOH,GAAG,IAAIA,GAAG,CAACI,OAAJ,CAAYF,UAAU,CAACG,WAAvB,MAAwC,CAAtD;AACD;AAED,OAAO,SAASC,UAAT,CAAoBH,OAApB,EAA8C;AACnD,SAAOA,OAAO,CAACI,IAAR,IAAgBJ,OAAO,CAACK,YAAR,KAAyB,MAAzC,IAAmDL,OAAO,CAACM,YAAR,KAAyB,OAAnF;AACD;AAED,OAAO,SAASC,eAAT,CAAyBP,OAAzB,EAAmD;AACxD,MAAIQ,QAAQ,GAAGL,UAAU,CAACH,OAAD,CAAzB;AACA,MAAIS,QAAQ,GAAGD,QAAQ,IAAIR,OAAO,CAACM,YAAR,KAAyB,UAApD;AACA,SAAOG,QAAQ,GAAGC,MAAM,CAACC,QAAP,CAAgBC,MAAnB,GAA4BF,MAAM,CAACC,QAAP,CAAgBrB,IAA3D;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASuB,eAAT,CAA0Bf,GAA1B,EAAyC;AAC9C;AACA,MAAI,CAACF,aAAa,CAACc,MAAM,CAACC,QAAP,CAAgBG,IAAjB,EAAuBhB,GAAvB,CAAlB,EAA8C;AAC5C,WAAO,KAAP;AACD,GAJ6C,CAM9C;;;AACA,MAAIU,QAAQ,GAAGL,UAAU,CAACL,GAAG,CAACE,OAAL,CAAzB;AACA,MAAIP,YAAY,GAAGc,eAAe,CAACT,GAAG,CAACE,OAAL,CAAlC;;AAEA,MAAIL,aAAa,CAACF,YAAD,CAAjB,EAAiC;AAC/B,WAAO,IAAP;AACD;;AAED,MAAIe,QAAJ,EAAc;AACZ,QAAIO,OAAO,GAAIvB,oBAAoB,CAACC,YAAD,CAApB,IAAsCC,kBAAkB,CAACD,YAAD,CAAvE;AACA,WAAOsB,OAAP;AACD,GAjB6C,CAmB9C;;;AACA,SAAO1B,eAAe,CAACqB,MAAM,CAACC,QAAP,CAAgBrB,IAAjB,CAAtB;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAAS0B,qBAAT,CAAgClB,GAAhC,EAA+CL,YAA/C,EAAsE;AAC3E,MAAI,CAACA,YAAL,EAAmB;AAAE;AACnB;AACA,QAAI,CAACoB,eAAe,CAACf,GAAD,CAApB,EAA0B;AACxB,aAAO,KAAP;AACD;;AAEDL,IAAAA,YAAY,GAAGc,eAAe,CAACT,GAAG,CAACE,OAAL,CAA9B;AACD;;AACD,SAAO,gCAAgCT,IAAhC,CAAqCE,YAArC,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/* global window */\n/* eslint-disable complexity, max-statements */\nimport { OktaAuth, OktaAuthOptions } from '../../types';\n\nexport function hasTokensInHash(hash: string): boolean {\n return /((id|access)_token=)/i.test(hash);\n}\n\n// authorization_code\nexport function hasAuthorizationCode(hashOrSearch: string): boolean {\n return /(code=)/i.test(hashOrSearch);\n}\n\n// interaction_code\nexport function hasInteractionCode(hashOrSearch: string): boolean {\n return /(interaction_code=)/i.test(hashOrSearch);\n}\n\nexport function hasErrorInUrl(hashOrSearch: string): boolean {\n return /(error=)/i.test(hashOrSearch) || /(error_description)/i.test(hashOrSearch);\n}\n\nexport function isRedirectUri(uri: string, sdk: OktaAuth): boolean {\n var authParams = sdk.options;\n return uri && uri.indexOf(authParams.redirectUri) === 0;\n}\n\nexport function isCodeFlow(options: OktaAuthOptions) {\n return options.pkce || options.responseType === 'code' || options.responseMode === 'query';\n}\n\nexport function getHashOrSearch(options: OktaAuthOptions) {\n var codeFlow = isCodeFlow(options);\n var useQuery = codeFlow && options.responseMode !== 'fragment';\n return useQuery ? window.location.search : window.location.hash;\n}\n\n/**\n * Check if tokens or a code have been passed back into the url, which happens in\n * the OIDC (including social auth IDP) redirect flow.\n */\nexport function isLoginRedirect (sdk: OktaAuth) {\n // First check, is this a redirect URI?\n if (!isRedirectUri(window.location.href, sdk)){\n return false;\n }\n\n // The location contains either a code, token, or an error + error_description\n var codeFlow = isCodeFlow(sdk.options);\n var hashOrSearch = getHashOrSearch(sdk.options);\n\n if (hasErrorInUrl(hashOrSearch)) {\n return true;\n }\n\n if (codeFlow) {\n var hasCode = hasAuthorizationCode(hashOrSearch) || hasInteractionCode(hashOrSearch);\n return hasCode;\n }\n\n // implicit flow, will always be hash fragment\n return hasTokensInHash(window.location.hash);\n}\n\n/**\n * Check if error=interaction_required has been passed back in the url, which happens in\n * the social auth IDP redirect flow.\n */\nexport function isInteractionRequired (sdk: OktaAuth, hashOrSearch?: string) {\n if (!hashOrSearch) { // web only\n // First check, is this a redirect URI?\n if (!isLoginRedirect(sdk)){\n return false;\n }\n \n hashOrSearch = getHashOrSearch(sdk.options);\n }\n return /(error=interaction_required)/i.test(hashOrSearch);\n}"],"file":"loginRedirect.js"}
@@ -1,70 +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-disable complexity, max-statements */
15
- import { genRandomString, removeTrailingSlash } from '../../util';
16
- import AuthSdkError from '../../errors/AuthSdkError';
17
- export function generateState() {
18
- return genRandomString(64);
19
- }
20
- export function generateNonce() {
21
- return genRandomString(64);
22
- }
23
-
24
- function getIssuer(sdk) {
25
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26
- var issuer = removeTrailingSlash(options.issuer) || sdk.options.issuer;
27
- return issuer;
28
- }
29
-
30
- export function getOAuthBaseUrl(sdk) {
31
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
32
- var issuer = getIssuer(sdk, options);
33
- var baseUrl = issuer.indexOf('/oauth2') > 0 ? issuer : issuer + '/oauth2';
34
- return baseUrl;
35
- }
36
- export function getOAuthDomain(sdk) {
37
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
38
- var issuer = getIssuer(sdk, options);
39
- var domain = issuer.split('/oauth2')[0];
40
- return domain;
41
- }
42
- export function getOAuthUrls(sdk, options) {
43
- if (arguments.length > 2) {
44
- throw new AuthSdkError('As of version 3.0, "getOAuthUrls" takes only a single set of options');
45
- }
46
-
47
- options = options || {}; // Get user-supplied arguments
48
-
49
- var authorizeUrl = removeTrailingSlash(options.authorizeUrl) || sdk.options.authorizeUrl;
50
- var issuer = getIssuer(sdk, options);
51
- var userinfoUrl = removeTrailingSlash(options.userinfoUrl) || sdk.options.userinfoUrl;
52
- var tokenUrl = removeTrailingSlash(options.tokenUrl) || sdk.options.tokenUrl;
53
- var logoutUrl = removeTrailingSlash(options.logoutUrl) || sdk.options.logoutUrl;
54
- var revokeUrl = removeTrailingSlash(options.revokeUrl) || sdk.options.revokeUrl;
55
- var baseUrl = getOAuthBaseUrl(sdk, options);
56
- authorizeUrl = authorizeUrl || baseUrl + '/v1/authorize';
57
- userinfoUrl = userinfoUrl || baseUrl + '/v1/userinfo';
58
- tokenUrl = tokenUrl || baseUrl + '/v1/token';
59
- revokeUrl = revokeUrl || baseUrl + '/v1/revoke';
60
- logoutUrl = logoutUrl || baseUrl + '/v1/logout';
61
- return {
62
- issuer: issuer,
63
- authorizeUrl: authorizeUrl,
64
- userinfoUrl: userinfoUrl,
65
- tokenUrl: tokenUrl,
66
- revokeUrl: revokeUrl,
67
- logoutUrl: logoutUrl
68
- };
69
- }
70
- //# sourceMappingURL=oauth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/oauth.ts"],"names":["genRandomString","removeTrailingSlash","AuthSdkError","generateState","generateNonce","getIssuer","sdk","options","issuer","getOAuthBaseUrl","baseUrl","indexOf","getOAuthDomain","domain","split","getOAuthUrls","arguments","length","authorizeUrl","userinfoUrl","tokenUrl","logoutUrl","revokeUrl"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA,SAASA,eAAT,EAA0BC,mBAA1B,QAAqD,YAArD;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AAGA,OAAO,SAASC,aAAT,GAAyB;AAC9B,SAAOH,eAAe,CAAC,EAAD,CAAtB;AACD;AAED,OAAO,SAASI,aAAT,GAAyB;AAC9B,SAAOJ,eAAe,CAAC,EAAD,CAAtB;AACD;;AAED,SAASK,SAAT,CAAmBC,GAAnB,EAA4D;AAAA,MAA1BC,OAA0B,uEAAJ,EAAI;AAC1D,MAAMC,MAAM,GAAGP,mBAAmB,CAACM,OAAO,CAACC,MAAT,CAAnB,IAAuCF,GAAG,CAACC,OAAJ,CAAYC,MAAlE;AACA,SAAOA,MAAP;AACD;;AAED,OAAO,SAASC,eAAT,CAAyBH,GAAzB,EAAkE;AAAA,MAA1BC,OAA0B,uEAAJ,EAAI;AACvE,MAAMC,MAAM,GAAGH,SAAS,CAACC,GAAD,EAAMC,OAAN,CAAxB;AACA,MAAMG,OAAO,GAAGF,MAAM,CAACG,OAAP,CAAe,SAAf,IAA4B,CAA5B,GAAgCH,MAAhC,GAAyCA,MAAM,GAAG,SAAlE;AACA,SAAOE,OAAP;AACD;AAED,OAAO,SAASE,cAAT,CAAwBN,GAAxB,EAAiE;AAAA,MAA1BC,OAA0B,uEAAJ,EAAI;AACtE,MAAMC,MAAM,GAAGH,SAAS,CAACC,GAAD,EAAMC,OAAN,CAAxB;AACA,MAAMM,MAAM,GAAGL,MAAM,CAACM,KAAP,CAAa,SAAb,EAAwB,CAAxB,CAAf;AACA,SAAOD,MAAP;AACD;AAED,OAAO,SAASE,YAAT,CAAsBT,GAAtB,EAAqCC,OAArC,EAA2D;AAChE,MAAIS,SAAS,CAACC,MAAV,GAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIf,YAAJ,CAAiB,sEAAjB,CAAN;AACD;;AACDK,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAArB,CAJgE,CAMhE;;AACA,MAAIW,YAAY,GAAGjB,mBAAmB,CAACM,OAAO,CAACW,YAAT,CAAnB,IAA6CZ,GAAG,CAACC,OAAJ,CAAYW,YAA5E;AACA,MAAIV,MAAM,GAAGH,SAAS,CAACC,GAAD,EAAMC,OAAN,CAAtB;AACA,MAAIY,WAAW,GAAGlB,mBAAmB,CAACM,OAAO,CAACY,WAAT,CAAnB,IAA4Cb,GAAG,CAACC,OAAJ,CAAYY,WAA1E;AACA,MAAIC,QAAQ,GAAGnB,mBAAmB,CAACM,OAAO,CAACa,QAAT,CAAnB,IAAyCd,GAAG,CAACC,OAAJ,CAAYa,QAApE;AACA,MAAIC,SAAS,GAAGpB,mBAAmB,CAACM,OAAO,CAACc,SAAT,CAAnB,IAA0Cf,GAAG,CAACC,OAAJ,CAAYc,SAAtE;AACA,MAAIC,SAAS,GAAGrB,mBAAmB,CAACM,OAAO,CAACe,SAAT,CAAnB,IAA0ChB,GAAG,CAACC,OAAJ,CAAYe,SAAtE;AAEA,MAAIZ,OAAO,GAAGD,eAAe,CAACH,GAAD,EAAMC,OAAN,CAA7B;AAEAW,EAAAA,YAAY,GAAGA,YAAY,IAAIR,OAAO,GAAG,eAAzC;AACAS,EAAAA,WAAW,GAAGA,WAAW,IAAIT,OAAO,GAAG,cAAvC;AACAU,EAAAA,QAAQ,GAAGA,QAAQ,IAAIV,OAAO,GAAG,WAAjC;AACAY,EAAAA,SAAS,GAAGA,SAAS,IAAIZ,OAAO,GAAG,YAAnC;AACAW,EAAAA,SAAS,GAAGA,SAAS,IAAIX,OAAO,GAAG,YAAnC;AAEA,SAAO;AACLF,IAAAA,MAAM,EAAEA,MADH;AAELU,IAAAA,YAAY,EAAEA,YAFT;AAGLC,IAAAA,WAAW,EAAEA,WAHR;AAILC,IAAAA,QAAQ,EAAEA,QAJL;AAKLE,IAAAA,SAAS,EAAEA,SALN;AAMLD,IAAAA,SAAS,EAAEA;AANN,GAAP;AAQD","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, max-statements */\nimport { genRandomString, removeTrailingSlash } from '../../util';\nimport AuthSdkError from '../../errors/AuthSdkError';\nimport { OktaAuth, CustomUrls } from '../../types';\n\nexport function generateState() {\n return genRandomString(64);\n}\n\nexport function generateNonce() {\n return genRandomString(64);\n}\n\nfunction getIssuer(sdk: OktaAuth, options: CustomUrls = {}) {\n const issuer = removeTrailingSlash(options.issuer) || sdk.options.issuer;\n return issuer;\n}\n\nexport function getOAuthBaseUrl(sdk: OktaAuth, options: CustomUrls = {}) {\n const issuer = getIssuer(sdk, options);\n const baseUrl = issuer.indexOf('/oauth2') > 0 ? issuer : issuer + '/oauth2';\n return baseUrl;\n}\n\nexport function getOAuthDomain(sdk: OktaAuth, options: CustomUrls = {}) {\n const issuer = getIssuer(sdk, options);\n const domain = issuer.split('/oauth2')[0];\n return domain;\n}\n\nexport function getOAuthUrls(sdk: OktaAuth, options?: CustomUrls) {\n if (arguments.length > 2) {\n throw new AuthSdkError('As of version 3.0, \"getOAuthUrls\" takes only a single set of options');\n }\n options = options || {};\n\n // Get user-supplied arguments\n var authorizeUrl = removeTrailingSlash(options.authorizeUrl) || sdk.options.authorizeUrl;\n var issuer = getIssuer(sdk, options);\n var userinfoUrl = removeTrailingSlash(options.userinfoUrl) || sdk.options.userinfoUrl;\n var tokenUrl = removeTrailingSlash(options.tokenUrl) || sdk.options.tokenUrl;\n var logoutUrl = removeTrailingSlash(options.logoutUrl) || sdk.options.logoutUrl;\n var revokeUrl = removeTrailingSlash(options.revokeUrl) || sdk.options.revokeUrl;\n\n var baseUrl = getOAuthBaseUrl(sdk, options);\n\n authorizeUrl = authorizeUrl || baseUrl + '/v1/authorize';\n userinfoUrl = userinfoUrl || baseUrl + '/v1/userinfo';\n tokenUrl = tokenUrl || baseUrl + '/v1/token';\n revokeUrl = revokeUrl || baseUrl + '/v1/revoke';\n logoutUrl = logoutUrl || baseUrl + '/v1/logout';\n\n return {\n issuer: issuer,\n authorizeUrl: authorizeUrl,\n userinfoUrl: userinfoUrl,\n tokenUrl: tokenUrl,\n revokeUrl: revokeUrl,\n logoutUrl: logoutUrl\n };\n}\n"],"file":"oauth.js"}
@@ -1,55 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-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-disable complexity, max-statements */
15
- import { stringToBase64Url } from '../../crypto';
16
- import { MIN_VERIFIER_LENGTH, MAX_VERIFIER_LENGTH, DEFAULT_CODE_CHALLENGE_METHOD } from '../../constants';
17
- import { webcrypto } from '../../crypto';
18
-
19
- function dec2hex(dec) {
20
- return ('0' + dec.toString(16)).substr(-2);
21
- }
22
-
23
- function getRandomString(length) {
24
- var a = new Uint8Array(Math.ceil(length / 2));
25
- webcrypto.getRandomValues(a);
26
- var str = Array.from(a, dec2hex).join('');
27
- return str.slice(0, length);
28
- }
29
-
30
- function generateVerifier(prefix) {
31
- var verifier = prefix || '';
32
-
33
- if (verifier.length < MIN_VERIFIER_LENGTH) {
34
- verifier = verifier + getRandomString(MIN_VERIFIER_LENGTH - verifier.length);
35
- }
36
-
37
- return encodeURIComponent(verifier).slice(0, MAX_VERIFIER_LENGTH);
38
- }
39
-
40
- function computeChallenge(str) {
41
- var buffer = new TextEncoder().encode(str);
42
- return webcrypto.subtle.digest('SHA-256', buffer).then(function (arrayBuffer) {
43
- var hash = String.fromCharCode.apply(null, new Uint8Array(arrayBuffer));
44
- var b64u = stringToBase64Url(hash); // url-safe base64 variant
45
-
46
- return b64u;
47
- });
48
- }
49
-
50
- export default {
51
- DEFAULT_CODE_CHALLENGE_METHOD,
52
- generateVerifier,
53
- computeChallenge
54
- };
55
- //# sourceMappingURL=pkce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/pkce.ts"],"names":["stringToBase64Url","MIN_VERIFIER_LENGTH","MAX_VERIFIER_LENGTH","DEFAULT_CODE_CHALLENGE_METHOD","webcrypto","dec2hex","dec","toString","substr","getRandomString","length","a","Uint8Array","Math","ceil","getRandomValues","str","Array","from","join","slice","generateVerifier","prefix","verifier","encodeURIComponent","computeChallenge","buffer","TextEncoder","encode","subtle","digest","then","arrayBuffer","hash","String","fromCharCode","apply","b64u"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEC;AACD,SAASA,iBAAT,QAAkC,cAAlC;AACA,SAASC,mBAAT,EAA8BC,mBAA9B,EAAmDC,6BAAnD,QAAwF,iBAAxF;AACA,SAASC,SAAT,QAA0B,cAA1B;;AAEA,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;AACrB,SAAO,CAAC,MAAMA,GAAG,CAACC,QAAJ,CAAa,EAAb,CAAP,EAAyBC,MAAzB,CAAgC,CAAC,CAAjC,CAAP;AACD;;AAED,SAASC,eAAT,CAAyBC,MAAzB,EAAiC;AAC/B,MAAIC,CAAC,GAAG,IAAIC,UAAJ,CAAeC,IAAI,CAACC,IAAL,CAAUJ,MAAM,GAAG,CAAnB,CAAf,CAAR;AACAN,EAAAA,SAAS,CAACW,eAAV,CAA0BJ,CAA1B;AACA,MAAIK,GAAG,GAAGC,KAAK,CAACC,IAAN,CAAWP,CAAX,EAAcN,OAAd,EAAuBc,IAAvB,CAA4B,EAA5B,CAAV;AACA,SAAOH,GAAG,CAACI,KAAJ,CAAU,CAAV,EAAaV,MAAb,CAAP;AACD;;AAED,SAASW,gBAAT,CAA0BC,MAA1B,EAAmD;AACjD,MAAIC,QAAQ,GAAGD,MAAM,IAAI,EAAzB;;AACA,MAAIC,QAAQ,CAACb,MAAT,GAAkBT,mBAAtB,EAA2C;AACzCsB,IAAAA,QAAQ,GAAGA,QAAQ,GAAGd,eAAe,CAACR,mBAAmB,GAAGsB,QAAQ,CAACb,MAAhC,CAArC;AACD;;AACD,SAAOc,kBAAkB,CAACD,QAAD,CAAlB,CAA6BH,KAA7B,CAAmC,CAAnC,EAAsClB,mBAAtC,CAAP;AACD;;AAED,SAASuB,gBAAT,CAA0BT,GAA1B,EAAyD;AACvD,MAAIU,MAAM,GAAG,IAAIC,WAAJ,GAAkBC,MAAlB,CAAyBZ,GAAzB,CAAb;AACA,SAAOZ,SAAS,CAACyB,MAAV,CAAiBC,MAAjB,CAAwB,SAAxB,EAAmCJ,MAAnC,EAA2CK,IAA3C,CAAgD,UAASC,WAAT,EAAsB;AAC3E,QAAIC,IAAI,GAAGC,MAAM,CAACC,YAAP,CAAoBC,KAApB,CAA0B,IAA1B,EAAgC,IAAIxB,UAAJ,CAAeoB,WAAf,CAAhC,CAAX;AACA,QAAIK,IAAI,GAAGrC,iBAAiB,CAACiC,IAAD,CAA5B,CAF2E,CAEvC;;AACpC,WAAOI,IAAP;AACD,GAJM,CAAP;AAKD;;AAED,eAAe;AACblC,EAAAA,6BADa;AAEbkB,EAAAA,gBAFa;AAGbI,EAAAA;AAHa,CAAf","sourcesContent":["/*!\n * Copyright (c) 2019-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-disable complexity, max-statements */\nimport { stringToBase64Url } from '../../crypto';\nimport { MIN_VERIFIER_LENGTH, MAX_VERIFIER_LENGTH, DEFAULT_CODE_CHALLENGE_METHOD } from '../../constants';\nimport { webcrypto } from '../../crypto';\n\nfunction dec2hex (dec) {\n return ('0' + dec.toString(16)).substr(-2);\n}\n\nfunction getRandomString(length) {\n var a = new Uint8Array(Math.ceil(length / 2));\n webcrypto.getRandomValues(a);\n var str = Array.from(a, dec2hex).join('');\n return str.slice(0, length);\n}\n\nfunction generateVerifier(prefix?: string): string {\n var verifier = prefix || '';\n if (verifier.length < MIN_VERIFIER_LENGTH) {\n verifier = verifier + getRandomString(MIN_VERIFIER_LENGTH - verifier.length);\n }\n return encodeURIComponent(verifier).slice(0, MAX_VERIFIER_LENGTH);\n}\n\nfunction computeChallenge(str: string): PromiseLike<any> { \n var buffer = new TextEncoder().encode(str);\n return webcrypto.subtle.digest('SHA-256', buffer).then(function(arrayBuffer) {\n var hash = String.fromCharCode.apply(null, new Uint8Array(arrayBuffer));\n var b64u = stringToBase64Url(hash); // url-safe base64 variant\n return b64u;\n });\n}\n\nexport default {\n DEFAULT_CODE_CHALLENGE_METHOD,\n generateVerifier,\n computeChallenge\n};\n"],"file":"pkce.js"}
@@ -1,75 +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
- import { getWellKnown } from '../endpoints/well-known';
14
- import { AuthSdkError } from '../../errors';
15
- import { clone } from '../../util';
16
- import { getDefaultTokenParams } from './defaultTokenParams';
17
- import { DEFAULT_CODE_CHALLENGE_METHOD } from '../../constants';
18
- import pkce from './pkce'; // Prepares params for a call to /authorize or /token
19
-
20
- export function prepareTokenParams(sdk, tokenParams) {
21
- // build params using defaults + options
22
- var defaults = getDefaultTokenParams(sdk);
23
- tokenParams = Object.assign({}, defaults, clone(tokenParams));
24
-
25
- if (tokenParams.pkce === false) {
26
- // Implicit flow or authorization_code without PKCE
27
- return Promise.resolve(tokenParams);
28
- } // PKCE flow
29
-
30
-
31
- if (!sdk.features.isPKCESupported()) {
32
- var errorMessage = 'PKCE requires a modern browser with encryption support running in a secure context.';
33
-
34
- if (!sdk.features.isHTTPS()) {
35
- // eslint-disable-next-line max-len
36
- errorMessage += '\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.';
37
- }
38
-
39
- if (!sdk.features.hasTextEncoder()) {
40
- // eslint-disable-next-line max-len
41
- errorMessage += '\n"TextEncoder" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser.';
42
- }
43
-
44
- return Promise.reject(new AuthSdkError(errorMessage));
45
- } // set default code challenge method, if none provided
46
-
47
-
48
- if (!tokenParams.codeChallengeMethod) {
49
- tokenParams.codeChallengeMethod = DEFAULT_CODE_CHALLENGE_METHOD;
50
- } // responseType is forced
51
-
52
-
53
- tokenParams.responseType = 'code';
54
- return getWellKnown(sdk, null).then(function (res) {
55
- var methods = res['code_challenge_methods_supported'] || [];
56
-
57
- if (methods.indexOf(tokenParams.codeChallengeMethod) === -1) {
58
- throw new AuthSdkError('Invalid code_challenge_method');
59
- }
60
- }).then(function () {
61
- if (!tokenParams.codeVerifier) {
62
- tokenParams.codeVerifier = pkce.generateVerifier();
63
- }
64
-
65
- return pkce.computeChallenge(tokenParams.codeVerifier);
66
- }).then(function (codeChallenge) {
67
- // Clone/copy the params. Set codeChallenge
68
- var clonedParams = clone(tokenParams) || {};
69
- Object.assign(clonedParams, tokenParams, {
70
- codeChallenge: codeChallenge
71
- });
72
- return clonedParams;
73
- });
74
- }
75
- //# sourceMappingURL=prepareTokenParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/oidc/util/prepareTokenParams.ts"],"names":["getWellKnown","AuthSdkError","clone","getDefaultTokenParams","DEFAULT_CODE_CHALLENGE_METHOD","pkce","prepareTokenParams","sdk","tokenParams","defaults","Object","assign","Promise","resolve","features","isPKCESupported","errorMessage","isHTTPS","hasTextEncoder","reject","codeChallengeMethod","responseType","then","res","methods","indexOf","codeVerifier","generateVerifier","computeChallenge","codeChallenge","clonedParams"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,yBAA7B;AACA,SAASC,YAAT,QAA6B,cAA7B;AAEA,SAASC,KAAT,QAAsB,YAAtB;AACA,SAASC,qBAAT,QAAsC,sBAAtC;AACA,SAASC,6BAAT,QAA8C,iBAA9C;AACA,OAAOC,IAAP,MAAiB,QAAjB,C,CAEA;;AACA,OAAO,SAASC,kBAAT,CAA4BC,GAA5B,EAA2CC,WAA3C,EAA4F;AACjG;AACA,MAAMC,QAAQ,GAAGN,qBAAqB,CAACI,GAAD,CAAtC;AACAC,EAAAA,WAAW,GAAGE,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBF,QAAlB,EAA4BP,KAAK,CAACM,WAAD,CAAjC,CAAd;;AAEA,MAAIA,WAAW,CAACH,IAAZ,KAAqB,KAAzB,EAAgC;AAC9B;AACA,WAAOO,OAAO,CAACC,OAAR,CAAgBL,WAAhB,CAAP;AACD,GARgG,CAUjG;;;AACA,MAAI,CAACD,GAAG,CAACO,QAAJ,CAAaC,eAAb,EAAL,EAAqC;AACnC,QAAIC,YAAY,GAAG,qFAAnB;;AACA,QAAI,CAACT,GAAG,CAACO,QAAJ,CAAaG,OAAb,EAAL,EAA6B;AAC3B;AACAD,MAAAA,YAAY,IAAI,kGAAhB;AACD;;AACD,QAAI,CAACT,GAAG,CAACO,QAAJ,CAAaI,cAAb,EAAL,EAAoC;AAClC;AACAF,MAAAA,YAAY,IAAI,wGAAhB;AACD;;AACD,WAAOJ,OAAO,CAACO,MAAR,CAAe,IAAIlB,YAAJ,CAAiBe,YAAjB,CAAf,CAAP;AACD,GAtBgG,CAwBjG;;;AACA,MAAI,CAACR,WAAW,CAACY,mBAAjB,EAAsC;AACpCZ,IAAAA,WAAW,CAACY,mBAAZ,GAAkChB,6BAAlC;AACD,GA3BgG,CA6BjG;;;AACAI,EAAAA,WAAW,CAACa,YAAZ,GAA2B,MAA3B;AAEA,SAAOrB,YAAY,CAACO,GAAD,EAAM,IAAN,CAAZ,CACJe,IADI,CACC,UAAUC,GAAV,EAAe;AACnB,QAAIC,OAAO,GAAGD,GAAG,CAAC,kCAAD,CAAH,IAA2C,EAAzD;;AACA,QAAIC,OAAO,CAACC,OAAR,CAAgBjB,WAAW,CAACY,mBAA5B,MAAqD,CAAC,CAA1D,EAA6D;AAC3D,YAAM,IAAInB,YAAJ,CAAiB,+BAAjB,CAAN;AACD;AACF,GANI,EAOJqB,IAPI,CAOC,YAAY;AAChB,QAAI,CAACd,WAAW,CAACkB,YAAjB,EAA+B;AAC7BlB,MAAAA,WAAW,CAACkB,YAAZ,GAA2BrB,IAAI,CAACsB,gBAAL,EAA3B;AACD;;AACD,WAAOtB,IAAI,CAACuB,gBAAL,CAAsBpB,WAAW,CAACkB,YAAlC,CAAP;AACD,GAZI,EAaJJ,IAbI,CAaC,UAAUO,aAAV,EAAyB;AAC7B;AACA,QAAIC,YAAY,GAAG5B,KAAK,CAACM,WAAD,CAAL,IAAsB,EAAzC;AACAE,IAAAA,MAAM,CAACC,MAAP,CAAcmB,YAAd,EAA4BtB,WAA5B,EAAyC;AACvCqB,MAAAA,aAAa,EAAEA;AADwB,KAAzC;AAGA,WAAOC,YAAP;AACD,GApBI,CAAP;AAqBD","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 { getWellKnown } from '../endpoints/well-known';\nimport { AuthSdkError } from '../../errors';\nimport { OktaAuth, TokenParams } from '../../types';\nimport { clone } from '../../util';\nimport { getDefaultTokenParams } from './defaultTokenParams';\nimport { DEFAULT_CODE_CHALLENGE_METHOD } from '../../constants';\nimport pkce from './pkce';\n\n// Prepares params for a call to /authorize or /token\nexport function prepareTokenParams(sdk: OktaAuth, tokenParams?: TokenParams): Promise<TokenParams> {\n // build params using defaults + options\n const defaults = getDefaultTokenParams(sdk);\n tokenParams = Object.assign({}, defaults, clone(tokenParams));\n\n if (tokenParams.pkce === false) {\n // Implicit flow or authorization_code without PKCE\n return Promise.resolve(tokenParams);\n }\n\n // PKCE flow\n if (!sdk.features.isPKCESupported()) {\n var errorMessage = 'PKCE requires a modern browser with encryption support running in a secure context.';\n if (!sdk.features.isHTTPS()) {\n // eslint-disable-next-line max-len\n errorMessage += '\\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.';\n }\n if (!sdk.features.hasTextEncoder()) {\n // eslint-disable-next-line max-len\n errorMessage += '\\n\"TextEncoder\" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser.';\n }\n return Promise.reject(new AuthSdkError(errorMessage));\n }\n\n // set default code challenge method, if none provided\n if (!tokenParams.codeChallengeMethod) {\n tokenParams.codeChallengeMethod = DEFAULT_CODE_CHALLENGE_METHOD;\n }\n\n // responseType is forced\n tokenParams.responseType = 'code';\n\n return getWellKnown(sdk, null)\n .then(function (res) {\n var methods = res['code_challenge_methods_supported'] || [];\n if (methods.indexOf(tokenParams.codeChallengeMethod) === -1) {\n throw new AuthSdkError('Invalid code_challenge_method');\n }\n })\n .then(function () {\n if (!tokenParams.codeVerifier) {\n tokenParams.codeVerifier = pkce.generateVerifier();\n }\n return pkce.computeChallenge(tokenParams.codeVerifier);\n })\n .then(function (codeChallenge) {\n // Clone/copy the params. Set codeChallenge\n var clonedParams = clone(tokenParams) || {};\n Object.assign(clonedParams, tokenParams, {\n codeChallenge: codeChallenge,\n });\n return clonedParams;\n });\n}"],"file":"prepareTokenParams.js"}