oidc-spa 7.1.10 → 7.2.0-rc.2

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 (367) hide show
  1. package/backend.js +235 -352
  2. package/backend.js.map +1 -1
  3. package/core/AuthResponse.js +12 -49
  4. package/core/AuthResponse.js.map +1 -1
  5. package/core/Oidc.d.ts +1 -2
  6. package/core/Oidc.js.map +1 -1
  7. package/core/OidcInitializationError.d.ts +0 -13
  8. package/core/OidcInitializationError.js +8 -318
  9. package/core/OidcInitializationError.js.map +1 -1
  10. package/core/OidcMetadata.js +1 -1
  11. package/core/OidcMetadata.js.map +1 -1
  12. package/core/StateData.d.ts +5 -5
  13. package/core/StateData.js +25 -25
  14. package/core/StateData.js.map +1 -1
  15. package/core/configId.js +1 -1
  16. package/core/configId.js.map +1 -1
  17. package/core/createOidc.d.ts +8 -0
  18. package/core/createOidc.js +1030 -1292
  19. package/core/createOidc.js.map +1 -1
  20. package/core/diagnostic.d.ts +14 -0
  21. package/core/diagnostic.js +214 -0
  22. package/core/diagnostic.js.map +1 -0
  23. package/core/evtIsUserActive.js +26 -27
  24. package/core/evtIsUserActive.js.map +1 -1
  25. package/core/handleOidcCallback.js +99 -154
  26. package/core/handleOidcCallback.js.map +1 -1
  27. package/core/iframeMessageProtection.d.ts +1 -1
  28. package/core/iframeMessageProtection.js +40 -106
  29. package/core/iframeMessageProtection.js.map +1 -1
  30. package/core/index.d.ts +1 -1
  31. package/core/index.js +3 -3
  32. package/core/index.js.map +1 -1
  33. package/core/initialLocationHref.js +1 -1
  34. package/core/initialLocationHref.js.map +1 -1
  35. package/core/isNewBrowserSession.js +8 -8
  36. package/core/isNewBrowserSession.js.map +1 -1
  37. package/core/loginOrGoToAuthServer.d.ts +1 -1
  38. package/core/loginOrGoToAuthServer.js +188 -310
  39. package/core/loginOrGoToAuthServer.js.map +1 -1
  40. package/core/loginPropagationToOtherTabs.js +15 -16
  41. package/core/loginPropagationToOtherTabs.js.map +1 -1
  42. package/core/loginSilent.d.ts +2 -3
  43. package/core/loginSilent.js +118 -214
  44. package/core/loginSilent.js.map +1 -1
  45. package/core/logoutPropagationToOtherTabs.js +15 -16
  46. package/core/logoutPropagationToOtherTabs.js.map +1 -1
  47. package/core/oidcClientTsUserToTokens.d.ts +1 -1
  48. package/core/oidcClientTsUserToTokens.js +75 -72
  49. package/core/oidcClientTsUserToTokens.js.map +1 -1
  50. package/core/ongoingLoginOrRefreshProcesses.js +23 -89
  51. package/core/ongoingLoginOrRefreshProcesses.js.map +1 -1
  52. package/core/persistedAuthState.js +13 -13
  53. package/core/persistedAuthState.js.map +1 -1
  54. package/entrypoint.js +9 -9
  55. package/entrypoint.js.map +1 -1
  56. package/esm/core/AuthResponse.d.ts +5 -0
  57. package/{src/core/AuthResponse.ts → esm/core/AuthResponse.js} +3 -9
  58. package/esm/core/AuthResponse.js.map +1 -0
  59. package/esm/core/Oidc.d.ts +126 -0
  60. package/esm/core/Oidc.js +2 -0
  61. package/esm/core/Oidc.js.map +1 -0
  62. package/esm/core/OidcInitializationError.d.ts +7 -0
  63. package/esm/core/OidcInitializationError.js +17 -0
  64. package/esm/core/OidcInitializationError.js.map +1 -0
  65. package/{src/core/OidcMetadata.ts → esm/core/OidcMetadata.d.ts} +0 -5
  66. package/esm/core/OidcMetadata.js +3 -0
  67. package/esm/core/OidcMetadata.js.map +1 -0
  68. package/esm/core/StateData.d.ts +42 -0
  69. package/esm/core/StateData.js +55 -0
  70. package/esm/core/StateData.js.map +1 -0
  71. package/esm/core/configId.d.ts +4 -0
  72. package/esm/core/configId.js +4 -0
  73. package/esm/core/configId.js.map +1 -0
  74. package/esm/core/createOidc.d.ts +132 -0
  75. package/{src/core/createOidc.ts → esm/core/createOidc.js} +282 -826
  76. package/esm/core/createOidc.js.map +1 -0
  77. package/esm/core/diagnostic.d.ts +14 -0
  78. package/{src/core/OidcInitializationError.ts → esm/core/diagnostic.js} +40 -117
  79. package/esm/core/diagnostic.js.map +1 -0
  80. package/esm/core/evtIsUserActive.d.ts +5 -0
  81. package/{src/core/evtIsUserActive.ts → esm/core/evtIsUserActive.js} +14 -46
  82. package/esm/core/evtIsUserActive.js.map +1 -0
  83. package/esm/core/handleOidcCallback.d.ts +13 -0
  84. package/{src/core/handleOidcCallback.ts → esm/core/handleOidcCallback.js} +56 -131
  85. package/esm/core/handleOidcCallback.js.map +1 -0
  86. package/esm/core/iframeMessageProtection.d.ts +20 -0
  87. package/{src/core/iframeMessageProtection.ts → esm/core/iframeMessageProtection.js} +14 -49
  88. package/esm/core/iframeMessageProtection.js.map +1 -0
  89. package/{src/core/index.ts → esm/core/index.d.ts} +1 -1
  90. package/esm/core/index.js +4 -0
  91. package/esm/core/index.js.map +1 -0
  92. package/esm/core/initialLocationHref.d.ts +1 -0
  93. package/{src/core/initialLocationHref.ts → esm/core/initialLocationHref.js} +1 -1
  94. package/esm/core/initialLocationHref.js.map +1 -0
  95. package/esm/core/isNewBrowserSession.d.ts +9 -0
  96. package/{src/core/isNewBrowserSession.ts → esm/core/isNewBrowserSession.js} +3 -15
  97. package/esm/core/isNewBrowserSession.js.map +1 -0
  98. package/esm/core/loginOrGoToAuthServer.d.ts +40 -0
  99. package/{src/core/loginOrGoToAuthServer.ts → esm/core/loginOrGoToAuthServer.js} +60 -168
  100. package/esm/core/loginOrGoToAuthServer.js.map +1 -0
  101. package/esm/core/loginPropagationToOtherTabs.d.ts +8 -0
  102. package/{src/core/loginPropagationToOtherTabs.ts → esm/core/loginPropagationToOtherTabs.js} +7 -25
  103. package/esm/core/loginPropagationToOtherTabs.js.map +1 -0
  104. package/esm/core/loginSilent.d.ts +28 -0
  105. package/esm/core/loginSilent.js +125 -0
  106. package/esm/core/loginSilent.js.map +1 -0
  107. package/esm/core/logoutPropagationToOtherTabs.d.ts +10 -0
  108. package/{src/core/logoutPropagationToOtherTabs.ts → esm/core/logoutPropagationToOtherTabs.js} +8 -28
  109. package/esm/core/logoutPropagationToOtherTabs.js.map +1 -0
  110. package/esm/core/oidcClientTsUserToTokens.d.ts +11 -0
  111. package/esm/core/oidcClientTsUserToTokens.js +155 -0
  112. package/esm/core/oidcClientTsUserToTokens.js.map +1 -0
  113. package/esm/core/ongoingLoginOrRefreshProcesses.d.ts +6 -0
  114. package/{src/core/ongoingLoginOrRefreshProcesses.ts → esm/core/ongoingLoginOrRefreshProcesses.js} +6 -24
  115. package/esm/core/ongoingLoginOrRefreshProcesses.js.map +1 -0
  116. package/esm/core/persistedAuthState.d.ts +28 -0
  117. package/esm/core/persistedAuthState.js +64 -0
  118. package/esm/core/persistedAuthState.js.map +1 -0
  119. package/esm/entrypoint.d.ts +7 -0
  120. package/{src/entrypoint.ts → esm/entrypoint.js} +3 -26
  121. package/esm/entrypoint.js.map +1 -0
  122. package/esm/index.d.ts +1 -0
  123. package/esm/index.js +2 -0
  124. package/esm/index.js.map +1 -0
  125. package/esm/keycloak/index.d.ts +3 -0
  126. package/esm/keycloak/index.js +3 -0
  127. package/esm/keycloak/index.js.map +1 -0
  128. package/esm/keycloak/isKeycloak.d.ts +3 -0
  129. package/esm/keycloak/isKeycloak.js +17 -0
  130. package/esm/keycloak/isKeycloak.js.map +1 -0
  131. package/esm/keycloak/keycloak-js/Keycloak.d.ts +284 -0
  132. package/esm/keycloak/keycloak-js/Keycloak.js +774 -0
  133. package/esm/keycloak/keycloak-js/Keycloak.js.map +1 -0
  134. package/esm/keycloak/keycloak-js/index.d.ts +2 -0
  135. package/esm/keycloak/keycloak-js/index.js +2 -0
  136. package/esm/keycloak/keycloak-js/index.js.map +1 -0
  137. package/esm/keycloak/keycloak-js/types.d.ts +361 -0
  138. package/esm/keycloak/keycloak-js/types.js +2 -0
  139. package/esm/keycloak/keycloak-js/types.js.map +1 -0
  140. package/esm/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
  141. package/esm/keycloak/keycloakIssuerUriParsed.js +16 -0
  142. package/esm/keycloak/keycloakIssuerUriParsed.js.map +1 -0
  143. package/esm/keycloak/keycloakUtils.d.ts +37 -0
  144. package/esm/keycloak/keycloakUtils.js +44 -0
  145. package/esm/keycloak/keycloakUtils.js.map +1 -0
  146. package/esm/keycloak-js.d.ts +1 -0
  147. package/esm/keycloak-js.js +2 -0
  148. package/esm/keycloak-js.js.map +1 -0
  149. package/esm/mock/index.js +2 -0
  150. package/esm/mock/index.js.map +1 -0
  151. package/esm/mock/oidc.d.ts +19 -0
  152. package/{src/mock/oidc.ts → esm/mock/oidc.js} +28 -88
  153. package/esm/mock/oidc.js.map +1 -0
  154. package/esm/mock/react.d.ts +58 -0
  155. package/esm/mock/react.js +7 -0
  156. package/esm/mock/react.js.map +1 -0
  157. package/esm/react/index.js +2 -0
  158. package/esm/react/index.js.map +1 -0
  159. package/esm/react/react.d.ts +102 -0
  160. package/esm/react/react.js +221 -0
  161. package/esm/react/react.js.map +1 -0
  162. package/esm/tools/Deferred.d.ts +14 -0
  163. package/esm/tools/Deferred.js +23 -0
  164. package/esm/tools/Deferred.js.map +1 -0
  165. package/esm/tools/EphemeralSessionStorage.d.ts +12 -0
  166. package/{src/tools/EphemeralSessionStorage.ts → esm/tools/EphemeralSessionStorage.js} +30 -112
  167. package/esm/tools/EphemeralSessionStorage.js.map +1 -0
  168. package/esm/tools/Evt.d.ts +11 -0
  169. package/{src/tools/Evt.ts → esm/tools/Evt.js} +7 -25
  170. package/esm/tools/Evt.js.map +1 -0
  171. package/esm/tools/StatefulEvt.d.ts +12 -0
  172. package/esm/tools/StatefulEvt.js +21 -0
  173. package/esm/tools/StatefulEvt.js.map +1 -0
  174. package/esm/tools/ValueOrAsyncGetter.js +2 -0
  175. package/esm/tools/ValueOrAsyncGetter.js.map +1 -0
  176. package/esm/tools/asymmetricEncryption.d.ts +18 -0
  177. package/esm/tools/asymmetricEncryption.js +85 -0
  178. package/esm/tools/asymmetricEncryption.js.map +1 -0
  179. package/esm/tools/base64.d.ts +2 -0
  180. package/{src/tools/base64.ts → esm/tools/base64.js} +3 -3
  181. package/esm/tools/base64.js.map +1 -0
  182. package/esm/tools/createObjectThatThrowsIfAccessed.d.ts +8 -0
  183. package/{src/tools/createObjectThatThrowsIfAccessed.ts → esm/tools/createObjectThatThrowsIfAccessed.js} +7 -18
  184. package/esm/tools/createObjectThatThrowsIfAccessed.js.map +1 -0
  185. package/esm/tools/decodeJwt.d.ts +25 -0
  186. package/esm/tools/decodeJwt.js +60 -0
  187. package/esm/tools/decodeJwt.js.map +1 -0
  188. package/esm/tools/generateUrlSafeRandom.d.ts +3 -0
  189. package/{src/tools/generateUrlSafeRandom.ts → esm/tools/generateUrlSafeRandom.js} +5 -8
  190. package/esm/tools/generateUrlSafeRandom.js.map +1 -0
  191. package/esm/tools/getDownlinkAndRtt.d.ts +4 -0
  192. package/{src/tools/getDownlinkAndRtt.ts → esm/tools/getDownlinkAndRtt.js} +6 -10
  193. package/esm/tools/getDownlinkAndRtt.js.map +1 -0
  194. package/esm/tools/getIsOnline.d.ts +7 -0
  195. package/{src/tools/getIsOnline.ts → esm/tools/getIsOnline.js} +3 -9
  196. package/esm/tools/getIsOnline.js.map +1 -0
  197. package/esm/tools/getIsValidRemoteJson.d.ts +1 -0
  198. package/esm/tools/getIsValidRemoteJson.js +15 -0
  199. package/esm/tools/getIsValidRemoteJson.js.map +1 -0
  200. package/esm/tools/getPrUserInteraction.d.ts +4 -0
  201. package/{src/tools/getPrUserInteraction.ts → esm/tools/getPrUserInteraction.js} +2 -6
  202. package/esm/tools/getPrUserInteraction.js.map +1 -0
  203. package/esm/tools/getUserEnvironmentInfo.d.ts +1 -0
  204. package/esm/tools/getUserEnvironmentInfo.js +50 -0
  205. package/esm/tools/getUserEnvironmentInfo.js.map +1 -0
  206. package/esm/tools/haveSharedParentDomain.d.ts +4 -0
  207. package/{src/tools/haveSharedParentDomain.ts → esm/tools/haveSharedParentDomain.js} +3 -5
  208. package/esm/tools/haveSharedParentDomain.js.map +1 -0
  209. package/esm/tools/isDev.d.ts +1 -0
  210. package/{src/tools/isDev.ts → esm/tools/isDev.js} +5 -12
  211. package/esm/tools/isDev.js.map +1 -0
  212. package/esm/tools/parseKeycloakIssuerUri.d.ts +30 -0
  213. package/esm/tools/parseKeycloakIssuerUri.js +33 -0
  214. package/esm/tools/parseKeycloakIssuerUri.js.map +1 -0
  215. package/esm/tools/readExpirationTimeInJwt.d.ts +1 -0
  216. package/{src/tools/readExpirationTimeInJwt.ts → esm/tools/readExpirationTimeInJwt.js} +6 -7
  217. package/esm/tools/readExpirationTimeInJwt.js.map +1 -0
  218. package/esm/tools/startCountdown.d.ts +11 -0
  219. package/{src/tools/startCountdown.ts → esm/tools/startCountdown.js} +6 -17
  220. package/esm/tools/startCountdown.js.map +1 -0
  221. package/esm/tools/subscribeToUserInteraction.d.ts +6 -0
  222. package/{src/tools/subscribeToUserInteraction.ts → esm/tools/subscribeToUserInteraction.js} +4 -13
  223. package/esm/tools/subscribeToUserInteraction.js.map +1 -0
  224. package/esm/tools/toFullyQualifiedUrl.d.ts +10 -0
  225. package/{src/tools/toFullyQualifiedUrl.ts → esm/tools/toFullyQualifiedUrl.js} +7 -25
  226. package/esm/tools/toFullyQualifiedUrl.js.map +1 -0
  227. package/esm/tools/toHumanReadableDuration.d.ts +1 -0
  228. package/{src/tools/toHumanReadableDuration.ts → esm/tools/toHumanReadableDuration.js} +8 -5
  229. package/esm/tools/toHumanReadableDuration.js.map +1 -0
  230. package/esm/tools/urlSearchParams.d.ts +19 -0
  231. package/{src/tools/urlSearchParams.ts → esm/tools/urlSearchParams.js} +24 -70
  232. package/esm/tools/urlSearchParams.js.map +1 -0
  233. package/esm/tools/workerTimers.d.ts +5 -0
  234. package/{src/tools/workerTimers.ts → esm/tools/workerTimers.js} +7 -27
  235. package/esm/tools/workerTimers.js.map +1 -0
  236. package/esm/vendor/frontend/oidc-client-ts.d.ts +1 -0
  237. package/esm/vendor/frontend/oidc-client-ts.js +3636 -0
  238. package/{src/vendor/frontend/tsafe.ts → esm/vendor/frontend/tsafe.d.ts} +1 -0
  239. package/esm/vendor/frontend/tsafe.js +1 -0
  240. package/esm/vendor/frontend/worker-timers.js +1 -0
  241. package/index.d.ts +1 -1
  242. package/index.js +1 -2
  243. package/index.js.map +1 -1
  244. package/keycloak/index.d.ts +3 -0
  245. package/keycloak/index.js +8 -0
  246. package/keycloak/index.js.map +1 -0
  247. package/keycloak/isKeycloak.d.ts +3 -0
  248. package/keycloak/isKeycloak.js +20 -0
  249. package/keycloak/isKeycloak.js.map +1 -0
  250. package/keycloak/keycloak-js/Keycloak.d.ts +284 -0
  251. package/keycloak/keycloak-js/Keycloak.js +778 -0
  252. package/keycloak/keycloak-js/Keycloak.js.map +1 -0
  253. package/keycloak/keycloak-js/index.d.ts +2 -0
  254. package/keycloak/keycloak-js/index.js +6 -0
  255. package/keycloak/keycloak-js/index.js.map +1 -0
  256. package/keycloak/keycloak-js/types.d.ts +361 -0
  257. package/keycloak/keycloak-js/types.js +3 -0
  258. package/keycloak/keycloak-js/types.js.map +1 -0
  259. package/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
  260. package/keycloak/keycloakIssuerUriParsed.js +19 -0
  261. package/keycloak/keycloakIssuerUriParsed.js.map +1 -0
  262. package/keycloak/keycloakUtils.d.ts +37 -0
  263. package/keycloak/keycloakUtils.js +47 -0
  264. package/keycloak/keycloakUtils.js.map +1 -0
  265. package/keycloak-js.d.ts +1 -0
  266. package/keycloak-js.js +18 -0
  267. package/keycloak-js.js.map +1 -0
  268. package/mock/index.js.map +1 -1
  269. package/mock/oidc.js +147 -194
  270. package/mock/oidc.js.map +1 -1
  271. package/mock/react.js +2 -2
  272. package/mock/react.js.map +1 -1
  273. package/package.json +74 -299
  274. package/react/index.js.map +1 -1
  275. package/react/react.js +133 -244
  276. package/react/react.js.map +1 -1
  277. package/tools/Deferred.js +13 -35
  278. package/tools/Deferred.js.map +1 -1
  279. package/tools/EphemeralSessionStorage.js +46 -48
  280. package/tools/EphemeralSessionStorage.js.map +1 -1
  281. package/tools/Evt.js +14 -14
  282. package/tools/Evt.js.map +1 -1
  283. package/tools/StatefulEvt.js +5 -5
  284. package/tools/StatefulEvt.js.map +1 -1
  285. package/tools/ValueOrAsyncGetter.js.map +1 -1
  286. package/tools/asymmetricEncryption.js +81 -172
  287. package/tools/asymmetricEncryption.js.map +1 -1
  288. package/tools/base64.js +2 -2
  289. package/tools/base64.js.map +1 -1
  290. package/tools/createObjectThatThrowsIfAccessed.js +13 -61
  291. package/tools/createObjectThatThrowsIfAccessed.js.map +1 -1
  292. package/tools/decodeJwt.d.ts +25 -2
  293. package/tools/decodeJwt.js +61 -3
  294. package/tools/decodeJwt.js.map +1 -1
  295. package/tools/generateUrlSafeRandom.js +5 -30
  296. package/tools/generateUrlSafeRandom.js.map +1 -1
  297. package/tools/getDownlinkAndRtt.js +8 -30
  298. package/tools/getDownlinkAndRtt.js.map +1 -1
  299. package/tools/getIsOnline.js +3 -3
  300. package/tools/getIsOnline.js.map +1 -1
  301. package/tools/getIsValidRemoteJson.js +12 -59
  302. package/tools/getIsValidRemoteJson.js.map +1 -1
  303. package/tools/getPrUserInteraction.js +4 -4
  304. package/tools/getPrUserInteraction.js.map +1 -1
  305. package/tools/getUserEnvironmentInfo.js +17 -12
  306. package/tools/getUserEnvironmentInfo.js.map +1 -1
  307. package/tools/haveSharedParentDomain.js +5 -5
  308. package/tools/haveSharedParentDomain.js.map +1 -1
  309. package/tools/isDev.js +2 -2
  310. package/tools/isDev.js.map +1 -1
  311. package/tools/parseKeycloakIssuerUri.d.ts +2 -0
  312. package/tools/parseKeycloakIssuerUri.js +11 -42
  313. package/tools/parseKeycloakIssuerUri.js.map +1 -1
  314. package/tools/readExpirationTimeInJwt.js +4 -4
  315. package/tools/readExpirationTimeInJwt.js.map +1 -1
  316. package/tools/startCountdown.js +17 -65
  317. package/tools/startCountdown.js.map +1 -1
  318. package/tools/subscribeToUserInteraction.js +17 -66
  319. package/tools/subscribeToUserInteraction.js.map +1 -1
  320. package/tools/toFullyQualifiedUrl.js +7 -7
  321. package/tools/toFullyQualifiedUrl.js.map +1 -1
  322. package/tools/toHumanReadableDuration.js +13 -13
  323. package/tools/toHumanReadableDuration.js.map +1 -1
  324. package/tools/urlSearchParams.js +28 -50
  325. package/tools/urlSearchParams.js.map +1 -1
  326. package/tools/workerTimers.js +10 -10
  327. package/tools/workerTimers.js.map +1 -1
  328. package/vendor/frontend/oidc-client-ts.d.ts +1 -0
  329. package/vendor/frontend/oidc-client-ts.js +3686 -0
  330. package/vendor/frontend/tsafe.d.ts +1 -0
  331. package/vendor/frontend/tsafe.js +1 -1
  332. package/LICENSE +0 -21
  333. package/README.md +0 -185
  334. package/core/trustedFetch.d.ts +0 -2
  335. package/core/trustedFetch.js +0 -12
  336. package/core/trustedFetch.js.map +0 -1
  337. package/src/backend.ts +0 -391
  338. package/src/core/Oidc.ts +0 -141
  339. package/src/core/StateData.ts +0 -118
  340. package/src/core/configId.ts +0 -3
  341. package/src/core/loginSilent.ts +0 -206
  342. package/src/core/oidcClientTsUserToTokens.ts +0 -229
  343. package/src/core/persistedAuthState.ts +0 -122
  344. package/src/core/trustedFetch.ts +0 -9
  345. package/src/index.ts +0 -7
  346. package/src/mock/react.tsx +0 -11
  347. package/src/react/react.tsx +0 -460
  348. package/src/tools/Deferred.ts +0 -39
  349. package/src/tools/StatefulEvt.ts +0 -38
  350. package/src/tools/asymmetricEncryption.ts +0 -184
  351. package/src/tools/decodeJwt.ts +0 -2
  352. package/src/tools/getIsValidRemoteJson.ts +0 -18
  353. package/src/tools/getUserEnvironmentInfo.ts +0 -42
  354. package/src/tools/parseKeycloakIssuerUri.ts +0 -68
  355. package/src/vendor/backend/evt.ts +0 -2
  356. package/src/vendor/backend/jsonwebtoken.ts +0 -1
  357. package/src/vendor/backend/node-fetch.ts +0 -2
  358. package/src/vendor/backend/node-jose.ts +0 -1
  359. package/src/vendor/backend/tsafe.ts +0 -5
  360. package/src/vendor/backend/zod.ts +0 -1
  361. package/src/vendor/frontend/oidc-client-ts-and-jwt-decode.ts +0 -4
  362. package/vendor/frontend/oidc-client-ts-and-jwt-decode.d.ts +0 -3
  363. package/vendor/frontend/oidc-client-ts-and-jwt-decode.js +0 -3
  364. /package/{src/mock/index.ts → esm/mock/index.d.ts} +0 -0
  365. /package/{src/react/index.ts → esm/react/index.d.ts} +0 -0
  366. /package/{src/tools/ValueOrAsyncGetter.ts → esm/tools/ValueOrAsyncGetter.d.ts} +0 -0
  367. /package/{src/vendor/frontend/worker-timers.ts → esm/vendor/frontend/worker-timers.d.ts} +0 -0
@@ -0,0 +1,126 @@
1
+ import type { OidcInitializationError } from "./OidcInitializationError";
2
+ export declare type Oidc<DecodedIdToken extends Record<string, unknown> = Oidc.Tokens.DecodedIdToken_base> = Oidc.LoggedIn<DecodedIdToken> | Oidc.NotLoggedIn;
3
+ export declare namespace Oidc {
4
+ type Common = {
5
+ params: {
6
+ issuerUri: string;
7
+ clientId: string;
8
+ };
9
+ };
10
+ type NotLoggedIn = Common & {
11
+ isUserLoggedIn: false;
12
+ login: (params: {
13
+ doesCurrentHrefRequiresAuth: boolean;
14
+ /**
15
+ * Add extra query parameters to the url before redirecting to the login pages.
16
+ */
17
+ extraQueryParams?: Record<string, string | undefined>;
18
+ /**
19
+ * Where to redirect after successful login.
20
+ * Default: window.location.href (here)
21
+ *
22
+ * It does not need to include the origin, eg: "/dashboard"
23
+ */
24
+ redirectUrl?: string;
25
+ /**
26
+ * Transform the url before redirecting to the login pages.
27
+ * Prefer using the extraQueryParams parameter if you're only adding query parameters.
28
+ */
29
+ transformUrlBeforeRedirect?: (url: string) => string;
30
+ }) => Promise<never>;
31
+ initializationError: OidcInitializationError | undefined;
32
+ };
33
+ type LoggedIn<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>> = Common & {
34
+ isUserLoggedIn: true;
35
+ renewTokens(params?: {
36
+ extraTokenParams?: Record<string, string | undefined>;
37
+ }): Promise<void>;
38
+ getTokens: () => Promise<Tokens<DecodedIdToken>>;
39
+ subscribeToTokensChange: (onTokenChange: (tokens: Tokens<DecodedIdToken>) => void) => {
40
+ unsubscribe: () => void;
41
+ };
42
+ getDecodedIdToken: () => DecodedIdToken;
43
+ logout: (params: {
44
+ redirectTo: "home" | "current page";
45
+ } | {
46
+ redirectTo: "specific url";
47
+ url: string;
48
+ }) => Promise<never>;
49
+ goToAuthServer: (params: {
50
+ extraQueryParams?: Record<string, string | undefined>;
51
+ redirectUrl?: string;
52
+ transformUrlBeforeRedirect?: (url: string) => string;
53
+ }) => Promise<never>;
54
+ subscribeToAutoLogoutCountdown: (tickCallback: (params: {
55
+ secondsLeft: number | undefined;
56
+ }) => void) => {
57
+ unsubscribeFromAutoLogoutCountdown: () => void;
58
+ };
59
+ /**
60
+ * If you called `goToAuthServer` or `login` with extraQueryParams, this object let you know the outcome of the
61
+ * of the action that was intended.
62
+ *
63
+ * For example, on a Keycloak server, if you called `goToAuthServer({ extraQueryParams: { kc_action: "UPDATE_PASSWORD" } })`
64
+ * you'll get back: `{ extraQueryParams: { kc_action: "UPDATE_PASSWORD" }, result: { kc_action_status: "success" } }` (or "cancelled")
65
+ */
66
+ backFromAuthServer: {
67
+ extraQueryParams: Record<string, string>;
68
+ result: Record<string, string>;
69
+ } | undefined;
70
+ /**
71
+ * This is true when the user has just returned from the login pages.
72
+ * This is also true when the user navigate to your app and was able to be silently signed in because there was still a valid session.
73
+ * This false however when the use just reload the page.
74
+ *
75
+ * This can be used to perform some action related to session initialization
76
+ * but avoiding doing it repeatedly every time the user reload the page.
77
+ *
78
+ * Note that this is referring to the browser session and not the OIDC session
79
+ * on the server side.
80
+ *
81
+ * If you want to perform an action only when a new OIDC session is created
82
+ * you can test oidc.isNewBrowserSession && oidc.backFromAuthServer !== undefined
83
+ */
84
+ isNewBrowserSession: boolean;
85
+ };
86
+ type Tokens<DecodedIdToken extends Record<string, unknown> = Tokens.DecodedIdToken_base> = Tokens.WithRefreshToken<DecodedIdToken> | Tokens.WithoutRefreshToken<DecodedIdToken>;
87
+ namespace Tokens {
88
+ type Common<DecodedIdToken> = {
89
+ accessToken: string;
90
+ accessTokenExpirationTime: number;
91
+ idToken: string;
92
+ decodedIdToken: DecodedIdToken;
93
+ /**
94
+ * decodedIdToken_original = decodeJwt(idToken);
95
+ * decodedIdToken = decodedIdTokenSchema.parse(decodedIdToken_original)
96
+ *
97
+ * The idea here is that if you have provided a zod schema as `decodedIdTokenSchema`
98
+ * it will strip out every claim that you haven't specified.
99
+ * You might even be applying some transformation.
100
+ *
101
+ * `decodedIdToken_original` is the actual decoded payload of the id_token, untransformed.
102
+ * */
103
+ decodedIdToken_original: DecodedIdToken_base;
104
+ /** Read from id_token's JWT, iat claim value, it's a JavaScript timestamp (millisecond epoch) */
105
+ issuedAtTime: number;
106
+ };
107
+ type WithRefreshToken<DecodedIdToken> = Common<DecodedIdToken> & {
108
+ hasRefreshToken: true;
109
+ refreshToken: string;
110
+ refreshTokenExpirationTime: number | undefined;
111
+ };
112
+ type WithoutRefreshToken<DecodedIdToken> = Common<DecodedIdToken> & {
113
+ hasRefreshToken: false;
114
+ refreshToken?: never;
115
+ refreshTokenExpirationTime?: never;
116
+ };
117
+ type DecodedIdToken_base = {
118
+ iss: string;
119
+ sub: string;
120
+ aud: string | string[];
121
+ exp: number;
122
+ iat: number;
123
+ [claimName: string]: unknown;
124
+ };
125
+ }
126
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Oidc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Oidc.js","sourceRoot":"","sources":["../../../src/core/Oidc.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export declare class OidcInitializationError extends Error {
2
+ readonly isAuthServerLikelyDown: boolean;
3
+ constructor(params: {
4
+ messageOrCause: string | Error;
5
+ isAuthServerLikelyDown: boolean;
6
+ });
7
+ }
@@ -0,0 +1,17 @@
1
+ export class OidcInitializationError extends Error {
2
+ constructor(params) {
3
+ super((() => {
4
+ if (typeof params.messageOrCause === "string") {
5
+ return params.messageOrCause;
6
+ }
7
+ else {
8
+ return `Unknown initialization error: ${params.messageOrCause.message}`;
9
+ }
10
+ })(),
11
+ // @ts-expect-error
12
+ { cause: typeof params.messageOrCause === "string" ? undefined : params.messageOrCause });
13
+ this.isAuthServerLikelyDown = params.isAuthServerLikelyDown;
14
+ Object.setPrototypeOf(this, new.target.prototype);
15
+ }
16
+ }
17
+ //# sourceMappingURL=OidcInitializationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OidcInitializationError.js","sourceRoot":"","sources":["../../../src/core/OidcInitializationError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAG9C,YAAY,MAA2E;QACnF,KAAK,CACD,CAAC,GAAG,EAAE;YACF,IAAI,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;gBAC5C,OAAO,MAAM,CAAC,cAAc,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACJ,OAAO,iCAAiC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC5E,CAAC;QACL,CAAC,CAAC,EAAE;QACJ,mBAAmB;QACnB,EAAE,KAAK,EAAE,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,CAC3F,CAAC;QACF,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAC5D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACJ"}
@@ -1,6 +1,3 @@
1
- import { type OidcMetadata as OidcClientTsOidcMetadata } from "../vendor/frontend/oidc-client-ts-and-jwt-decode";
2
- import { assert, type Equals } from "../vendor/frontend/tsafe";
3
-
4
1
  /**
5
2
  * OpenID Providers have metadata describing their configuration.
6
3
  *
@@ -267,5 +264,3 @@ export type OidcMetadata = {
267
264
  */
268
265
  code_challenge_methods_supported: string[];
269
266
  };
270
-
271
- assert<Equals<OidcMetadata, OidcClientTsOidcMetadata>>;
@@ -0,0 +1,3 @@
1
+ import { assert } from "../vendor/frontend/tsafe";
2
+ assert;
3
+ //# sourceMappingURL=OidcMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OidcMetadata.js","sourceRoot":"","sources":["../../../src/core/OidcMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,MAAM,0BAA0B,CAAC;AA6Q/D,MAAsD,CAAC"}
@@ -0,0 +1,42 @@
1
+ export type StateData = StateData.IFrame | StateData.Redirect;
2
+ export declare namespace StateData {
3
+ type Common = {
4
+ configId: string;
5
+ };
6
+ export type IFrame = Common & {
7
+ context: "iframe";
8
+ };
9
+ export type Redirect = Redirect.Login | Redirect.Logout;
10
+ export namespace Redirect {
11
+ type Common_Redirect = Common & {
12
+ context: "redirect";
13
+ redirectUrl: string;
14
+ hasBeenProcessedByCallback: boolean;
15
+ };
16
+ export type Login = Common_Redirect & {
17
+ action: "login";
18
+ redirectUrl_consentRequiredCase: string;
19
+ extraQueryParams: Record<string, string>;
20
+ };
21
+ export type Logout = Common_Redirect & {
22
+ action: "logout";
23
+ sessionId: string | undefined;
24
+ };
25
+ export {};
26
+ }
27
+ export {};
28
+ }
29
+ export declare function generateStateUrlParamValue(): string;
30
+ export declare function getIsStatQueryParamValue(params: {
31
+ maybeStateUrlParamValue: string;
32
+ }): boolean;
33
+ export declare const STATE_STORE_KEY_PREFIX = "oidc.";
34
+ export declare function clearStateStore(params: {
35
+ stateUrlParamValue: string;
36
+ }): void;
37
+ export declare function getStateData(params: {
38
+ stateUrlParamValue: string;
39
+ }): StateData | undefined;
40
+ export declare function markStateDataAsProcessedByCallback(params: {
41
+ stateUrlParamValue: string;
42
+ }): void;
@@ -0,0 +1,55 @@
1
+ import { typeGuard, assert } from "../vendor/frontend/tsafe";
2
+ import { generateUrlSafeRandom } from "../tools/generateUrlSafeRandom";
3
+ const STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX = "b2lkYy1zcGEu";
4
+ const RANDOM_STRING_LENGTH = 32 - STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX.length;
5
+ export function generateStateUrlParamValue() {
6
+ return `${STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX}${generateUrlSafeRandom({
7
+ length: RANDOM_STRING_LENGTH
8
+ })}`;
9
+ }
10
+ export function getIsStatQueryParamValue(params) {
11
+ const { maybeStateUrlParamValue } = params;
12
+ return (maybeStateUrlParamValue.startsWith(STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX) &&
13
+ maybeStateUrlParamValue.length ===
14
+ STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX.length + RANDOM_STRING_LENGTH);
15
+ }
16
+ export const STATE_STORE_KEY_PREFIX = "oidc.";
17
+ function getKey(params) {
18
+ const { stateUrlParamValue } = params;
19
+ return `${STATE_STORE_KEY_PREFIX}${stateUrlParamValue}`;
20
+ }
21
+ function getStateStore(params) {
22
+ const { stateUrlParamValue } = params;
23
+ const item = localStorage.getItem(getKey({ stateUrlParamValue }));
24
+ if (item === null) {
25
+ return undefined;
26
+ }
27
+ const obj = JSON.parse(item);
28
+ assert(typeGuard(obj, obj instanceof Object && obj.data instanceof Object && typeof obj.data.context === "string"));
29
+ return obj;
30
+ }
31
+ function setStateStore(params) {
32
+ const { stateUrlParamValue, obj } = params;
33
+ localStorage.setItem(getKey({ stateUrlParamValue }), JSON.stringify(obj));
34
+ }
35
+ export function clearStateStore(params) {
36
+ const { stateUrlParamValue } = params;
37
+ localStorage.removeItem(getKey({ stateUrlParamValue }));
38
+ }
39
+ export function getStateData(params) {
40
+ const { stateUrlParamValue } = params;
41
+ const stateStore = getStateStore({ stateUrlParamValue });
42
+ if (stateStore === undefined) {
43
+ return undefined;
44
+ }
45
+ return stateStore.data;
46
+ }
47
+ export function markStateDataAsProcessedByCallback(params) {
48
+ const { stateUrlParamValue } = params;
49
+ const obj = getStateStore({ stateUrlParamValue });
50
+ assert(obj !== undefined, "180465");
51
+ assert(obj.data.context === "redirect", "649531");
52
+ obj.data.hasBeenProcessedByCallback = true;
53
+ setStateStore({ stateUrlParamValue, obj });
54
+ }
55
+ //# sourceMappingURL=StateData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateData.js","sourceRoot":"","sources":["../../../src/core/StateData.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ export declare function getConfigId(params: {
2
+ issuerUri: string;
3
+ clientId: string;
4
+ }): string;
@@ -0,0 +1,4 @@
1
+ export function getConfigId(params) {
2
+ return `${params.issuerUri}:${params.clientId}`;
3
+ }
4
+ //# sourceMappingURL=configId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configId.js","sourceRoot":"","sources":["../../../src/core/configId.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,MAA+C;IACvE,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,132 @@
1
+ import type { OidcMetadata } from "./OidcMetadata";
2
+ import type { Oidc } from "./Oidc";
3
+ export type ParamsOfCreateOidc<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false> = {
4
+ issuerUri: string;
5
+ clientId: string;
6
+ /**
7
+ * The scopes being requested from the OIDC/OAuth2 provider (default: `["profile"]`
8
+ * (the scope "openid" is added automatically as it's mandatory)
9
+ **/
10
+ scopes?: string[];
11
+ /**
12
+ * Transform the url (authorization endpoint) before redirecting to the login pages.
13
+ *
14
+ * The isSilent parameter is true when the redirect is initiated in the background iframe for silent signin.
15
+ * This can be used to omit ui related query parameters (like `ui_locales`).
16
+ */
17
+ transformUrlBeforeRedirect?: (params: {
18
+ authorizationUrl: string;
19
+ isSilent: boolean;
20
+ }) => string;
21
+ /**
22
+ * Extra query params to be added to the authorization endpoint url before redirecting or silent signing in.
23
+ * You can provide a function that returns those extra query params, it will be called
24
+ * when login() is called.
25
+ *
26
+ * Example: extraQueryParams: ()=> ({ ui_locales: "fr" })
27
+ *
28
+ * This parameter can also be passed to login() directly.
29
+ */
30
+ extraQueryParams?: Record<string, string | undefined> | ((params: {
31
+ isSilent: boolean;
32
+ url: string;
33
+ }) => Record<string, string | undefined>);
34
+ /**
35
+ * Extra body params to be added to the /token POST request.
36
+ *
37
+ * It will be used when for the initial request, whenever the token is getting refreshed and if you call `renewTokens()`.
38
+ * You can also provide this parameter directly to the `renewTokens()` method.
39
+ *
40
+ * It can be either a string to string record or a function that returns a string to string record.
41
+ *
42
+ * Example: extraTokenParams: ()=> ({ selectedCustomer: "xxx" })
43
+ * extraTokenParams: { selectedCustomer: "xxx" }
44
+ */
45
+ extraTokenParams?: Record<string, string | undefined> | (() => Record<string, string | undefined>);
46
+ /**
47
+ * Usage discouraged, it's here because we don't want to assume too much on your
48
+ * usecase but I can't think of a scenario where you would want anything
49
+ * other than the current page.
50
+ *
51
+ * Where to redirect after successful login.
52
+ * Default: window.location.href (here)
53
+ *
54
+ * It does not need to include the origin, eg: "/dashboard"
55
+ *
56
+ * This parameter can also be passed to login() directly as `redirectUrl`.
57
+ */
58
+ postLoginRedirectUrl?: string;
59
+ /**
60
+ * What should you put in this parameter?
61
+ * - Vite project: `BASE_URL: import.meta.env.BASE_URL`
62
+ * - Create React App project: `BASE_URL: process.env.PUBLIC_URL`
63
+ * - Other: `BASE_URL: "/"` (Usually, or `/dashboard` if your app is not at the root of the domain)
64
+ */
65
+ homeUrl: string;
66
+ decodedIdTokenSchema?: {
67
+ parse: (decodedIdToken_original: Oidc.Tokens.DecodedIdToken_base) => DecodedIdToken;
68
+ };
69
+ /**
70
+ * This parameter defines after how many seconds of inactivity the user should be
71
+ * logged out automatically.
72
+ *
73
+ * WARNING: It should be configured on the identity server side
74
+ * as it's the authoritative source for security policies and not the client.
75
+ * If you don't provide this parameter it will be inferred from the refresh token expiration time.
76
+ * */
77
+ idleSessionLifetimeInSeconds?: number;
78
+ /**
79
+ * Usage discouraged, this parameter exists because we don't want to assume
80
+ * too much about your usecase but I can't think of a scenario where you would
81
+ * want anything other than the current page.
82
+ *
83
+ * Default: { redirectTo: "current page" }
84
+ */
85
+ autoLogoutParams?: Parameters<Oidc.LoggedIn<any>["logout"]>[0];
86
+ autoLogin?: AutoLogin;
87
+ /**
88
+ * Default: false
89
+ *
90
+ * See: https://docs.oidc-spa.dev/v/v7/resources/iframe-related-issues
91
+ */
92
+ noIframe?: boolean;
93
+ debugLogs?: boolean;
94
+ /**
95
+ * WARNING: This option exists solely as a workaround
96
+ * for limitations in the Google OAuth API.
97
+ * See: https://docs.oidc-spa.dev/providers-configuration/google-oauth
98
+ *
99
+ * Do not use this for other providers.
100
+ * If you think you need a client secret in a SPA, you are likely
101
+ * trying to use a confidential (private) client in the browser,
102
+ * which is insecure and not supported.
103
+ */
104
+ __unsafe_clientSecret?: string;
105
+ /**
106
+ * WARNING: Setting this to true is a workaround for provider
107
+ * like Google OAuth that don't support JWT access token.
108
+ * Use at your own risk, this is a hack.
109
+ */
110
+ __unsafe_useIdTokenAsAccessToken?: boolean;
111
+ /**
112
+ * This option should only be used as a last resort.
113
+ *
114
+ * If your OIDC provider is correctly configured, this should not be necessary.
115
+ *
116
+ * The metadata is normally retrieved automatically from:
117
+ * `${issuerUri}/.well-known/openid-configuration`
118
+ *
119
+ * Use this only if that endpoint is not accessible (e.g. due to missing CORS headers
120
+ * or non-standard deployments), and you cannot fix the server-side configuration.
121
+ */
122
+ __metadata?: Partial<OidcMetadata>;
123
+ };
124
+ /** @see: https://docs.oidc-spa.dev/v/v7/usage */
125
+ export declare function createOidc<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false>(params: ParamsOfCreateOidc<DecodedIdToken, AutoLogin>): Promise<AutoLogin extends true ? Oidc.LoggedIn<DecodedIdToken> : Oidc<DecodedIdToken>>;
126
+ export declare function createOidc_nonMemoized<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false>(params: Omit<ParamsOfCreateOidc<DecodedIdToken, AutoLogin>, "issuerUri" | "clientId" | "scopes" | "debugLogs">, preProcessedParams: {
127
+ issuerUri: string;
128
+ clientId: string;
129
+ scopes: string[];
130
+ configId: string;
131
+ log: typeof console.log | undefined;
132
+ }): Promise<AutoLogin extends true ? Oidc.LoggedIn<DecodedIdToken> : Oidc<DecodedIdToken>>;