@inrupt/solid-client-authn-browser 2.2.2 → 2.2.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inrupt/solid-client-authn-browser",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "license": "MIT",
5
5
  "types": "dist/index.d.ts",
6
6
  "browser": "dist/index.js",
@@ -26,17 +26,17 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^20.14.2",
29
- "@types/uuid": "^9.0.8"
29
+ "@types/uuid": "^10.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@inrupt/oidc-client-ext": "^2.2.2",
33
- "@inrupt/solid-client-authn-core": "^2.2.2",
32
+ "@inrupt/oidc-client-ext": "^2.2.4",
33
+ "@inrupt/solid-client-authn-core": "^2.2.4",
34
34
  "events": "^3.3.0",
35
35
  "jose": "^5.1.3",
36
- "uuid": "^9.0.1"
36
+ "uuid": "^10.0.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "47822c4953af9805784a721a36ef1264aa1f204f"
41
+ "gitHead": "793acb2fc372fc299e64d5353200c714f31ab4e6"
42
42
  }
@@ -121,6 +121,7 @@ export default class ClientAuthentication extends ClientAuthenticationBase {
121
121
  webId: redirectInfo.webId,
122
122
  sessionId: redirectInfo.sessionId,
123
123
  expirationDate: redirectInfo.expirationDate,
124
+ clientAppId: redirectInfo.clientAppId,
124
125
  };
125
126
  } catch (err) {
126
127
  // Strip the oauth params:
package/src/Session.ts CHANGED
@@ -170,6 +170,7 @@ export class Session implements IHasSessionEventListener {
170
170
  sessionId: sessionOptions.sessionInfo.sessionId,
171
171
  isLoggedIn: false,
172
172
  webId: sessionOptions.sessionInfo.webId,
173
+ clientAppId: sessionOptions.sessionInfo.clientAppId,
173
174
  };
174
175
  } else {
175
176
  this.info = {
@@ -360,6 +361,7 @@ export class Session implements IHasSessionEventListener {
360
361
  this.info.isLoggedIn = sessionInfo.isLoggedIn;
361
362
  this.info.webId = sessionInfo.webId;
362
363
  this.info.sessionId = sessionInfo.sessionId;
364
+ this.info.clientAppId = sessionInfo.clientAppId;
363
365
  this.info.expirationDate = sessionInfo.expirationDate;
364
366
  this.events.on(EVENTS.SESSION_EXTENDED, (expiresIn: number) => {
365
367
  this.info.expirationDate = Date.now() + expiresIn * 1000;
@@ -112,6 +112,7 @@ const mockTokenEndpointBearerResponse =
112
112
  accessToken: mockAccessTokenBearer(),
113
113
  idToken: mockIdToken(),
114
114
  webId: mockWebId(),
115
+ clientId: "some client",
115
116
  expiresIn: MOCK_EXPIRE_TIME,
116
117
  refreshToken: "some refresh token",
117
118
  };
@@ -123,6 +124,7 @@ const mockTokenEndpointDpopResponse =
123
124
  accessToken: JSON.stringify(mockAccessTokenDpop()),
124
125
  idToken: mockIdToken(),
125
126
  webId: mockWebId(),
127
+ clientId: "some client",
126
128
  dpopKey: {
127
129
  privateKey: (await importJWK(mockJwk())) as KeyObject,
128
130
  // Note that here for convenience the private key is also used as public key.
@@ -531,6 +533,7 @@ describe("AuthCodeRedirectHandler", () => {
531
533
  accessToken: mockAccessTokenBearer(),
532
534
  idToken: mockIdToken(),
533
535
  webId: mockWebId(),
536
+ clientId: "some client",
534
537
  // no expiresIn
535
538
  });
536
539
 
@@ -38,6 +38,7 @@ import {
38
38
  buildAuthenticatedFetch,
39
39
  loadOidcContextFromStorage,
40
40
  maybeBuildRpInitiatedLogout,
41
+ saveSessionInfoToStorage,
41
42
  } from "@inrupt/solid-client-authn-core";
42
43
  import { getTokens } from "@inrupt/oidc-client-ext";
43
44
  import type { EventEmitter } from "events";
@@ -166,13 +167,14 @@ export class AuthCodeRedirectHandler implements IIncomingRedirectHandler {
166
167
  expiresIn: tokens.expiresIn,
167
168
  });
168
169
 
169
- await this.storageUtility.setForUser(
170
+ await saveSessionInfoToStorage(
171
+ this.storageUtility,
170
172
  storedSessionId,
171
- {
172
- webId: tokens.webId,
173
- isLoggedIn: "true",
174
- },
175
- { secure: true },
173
+ tokens.webId,
174
+ tokens.clientId,
175
+ "true",
176
+ undefined,
177
+ true,
176
178
  );
177
179
 
178
180
  const sessionInfo = await this.sessionInfoManager.get(storedSessionId);