Getting issue when I initalize the zoom sdk. Zoom auth result code: 11. ZOOM token wrong

I am working on zoom sdk in iOS and android. we have existing application it worked fine till 2days back suddenly user unable to join meeting. we checked and identified the root cause.

Error?
when I initializing the sdk with jwt token it giving
**
Zoom auth result code: 11 and it returning token wrong. so we are unable to get meeting settings and meeting service from Mobile rtc.

we havent touched anything in code. below is the code to generate jwt token.

func generateSignature(appKey: String, appSecret: String) -> String? {

    let now = Int(Date().timeIntervalSince1970)
    let iat = now - 30
    let exp = now + (2 * 60 * 60) // 2 hours

    let header: [String: Any] = [
        "alg": "HS256",
        "typ": "JWT"
    ]

    let payload: [String: Any] = [
        "appKey": appKey,
        "iat": iat,
        "exp": exp,
        "tokenExp": exp
    ]

    func base64URLEncode(_ data: Data) -> String {
        data.base64EncodedString()
            .replacingOccurrences(of: "+", with: "-")
            .replacingOccurrences(of: "/", with: "_")
            .replacingOccurrences(of: "=", with: "")
    }

    guard
        let headerData = try? JSONSerialization.data(withJSONObject: header),
        let payloadData = try? JSONSerialization.data(withJSONObject: payload)
    else {
        return nil
    }

    let headerEncoded = base64URLEncode(headerData)
    let payloadEncoded = base64URLEncode(payloadData)
    let signingInput = "\(headerEncoded).\(payloadEncoded)"

    let key = SymmetricKey(data: Data(appSecret.utf8))
    let signature = HMAC<SHA256>.authenticationCode(
        for: Data(signingInput.utf8),
        using: key
    )

    let signatureEncoded = base64URLEncode(Data(signature))
    let jwt = "\(signingInput).\(signatureEncoded)"

    print("Generated Meeting SDK JWT:", jwt)
    return jwt
}
   let remoteConfig = RemoteConfig.remoteConfig()
        let zoomKeys = remoteConfig[LatestUpdateChecker.ZOOM_KEYS].jsonValue
        if let zoomMeetKeys = zoomKeys as? [String: Any]{
            if let domain = zoomMeetKeys[LatestUpdateChecker.ZOOM_DOMAIN] as? String, let appSecret =
                zoomMeetKeys[LatestUpdateChecker.ZOOM_APP_SECRET] as? String, let appKey = zoomMeetKeys[LatestUpdateChecker.ZOOM_APP_KEY] as? String{
                if let jwtToken = self.generateSignature(key: appKey, secret: appSecret){
                    appDelegate?.setupSDK(jwtToken, domain: domain)
                }
            }
        }

The below code is to set up sdk using jwt.

 func setupSDK(_ jwt: String?,  domain: String) {
        let context = MobileRTCSDKInitContext()
        context.domain = domain
        context.enableLog = true
        let sdkInitSuc = MobileRTC.shared().initialize(context)
        print("Zoom init result:", sdkInitSuc)
        
        if sdkInitSuc {
            let authService = MobileRTC.shared().getAuthService()
            print(MobileRTC.shared().mobileRTCVersion)
            if let authService = authService {
                authService.jwtToken = jwt
                authService.delegate = self
                authService.sdkAuth()
            }}
    }

We have checked in zoom market place and verified the key and secret. we are getting same from fire base also.

My main question is why it suddently stopped working. how can we quickly fix this. is there any configuration issue as it araised in both andorid and iOS at the same time.

@chunsiong.zoom Can you please help us to fix this issue asap. Thanks

@Vamc can you share a sample of your token, and what is the SDK version you are currently on?

This issue has been resolved. Accidentally deleted the user who have the ownership. We created a new app and passed new key and secret. sdk authenticated with new credentials

2 Likes

@chunsiong.zoom
We are facing a similar issue.
We already have an application using the Meeting SDK for Linux that has been released to production.
The JWT used in Production is authenticated successfully, but the JWT used in Development fails to authenticate.
The error we are seeing is Zoom auth result code: 11 (token wrong).

Similar to @Vamc ’s reply, we believe that the user who originally generated the Development JWT may have been deleted.
The application is currently assigned to a different user as the owner.

Could you please help us investigate this issue?
Also, would this issue be resolved by regenerating the Client Secret either by the owner or by another collaborator?

@mutsuo.masui I’ll PM you for follow up on account details

@chunsiong.zoom
Thanks for the update.

Just to confirm here as well: I’ve received your PM and will follow up there with the requested account details.