Skip to content

Commit

Permalink
feat(jwt) expose JWT identity claims through
Browse files Browse the repository at this point in the history
  • Loading branch information
PsychoLlama authored Oct 7, 2023
1 parent 3d55666 commit cb416cf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions JitsiParticipant.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ export default class JitsiParticipant {
return this._id;
}

/**
* Returns the XMPP identity. This is defined by your application in the
* JWT `context` claims section.
*
* @returns {object|undefined} - XMPP user identity.
*/
getIdentity() {
return this._identity;
}

/**
* @returns {String} The JID of this participant.
*/
Expand Down
21 changes: 21 additions & 0 deletions types/hand-crafted/JitsiParticipant.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class JitsiParticipant {
getDisplayName: () => string;
getFeatures: () => Promise<Set<string> | Error>;
getId: () => string;
getIdentity: () => undefined | JwtIdentity;
getJid: () => string;
getProperty: ( name: string ) => string;
getRole: () => string;
Expand All @@ -32,3 +33,23 @@ export default class JitsiParticipant {
setRole: ( role: string ) => void;
supportsDTMF: () => boolean;
}

/**
* Application-defined values carried in the JWT claims section.
*
* @see https:/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md#token-identifiers-structure-optional
*/
interface JwtIdentity {
group: string;
user: {
id: string;
email: string;
name: string;
avatar: string;
};
callee?: {
id: string;
name: string;
avatar: string;
};
}

0 comments on commit cb416cf

Please sign in to comment.