@inrupt/solid-client-authn-browser 3.1.1 → 4.0.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 (115) hide show
  1. package/README.md +9 -13
  2. package/dist/ClientAuthentication.d.ts.map +1 -0
  3. package/dist/Session.d.ts.map +1 -0
  4. package/dist/constant.d.ts.map +1 -0
  5. package/dist/defaultSession.d.ts.map +1 -0
  6. package/dist/dependencies.d.ts.map +1 -0
  7. package/dist/index.browser.d.ts.map +1 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +28 -38
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +28 -38
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/login/oidc/AggregateOidcHandler.d.ts.map +1 -0
  14. package/dist/login/oidc/AggregateRedirectHandler.d.ts.map +1 -0
  15. package/dist/login/oidc/ClientRegistrar.d.ts.map +1 -0
  16. package/dist/login/oidc/IssuerConfigFetcher.d.ts.map +1 -0
  17. package/dist/login/oidc/OidcLoginHandler.d.ts.map +1 -0
  18. package/dist/login/oidc/Redirector.d.ts.map +1 -0
  19. package/dist/login/oidc/__mocks__/IOidcOptions.d.ts.map +1 -0
  20. package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts.map +1 -0
  21. package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.d.ts.map +1 -0
  22. package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.d.ts.map +1 -0
  23. package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts.map +1 -0
  24. package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.d.ts.map +1 -0
  25. package/dist/login/oidc/refresh/TokenRefresher.d.ts.map +1 -0
  26. package/dist/logout/buildRpInitiatedLogout.d.ts.map +1 -0
  27. package/dist/sessionInfo/SessionInfoManager.d.ts.map +1 -0
  28. package/dist/solid-client-authn.bundle.js +1 -31
  29. package/dist/solid-client-authn.bundle.js.map +1 -1
  30. package/dist/src/ClientAuthentication.d.ts +16 -0
  31. package/dist/src/Session.d.ts +146 -0
  32. package/dist/src/constant.d.ts +2 -0
  33. package/dist/src/defaultSession.d.ts +52 -0
  34. package/dist/src/dependencies.d.ts +17 -0
  35. package/dist/src/index.browser.d.ts +2 -0
  36. package/dist/src/index.d.ts +3 -0
  37. package/dist/src/login/oidc/AggregateOidcHandler.d.ts +15 -0
  38. package/dist/src/login/oidc/AggregateRedirectHandler.d.ts +15 -0
  39. package/dist/src/login/oidc/ClientRegistrar.d.ts +13 -0
  40. package/dist/src/login/oidc/IssuerConfigFetcher.d.ts +18 -0
  41. package/dist/src/login/oidc/OidcLoginHandler.d.ts +20 -0
  42. package/dist/src/login/oidc/Redirector.d.ts +11 -0
  43. package/dist/src/login/oidc/__mocks__/IOidcOptions.d.ts +2 -0
  44. package/dist/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts +19 -0
  45. package/dist/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.d.ts +18 -0
  46. package/dist/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.d.ts +17 -0
  47. package/dist/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts +17 -0
  48. package/dist/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.d.ts +9 -0
  49. package/dist/src/login/oidc/refresh/TokenRefresher.d.ts +16 -0
  50. package/dist/src/logout/buildRpInitiatedLogout.d.ts +9 -0
  51. package/dist/src/sessionInfo/SessionInfoManager.d.ts +26 -0
  52. package/dist/src/storage/BrowserStorage.d.ts +14 -0
  53. package/dist/src/storage/StorageUtility.d.ts +19 -0
  54. package/dist/src/util/UuidGenerator.d.ts +12 -0
  55. package/dist/storage/BrowserStorage.d.ts.map +1 -0
  56. package/dist/storage/StorageUtility.d.ts.map +1 -0
  57. package/dist/util/UuidGenerator.d.ts.map +1 -0
  58. package/package.json +4 -4
  59. package/rollup.config.mjs +0 -2
  60. package/src/ClientAuthentication.spec.ts +128 -2
  61. package/src/ClientAuthentication.ts +18 -4
  62. package/src/Session.spec.ts +69 -18
  63. package/src/Session.ts +0 -1
  64. package/src/__mocks__/ClientAuthentication.ts +1 -1
  65. package/src/constant.ts +0 -1
  66. package/src/defaultSession.spec.ts +0 -1
  67. package/src/defaultSession.ts +1 -2
  68. package/src/dependencies.node.spec.ts +0 -1
  69. package/src/dependencies.spec.ts +0 -1
  70. package/src/dependencies.ts +0 -1
  71. package/src/index.browser.spec.ts +0 -1
  72. package/src/index.browser.ts +0 -1
  73. package/src/index.spec.ts +0 -1
  74. package/src/index.ts +0 -1
  75. package/src/login/__mocks__/LoginHandler.ts +0 -1
  76. package/src/login/oidc/AggregateOidcHandler.spec.ts +1 -2
  77. package/src/login/oidc/AggregateOidcHandler.ts +0 -1
  78. package/src/login/oidc/AggregateRedirectHandler.ts +0 -1
  79. package/src/login/oidc/ClientRegistrar.spec.ts +1 -1
  80. package/src/login/oidc/ClientRegistrar.ts +0 -1
  81. package/src/login/oidc/IssuerConfigFetcher.spec.ts +7 -5
  82. package/src/login/oidc/IssuerConfigFetcher.ts +3 -3
  83. package/src/login/oidc/OidcLoginHandler.spec.ts +1 -1
  84. package/src/login/oidc/OidcLoginHandler.ts +0 -1
  85. package/src/login/oidc/Redirector.spec.ts +0 -1
  86. package/src/login/oidc/Redirector.ts +0 -1
  87. package/src/login/oidc/__mocks__/ClientRegistrar.ts +0 -1
  88. package/src/login/oidc/__mocks__/IOidcHandler.ts +1 -3
  89. package/src/login/oidc/__mocks__/IOidcOptions.ts +0 -1
  90. package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +0 -2
  91. package/src/login/oidc/__mocks__/Redirector.ts +0 -1
  92. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +1 -1
  93. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +0 -1
  94. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +0 -1
  95. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +0 -2
  96. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +0 -1
  97. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +1 -2
  98. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +1 -4
  99. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +10 -11
  100. package/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts +0 -1
  101. package/src/login/oidc/refresh/TokenRefresher.spec.ts +1 -1
  102. package/src/login/oidc/refresh/TokenRefresher.ts +0 -2
  103. package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +0 -2
  104. package/src/logout/buildRpInitiatedLogout.ts +1 -1
  105. package/src/sessionInfo/SessionInfoManager.spec.ts +62 -1
  106. package/src/sessionInfo/SessionInfoManager.ts +6 -1
  107. package/src/sessionInfo/__mocks__/SessionInfoManager.ts +1 -2
  108. package/src/storage/BrowserStorage.spec.ts +0 -1
  109. package/src/storage/BrowserStorage.ts +0 -1
  110. package/src/storage/StorageUtility.ts +0 -1
  111. package/src/storage/__mocks__/LocalStorage.ts +0 -1
  112. package/src/util/UUIDGenerator.spec.ts +0 -1
  113. package/src/util/UuidGenerator.ts +0 -2
  114. package/src/util/__mocks__/UuidGenerator.ts +0 -1
  115. package/typedoc.config.mjs +0 -1
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +31,8 @@ export const OidcHandlerHandleResponse: ISessionInfo =
32
31
  SessionCreatorGetSessionResponse;
33
32
 
34
33
  export const OidcHandlerMock: jest.Mocked<IOidcHandler> = {
35
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
36
34
  canHandle: jest.fn((_options: IOidcOptions) => Promise.resolve(true)),
37
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
+
38
36
  handle: jest.fn(async (_options: IOidcOptions) => Promise.resolve(undefined)),
39
37
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
38
  } as any;
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -38,7 +37,6 @@ export const IssuerConfigFetcherFetchConfigResponse: IIssuerConfig = {
38
37
  };
39
38
 
40
39
  export const IssuerConfigFetcherMock: jest.Mocked<IIssuerConfigFetcher> = {
41
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
40
  fetchConfig: jest.fn((_issuer: string) =>
43
41
  Promise.resolve(IssuerConfigFetcherFetchConfigResponse),
44
42
  ),
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,6 +30,7 @@ import { USER_SESSION_PREFIX } from "@inrupt/solid-client-authn-core";
31
30
  import {
32
31
  StorageUtilityMock,
33
32
  mockStorageUtility,
33
+ // eslint-disable-next-line import/no-unresolved
34
34
  } from "@inrupt/solid-client-authn-core/mocks";
35
35
  import { jest, it, describe, expect } from "@jest/globals";
36
36
  import type * as OidcClientExt from "@inrupt/oidc-client-ext";
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -42,7 +41,6 @@ import { getUnauthenticatedSession } from "../../../sessionInfo/SessionInfoManag
42
41
  export class ErrorOidcHandler implements IIncomingRedirectHandler {
43
42
  async canHandle(redirectUrl: string): Promise<boolean> {
44
43
  try {
45
- // eslint-disable-next-line no-new
46
44
  return new URL(redirectUrl).searchParams.has("error");
47
45
  } catch (e) {
48
46
  throw new Error(
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -41,7 +40,7 @@ export class FallbackRedirectHandler implements IIncomingRedirectHandler {
41
40
  async canHandle(redirectUrl: string): Promise<boolean> {
42
41
  try {
43
42
  // The next URL object is built for validating it.
44
- // eslint-disable-next-line no-new
43
+
45
44
  new URL(redirectUrl);
46
45
  return true;
47
46
  } catch (e) {
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,6 +32,7 @@ import { StorageUtility } from "@inrupt/solid-client-authn-core";
33
32
  import {
34
33
  StorageUtilityMock,
35
34
  mockStorage,
35
+ // eslint-disable-next-line import/no-unresolved
36
36
  } from "@inrupt/solid-client-authn-core/mocks";
37
37
 
38
38
  import AuthorizationCodeWithPkceOidcHandler from "./AuthorizationCodeWithPkceOidcHandler";
@@ -53,7 +53,6 @@ const mockOidcModule = (
53
53
  url: string = expectedSigninRedirectUrl,
54
54
  state = "test state",
55
55
  ) => {
56
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
56
  const oidcModule = jest.requireMock("@inrupt/oidc-client-ext") as any;
58
57
  oidcModule.OidcClient.mockReturnValue({
59
58
  createSigninRequest: jest
@@ -91,7 +90,6 @@ describe("AuthorizationCodeWithPkceOidcHandler", () => {
91
90
  getAuthorizationCodeWithPkceOidcHandler();
92
91
  canHandleTests.authorizationCodeWithPkceOidcHandler.forEach(
93
92
  (testConfig) => {
94
- // eslint-disable-next-line jest/valid-title
95
93
  it(testConfig.message, async () => {
96
94
  const value = await authorizationCodeWithPkceOidcHandler.canHandle(
97
95
  testConfig.oidcOptions,
@@ -138,7 +136,6 @@ describe("AuthorizationCodeWithPkceOidcHandler", () => {
138
136
  // pretty nasty due to an Error instance being logged without being
139
137
  // converted to a string:
140
138
 
141
- // eslint-disable-next-line no-console
142
139
  expect(console.error).toHaveBeenCalledTimes(1);
143
140
  expect(
144
141
  (console as jest.Mocked<Console>).error.mock.calls[0][0].toString(),
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -35,6 +34,9 @@ import type {
35
34
  import { AuthorizationCodeWithPkceOidcHandlerBase } from "@inrupt/solid-client-authn-core";
36
35
  import { OidcClient } from "@inrupt/oidc-client-ext";
37
36
 
37
+ // Camelcase identifiers are required in the OIDC specification.
38
+ /* eslint-disable camelcase*/
39
+
38
40
  /**
39
41
  * @hidden
40
42
  * Authorization code flow spec: https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth
@@ -45,12 +47,12 @@ export default class AuthorizationCodeWithPkceOidcHandler
45
47
  implements IOidcHandler
46
48
  {
47
49
  async handle(oidcLoginOptions: IOidcOptions): Promise<LoginResult> {
48
- /* eslint-disable camelcase */
50
+ const redirectUri = oidcLoginOptions.redirectUrl ?? "";
49
51
  const oidcOptions = {
50
52
  authority: oidcLoginOptions.issuer.toString(),
51
53
  client_id: oidcLoginOptions.client.clientId,
52
54
  client_secret: oidcLoginOptions.client.clientSecret,
53
- redirect_uri: oidcLoginOptions.redirectUrl,
55
+ redirect_uri: redirectUri,
54
56
  response_type: "code",
55
57
  scope: oidcLoginOptions.scopes.join(" "),
56
58
  filterProtocolClaims: true,
@@ -58,26 +60,23 @@ export default class AuthorizationCodeWithPkceOidcHandler
58
60
  // Note that in Solid, information should be retrieved from the
59
61
  // profile referenced by the WebId.
60
62
  loadUserInfo: false,
61
- code_verifier: true,
62
63
  prompt: oidcLoginOptions.prompt ?? "consent",
63
64
  };
64
- /* eslint-enable camelcase */
65
65
 
66
66
  const oidcClientLibrary = new OidcClient(oidcOptions);
67
67
 
68
68
  try {
69
- const signingRequest = await oidcClientLibrary.createSigninRequest();
69
+ const signingRequest = await oidcClientLibrary.createSigninRequest({});
70
70
  // Make sure to await the promise before returning so that the error is caught.
71
71
  return await this.setupRedirectHandler({
72
72
  oidcLoginOptions,
73
- // eslint-disable-next-line no-underscore-dangle
74
- state: signingRequest.state._id,
75
- // eslint-disable-next-line no-underscore-dangle
76
- codeVerifier: signingRequest.state._code_verifier,
73
+
74
+ state: signingRequest.state.id,
75
+
76
+ codeVerifier: signingRequest.state.code_verifier ?? "",
77
77
  targetUrl: signingRequest.url.toString(),
78
78
  });
79
79
  } catch (err: unknown) {
80
- // eslint-disable-next-line no-console
81
80
  console.error(err);
82
81
  }
83
82
 
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,6 +27,7 @@ import { EVENTS } from "@inrupt/solid-client-authn-core";
28
27
  import {
29
28
  StorageUtilityMock,
30
29
  mockStorageUtility,
30
+ // eslint-disable-next-line import/no-unresolved
31
31
  } from "@inrupt/solid-client-authn-core/mocks";
32
32
  import type { JWK } from "jose";
33
33
  import { importJWK } from "jose";
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -42,7 +41,6 @@ import type { EventEmitter } from "events";
42
41
 
43
42
  // Some identifiers are not in camelcase on purpose, as they are named using the
44
43
  // official names from the OIDC/OAuth2 specifications.
45
- /* eslint-disable camelcase */
46
44
 
47
45
  /**
48
46
  * @hidden
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -26,7 +25,6 @@ import type {
26
25
  } from "@inrupt/solid-client-authn-core";
27
26
 
28
27
  // Some identifiers are in camelcase on purpose.
29
- /* eslint-disable camelcase */
30
28
 
31
29
  export const mockTokenRefresher = (
32
30
  tokenSet: TokenEndpointResponse,
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -18,6 +17,7 @@
18
17
  // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
18
  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
19
  //
20
+
21
21
  import type {
22
22
  IEndSessionOptions,
23
23
  IRpLogoutOptions,
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,6 +23,7 @@ import {
24
23
  StorageUtility,
25
24
  mockStorage,
26
25
  } from "@inrupt/solid-client-authn-core";
26
+ // eslint-disable-next-line import/no-unresolved
27
27
  import { mockLogoutHandler } from "@inrupt/solid-client-authn-core/mocks";
28
28
  import { jest, it, describe, expect } from "@jest/globals";
29
29
 
@@ -130,6 +130,7 @@ describe("SessionInfoManager", () => {
130
130
  refreshToken: "some refresh token",
131
131
  redirectUrl: "https://some.redirect/url",
132
132
  tokenType: "DPoP",
133
+ clientExpiresAt: undefined,
133
134
  });
134
135
  });
135
136
 
@@ -158,6 +159,7 @@ describe("SessionInfoManager", () => {
158
159
  refreshToken: undefined,
159
160
  redirectUrl: undefined,
160
161
  tokenType: "DPoP",
162
+ clientExpiresAt: undefined,
161
163
  });
162
164
  });
163
165
 
@@ -219,6 +221,65 @@ describe("SessionInfoManager", () => {
219
221
  );
220
222
  });
221
223
 
224
+ it("returns clientExpiresAt when expiresAt is in storage", async () => {
225
+ const sessionId = "commanderCool";
226
+ const expiresAt = 1700000000;
227
+
228
+ const storageMock = new StorageUtility(
229
+ mockStorage({
230
+ [`solidClientAuthenticationUser:${sessionId}`]: {
231
+ isLoggedIn: "true",
232
+ },
233
+ }),
234
+ mockStorage({
235
+ [`solidClientAuthenticationUser:${sessionId}`]: {
236
+ clientId: "https://some.app/registration",
237
+ clientSecret: "some client secret",
238
+ issuer: "https://some.issuer",
239
+ expiresAt: String(expiresAt),
240
+ },
241
+ }),
242
+ );
243
+
244
+ const sessionManager = getSessionInfoManager({
245
+ storageUtility: storageMock,
246
+ });
247
+ const session = await sessionManager.get(sessionId);
248
+ expect(session).toStrictEqual(
249
+ expect.objectContaining({
250
+ clientExpiresAt: expiresAt,
251
+ }),
252
+ );
253
+ });
254
+
255
+ it("returns undefined clientExpiresAt when expiresAt is not in storage", async () => {
256
+ const sessionId = "commanderCool";
257
+
258
+ const storageMock = new StorageUtility(
259
+ mockStorage({
260
+ [`solidClientAuthenticationUser:${sessionId}`]: {
261
+ isLoggedIn: "true",
262
+ },
263
+ }),
264
+ mockStorage({
265
+ [`solidClientAuthenticationUser:${sessionId}`]: {
266
+ clientId: "https://some.app/registration",
267
+ issuer: "https://some.issuer",
268
+ },
269
+ }),
270
+ );
271
+
272
+ const sessionManager = getSessionInfoManager({
273
+ storageUtility: storageMock,
274
+ });
275
+ const session = await sessionManager.get(sessionId);
276
+ expect(session).toStrictEqual(
277
+ expect.objectContaining({
278
+ clientExpiresAt: undefined,
279
+ }),
280
+ );
281
+ });
282
+
222
283
  it("throws if the stored token type isn't supported", async () => {
223
284
  const sessionId = "commanderCool";
224
285
 
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -72,6 +71,7 @@ export class SessionInfoManager
72
71
  refreshToken,
73
72
  issuer,
74
73
  tokenType,
74
+ expiresAt,
75
75
  ] = await Promise.all([
76
76
  this.storageUtility.getForUser(sessionId, "isLoggedIn", {
77
77
  secure: true,
@@ -97,6 +97,9 @@ export class SessionInfoManager
97
97
  this.storageUtility.getForUser(sessionId, "tokenType", {
98
98
  secure: false,
99
99
  }),
100
+ this.storageUtility.getForUser(sessionId, "expiresAt", {
101
+ secure: false,
102
+ }),
100
103
  ]);
101
104
 
102
105
  if (typeof redirectUrl === "string" && !isValidRedirectUrl(redirectUrl)) {
@@ -134,6 +137,8 @@ export class SessionInfoManager
134
137
  clientAppSecret: clientSecret,
135
138
  // Default the token type to DPoP if unspecified.
136
139
  tokenType: tokenType ?? "DPoP",
140
+ clientExpiresAt:
141
+ expiresAt !== undefined ? Number.parseInt(expiresAt, 10) : undefined,
137
142
  };
138
143
  }
139
144
 
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -46,7 +45,7 @@ export const SessionInfoManagerMock: jest.Mocked<ISessionInfoManager> = {
46
45
  Promise.resolve(SessionCreatorCreateResponse),
47
46
  ),
48
47
  getAll: jest.fn(async () => Promise.resolve([SessionCreatorCreateResponse])),
49
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
+
50
49
  clear: jest.fn(async (_sessionId: string) => Promise.resolve()),
51
50
  register: jest.fn(async (_sessionId: string) => Promise.resolve()),
52
51
  clearAll: jest.fn(async () => Promise.resolve()),
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -40,7 +39,6 @@ export interface IUuidGenerator {
40
39
  * @hidden
41
40
  */
42
41
  export default class UuidGenerator {
43
- // eslint-disable-next-line class-methods-use-this
44
42
  v4(): string {
45
43
  return v4();
46
44
  }
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright Inrupt Inc.
3
2
  //
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy