         }
     }
     
+    /// Check if Jitsi widget requires "openidtoken-jwt" authentication
+    func isOpenIdJWTAuthenticationRequired(for widgetData: JitsiWidgetData) -> Bool {
+        return widgetData.authenticationType == JitsiAuthenticationType.openIDTokenJWT.identifier
+    }
+    
+    /// Get Jitsi JWT token using user OpenID token
+    @discardableResult
+    func getOpenIdJWTToken(jitsiServerDomain: String,
+                           roomId: String,
+                           matrixSession: MXSession,
+                           success: @escaping (String) -> Void,
+                           failure: @escaping (Error) -> Void) -> MXHTTPOperation? {
+        
+        let myUser: MXUser = matrixSession.myUser
+        let userDisplayName: String = myUser.displayname ?? myUser.userId
+        let avatarStringURL: String = myUser.avatarUrl ?? ""
+        
+        return matrixSession.matrixRestClient.openIdToken({ (openIdToken) in
+            guard let openIdToken = openIdToken, let openIdAccessToken = openIdToken.accessToken else {
+                failure(JitsiServiceError.unknown)
+                return
+            }
+            
+            do {
+                let jwtToken = try self.jwtTokenBuilder.build(jitsiServerDomain: jitsiServerDomain,
+                openIdAccessToken: openIdAccessToken,
+                roomId: roomId,
+                userAvatarUrl: avatarStringURL,
+                userDisplayName: userDisplayName)
+                
+                success(jwtToken)
+            } catch {
+                failure(error)
+            }
+        }, failure: { error in
+            failure(error ?? JitsiServiceError.unknown)
+        })
+    }
+    
     // MARK: AppDelegate methods
     
     @discardableResult

        })
    }
    
    @discardableResult
    func createJitsiWidgetContent(jitsiServerURL: URL, roomID: String, isAudioOnly: Bool, success: @escaping ([AnyHashable: Any]) -> Void, failure: @escaping ((Error) -> Void)) -> MXHTTPOperation? {
        return self.getWellKnown(for: jitsiServerURL) { (result) in

    private var httpClient: MXHTTPClient?
    private let serializationService: SerializationServiceType = SerializationService()
    
    private lazy var jwtTokenBuilder: JitsiJWTTokenBuilder = {
        return JitsiJWTTokenBuilder()
    }()
    
    private var httpClients: [String: MXHTTPClient] = [:]
    
    // MARK: - Setup
