Description
I’m trying to integrate the iOS Meeting SDK, but I can’t authenticate the SDK with a JWT token.
The tokens are generated from our backend (as recommended) and I confirm they are valid.
They did work with MobileRTCSample
and also my integration of Android Meeting SDK.
When I pass a valid JWT token and call authService.sdkAuth()
, onMobileRTCAuthReturn
from the delegate never gets called.
The weird thing is when I pass a expired JWT token, onMobileRTCAuthReturn
is actually called and give this error MobileRTCAuthError_TokenWrong
which is correct.
I don’t understand what I am missing here, I don’t see any major difference between the sample project and mine.
Thanks in advance for your help!
Which iOS Meeting SDK version?
5.15.12
To Reproduce(If applicable)
Steps to reproduce the behavior:
- Call
authService.sdkAuth()
with a valid JWT token onMobileRTCAuthReturn
don’t get called
Code
class ZoomSDK: NSObject {
private let instance = MobileRTC.shared()
private var continuation: CheckedContinuation<MobileRTCAuthError, Never>?
func authenticate(domain: String, jwtToken: String) async -> Bool {
let context = MobileRTCSDKInitContext()
context.domain = "zoom.us"
context.enableLog = true
context.locale = .default
guard instance.initialize(context) else {
Log.shared.e(message: "Could not initialize MobileRTC")
return false
}
guard let authService = instance.getAuthService() else { return false }
authService.delegate = self
authService.jwtToken = jwtToken
let value: MobileRTCAuthError = await withCheckedContinuation { continuation in
self.continuation = continuation
authService.sdkAuth()
}
return value == MobileRTCAuthError.success
}
}
extension ZoomSDK: MobileRTCAuthDelegate {
func onMobileRTCAuthReturn(_ returnValue: MobileRTCAuthError) {
print("onMobileRTCAuthReturn() - return: \(returnValue)")
self.continuation?.resume(returning: returnValue)
}
}