@inrupt/solid-client-authn-browser 1.12.4 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/ClientAuthentication.js +5 -1
  2. package/dist/ClientAuthentication.js.map +1 -1
  3. package/dist/login/oidc/IssuerConfigFetcher.js +1 -2
  4. package/dist/login/oidc/IssuerConfigFetcher.js.map +1 -1
  5. package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js +4 -0
  6. package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js.map +1 -1
  7. package/dist/solid-client-authn.bundle.js +1 -1
  8. package/package.json +4 -4
  9. package/src/ClientAuthentication.spec.ts +73 -21
  10. package/src/ClientAuthentication.ts +33 -25
  11. package/src/Session.spec.ts +20 -20
  12. package/src/Session.ts +20 -20
  13. package/src/__mocks__/ClientAuthentication.ts +20 -20
  14. package/src/constant.ts +20 -20
  15. package/src/defaultSession.spec.ts +20 -20
  16. package/src/defaultSession.ts +20 -20
  17. package/src/dependencies.node.spec.ts +20 -20
  18. package/src/dependencies.spec.ts +20 -20
  19. package/src/dependencies.ts +20 -20
  20. package/src/index.browser.spec.ts +20 -20
  21. package/src/index.browser.ts +20 -20
  22. package/src/index.spec.ts +20 -20
  23. package/src/index.ts +20 -20
  24. package/src/login/__mocks__/LoginHandler.ts +20 -20
  25. package/src/login/oidc/AggregateOidcHandler.spec.ts +20 -20
  26. package/src/login/oidc/AggregateOidcHandler.ts +20 -20
  27. package/src/login/oidc/AggregateRedirectHandler.ts +20 -20
  28. package/src/login/oidc/ClientRegistrar.spec.ts +20 -20
  29. package/src/login/oidc/ClientRegistrar.ts +20 -20
  30. package/src/login/oidc/IssuerConfigFetcher.spec.ts +20 -20
  31. package/src/login/oidc/IssuerConfigFetcher.ts +21 -25
  32. package/src/login/oidc/OidcLoginHandler.spec.ts +20 -20
  33. package/src/login/oidc/OidcLoginHandler.ts +20 -20
  34. package/src/login/oidc/Redirector.spec.ts +20 -20
  35. package/src/login/oidc/Redirector.ts +20 -20
  36. package/src/login/oidc/__mocks__/ClientRegistrar.ts +20 -20
  37. package/src/login/oidc/__mocks__/IOidcHandler.ts +20 -20
  38. package/src/login/oidc/__mocks__/IOidcOptions.ts +20 -20
  39. package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +20 -20
  40. package/src/login/oidc/__mocks__/Redirector.ts +20 -20
  41. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +42 -20
  42. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +28 -20
  43. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +20 -20
  44. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +20 -20
  45. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +20 -20
  46. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +20 -20
  47. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +20 -20
  48. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +20 -20
  49. package/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts +20 -20
  50. package/src/login/oidc/refresh/TokenRefresher.spec.ts +20 -20
  51. package/src/login/oidc/refresh/TokenRefresher.ts +20 -20
  52. package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +20 -20
  53. package/src/logout/GeneralLogoutHandler.spec.ts +20 -20
  54. package/src/logout/GeneralLogoutHandler.ts +20 -20
  55. package/src/logout/__mocks__/LogoutHandler.ts +20 -20
  56. package/src/sessionInfo/SessionInfoManager.spec.ts +20 -20
  57. package/src/sessionInfo/SessionInfoManager.ts +20 -20
  58. package/src/sessionInfo/__mocks__/SessionInfoManager.ts +20 -20
  59. package/src/storage/BrowserStorage.spec.ts +20 -20
  60. package/src/storage/BrowserStorage.ts +20 -20
  61. package/src/storage/StorageUtility.ts +20 -20
  62. package/src/storage/__mocks__/LocalStorage.ts +20 -20
  63. package/src/util/UUIDGenerator.spec.ts +20 -20
  64. package/src/util/UuidGenerator.ts +20 -20
  65. package/src/util/__mocks__/UuidGenerator.ts +20 -20
  66. package/webpack.browser.js +20 -0
  67. package/webpack.common.js +20 -0
  68. package/webpack.config.js +20 -0
  69. package/webpack.dev.js +20 -0
  70. package/webpack.prod.js +20 -0
  71. package/.eslintrc.js +0 -4
  72. package/dist/util/urlPath.d.ts +0 -1
  73. package/dist/util/urlPath.js +0 -11
  74. package/dist/util/urlPath.js.map +0 -1
  75. package/src/util/urlPath.spec.ts +0 -55
  76. package/src/util/urlPath.ts +0 -41
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  /**
23
23
  * @hidden
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  jest,
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  /**
23
23
  * @hidden
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  IClient,
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  IOidcHandler,
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import { IOidcOptions } from "@inrupt/solid-client-authn-core";
23
23
  import { jest } from "@jest/globals";
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  IIssuerConfig,
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  IRedirector,
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import {
23
23
  IClient,
@@ -381,6 +381,28 @@ describe("AuthCodeRedirectHandler", () => {
381
381
  ).rejects.toThrow("Could not retrieve session");
382
382
  });
383
383
 
384
+ it("throws if the iss parameter does not match stored issuer", async () => {
385
+ const redirectUrl = new URL(DEFAULT_REDIRECT_URL);
386
+ redirectUrl.searchParams.append("state", DEFAULT_OAUTH_STATE);
387
+ redirectUrl.searchParams.append("code", DEFAULT_AUTHORIZATION_CODE);
388
+ redirectUrl.searchParams.append("iss", "someIssuer");
389
+
390
+ mockOidcClient();
391
+ mockFetch(
392
+ new Response("", {
393
+ status: 200,
394
+ })
395
+ );
396
+ const storageUtility = mockDefaultStorageUtility();
397
+ const authCodeRedirectHandler = getAuthCodeRedirectHandler({
398
+ storageUtility,
399
+ });
400
+
401
+ await expect(
402
+ authCodeRedirectHandler.handle(redirectUrl.href)
403
+ ).rejects.toThrow();
404
+ });
405
+
384
406
  it("returns an authenticated bearer fetch if requested", async () => {
385
407
  mockOidcClient();
386
408
  const mockedFetch = jest.mocked<typeof fetch>(window.fetch);
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  /**
23
23
  * @hidden
@@ -105,6 +105,14 @@ export class AuthCodeRedirectHandler implements IIncomingRedirectHandler {
105
105
  this.issuerConfigFetcher
106
106
  );
107
107
 
108
+ const iss = url.searchParams.get("iss");
109
+
110
+ if (typeof iss === "string" && iss !== issuerConfig.issuer) {
111
+ throw new Error(
112
+ `The value of the iss parameter (${iss}) does not match the issuer identifier of the authorization server (${issuerConfig.issuer}). See [rfc9207](https://www.rfc-editor.org/rfc/rfc9207.html#section-2.3-3.1.1)`
113
+ );
114
+ }
115
+
108
116
  if (codeVerifier === undefined) {
109
117
  throw new Error(
110
118
  `The code verifier for session ${storedSessionId} is missing from storage.`
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  import { jest, it, describe, expect } from "@jest/globals";
23
23
  import { EventEmitter } from "events";
@@ -1,23 +1,23 @@
1
- /*
2
- * Copyright 2022 Inrupt Inc.
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal in
6
- * the Software without restriction, including without limitation the rights to use,
7
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
- * Software, and to permit persons to whom the Software is furnished to do so,
9
- * subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
- */
1
+ //
2
+ // Copyright 2022 Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
21
 
22
22
  /**
23
23
  * @hidden