initial attmept to use the matrix 2.0 json schema towards the jwt service

This commit is contained in:
fkwp
2025-12-04 11:10:08 +01:00
parent f05d4b158e
commit 375bedde5a

View File

@@ -19,7 +19,7 @@ export interface SFUConfig {
// The bits we need from MatrixClient // The bits we need from MatrixClient
export type OpenIDClientParts = Pick< export type OpenIDClientParts = Pick<
MatrixClient, MatrixClient,
"getOpenIdToken" | "getDeviceId" "getOpenIdToken" | "getDeviceId" | "baseUrl" | "getUserId"
>; >;
/** /**
* Gets a bearer token from the homeserver and then use it to authenticate * Gets a bearer token from the homeserver and then use it to authenticate
@@ -73,9 +73,17 @@ async function getLiveKitJWT(
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
body: JSON.stringify({ body: JSON.stringify({
room: roomName, room_id: roomName,
slot_id: "m.call#ROOM",
openid_token: openIDToken, openid_token: openIDToken,
device_id: client.getDeviceId(), member: {
id: (client.getUserId() ?? "") + client.getDeviceId(),
claimed_user_id: client.getUserId(),
claimed_device_id: client.getDeviceId(),
},
delay_id: "12345",
delay_timeout: 10000,
delay_cs_api_url: client.baseUrl
}), }),
}); });
if (!res.ok) { if (!res.ok) {