ZoomSDKAuthDelegate callbacks for login()

Hey @jon.zoom
As you can see in the screenshot, I provided full disk access to my mac app and also to the Xcode.
Screenshot 2020-12-19 at 20.45.34

I checked the sample app code and it doesn’t have the enableLog = true, so I am assuming it is not updated with the latest functions.

What else I can look for? Also, is it possible for zoom SDK to write logs in same console as my mac app?

@jon.zoom Can you show us how is the log we’re looking for supposed to look like?

Also I’ve build a mini app that just logs in into zoom and enables logs. This app also generates no log. Tried with different versions of the SDK. How can I shared it with you so you can tell me what am I missing?

Hi @j_a_z_z and @tmiskiew,

In addition to enabling logging, it is important to note that the logFileSize must be set. This was being done in the snippet provided earlier, but I just wanted to make sure that part was clear.

Since this appears to be something specific to your project and/or dev environment, it will be difficult for me to be of any assistance in tracking down the cause since it does not appear to be an issue with SDK usage. If you are able to figure this out and provide logs or can narrow it down to an issue with the SDK itself, I will be happy to help.

Thanks!

Hey @jon.zoom
Can you please provide a sample project which generates log.
Current sample project has no code for log generation.

@jon.zoom I created a sample project. This is the entire code. No logs are being created. Please point out the place where we incorrectly enable the logs:

//
//  AppDelegate.swift
//  ZoomSDKLoginTest
//
//  Created by Thomas Miskiewicz on 10/15/20.
//  Copyright © 2020 Thomas Miskiewicz. All rights reserved.
//

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

    @IBOutlet weak var window: NSWindow!


    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application
    }
    @IBAction func onClickLogin(_ sender: Any) {
        self.login()
    }
    
    func login() -> Void {
        print("Login into account....")
        let res = ZoomSDK.shared()?.getAuthService()?.login("youremail@here.com", password: "password_please", rememberMe: false)
        //        let res = ZoomSDK.shared()?.getAuthService()?.login(userName , password: passord, rememberMe: false)
        print("Login Res:\(String(describing: res))")
        if res == ZoomSDKError_Success {
            print("Login was success")
        }
    }
    
    
    @IBAction func onClickAuth(_ sender: Any) {
        let sdk: ZoomSDK = ZoomSDK.shared()
        sdk.zoomDomain = "zoom.us"
        //sdk.initSDK(false)
        let params = ZoomSDKInitParams()
        params.needCustomizedUI = false
        params.enableLog = true
        params.logFileSize = 50
        sdk.initSDK(with: params)
        let authService = sdk.getAuthService()
        authService!.delegate = self
        let authContext = ZoomSDKAuthContext()
        authContext.jwtToken = "eyJhbGciOiJIUzI1NiJ9.eyJhcHBLZXkiOiJrYWF4UGplc1A3NURBRGU2TVg2a0NqdmNscVZnN2tlRERSUHIiLCJpYXQiOjE2MDg1Nzc3MzEsImV4cCI6MTYwODc1MDUzMSwidG9rZW5FeHAiOjE2MDg3NTA1MzF9.zmj_YDwGTbX9wq9idbekw6vjUXp0lX9rDjrEbAri5Yg"
        let response = authService?.sdkAuth(authContext)
        if response == ZoomSDKError_Success{
            DispatchQueue.main.async {
                let alert: NSAlert = NSAlert()
                alert.messageText = "It works!"
                alert.informativeText = "Successfully authorized the app"
                alert.alertStyle = NSAlert.Style.informational
                alert.addButton(withTitle: "OK")
                _ = alert.runModal()
            }
        }
        
    }
    
    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }


}

extension AppDelegate : ZoomSDKAuthDelegate {
    func onZoomSDKAuthReturn(_ returnValue: ZoomSDKAuthError) {
        if returnValue != ZoomSDKAuthError_Success{
            let message = NSLocalizedString("SDK auth failed, Error: \(returnValue)", comment: "")
            print(message)
        }
        else{
            print("onZoomSDKAuthReturn: Success")
        }
    }
    
    func onZoomAuthIdentityExpired() {
        print("onZoomAuthIdentityExpired triggered by Zoom")
    }
    
    func onZoomIdentityExpired() {
        print("onZoomIdentityExpired triggered by Zoom")
    }
    
    func onZoomSDKLogin(_ loginStatus: ZoomSDKLoginStatus, failReason reason: String?) {
        print("onZoomSDKLogin triggered by Zoom. Login status:\(loginStatus), reason:\(String(describing: reason))")
        
        if (loginStatus.rawValue == 1) {
            let accountInfo = ZoomSDK.shared()?.getAuthService()?.getAccountInfo()
            print("Display name: \(String(describing: accountInfo?.getDisplayName()))")
        }
        
    }
    
    func onZoomSDKLogout() {
        print("onZoomSDKLogout triggered by Zoom")
    }
}

Hi @tmiskiew and @j_a_z_z,

I’m a little stumped on why we’re seeing such different results. If you are enabling logging through the method you have posted in this thread, it should be working.

Would it be possible for you to send your project to us at developersupport@zoom.us so that we can investigate further?

Thanks!

@jon.zoom Did you receive my email?

Hi @tmiskiew,

Thanks for sending that over, I can confirm we have received your project and will let you know once we have identified a solution.

Thanks!

Hi @tmiskiew,

We have had a few people try running your project, and were all able to retrieve the logs from the directory mentioned earlier in this topic.

Since we cannot identify any issues within the project itself which would prevent logs from being saved, this must be an issue with your environment.

Thanks!

Where exactly did you find these logs? Since the test app is sandboxed, we were able to find the log in Containers for sandboxed apps.
~/Library/Containers//Data/Library/Logs/ rather than in the location you mentioned previously. Can you share the location and content of your folder? Here’s what I got

Is this what we’re looking for?

Hi @tmiskiew,

Yes, that does appear to be the correct files! Can you please send those over when you have a chance so that we can investigate the behavior you are seeing?

Thanks!

Here are the logs @jon.zoom https://miskiewicz.s3.eu-central-1.amazonaws.com/zoom/Remote+for+Zoom+18+Jan+2021.zip

ZoomAuthService: login: start time: 2021-01-18 14:11:21 +0000

2021-01-18 15:11:21.768737+0100 Remote for Zoom[2303:80702] Mac Address: AC:87:A3:12:C9:44

ZoomAuthService:onZoomSDKLogin(_ loginStatus: ZoomSDKLoginStatus(rawValue: 3), failReason reason: , time: 2021-01-18 14:11:21 +0000

ZoomAuthService:onZoomSDKLogin(_ loginStatus: ZoomSDKLoginStatus(rawValue: 2), failReason reason: , time: 2021-01-18 14:11:52 +0000

ZoomAuthService: login failed: end time: 2021-01-18 14:11:52 +0000

HalloServer: Response: Optional("{“request”:{“auth”:{“login”:[“xxxyyy@yahoo.com”,“123456”]}},“response”:“IkVycm9yIg==”}”)

I provided 100% correct credentials and yet after unbearably long delay the SDK didn’t log me in. I hope the logs can help your team to clarify why.

Hi @tmiskiew, thanks for the additional information.

I know that this issue has been ongoing for a while, but we still have not been able to reproduce this across many different environments internally.

Is it possible that you have anything out of the ordinary on your network (e.g. debug proxy, VPN, etc.)? If not, we’re unfortunately headed back to the drawing board on how to make progress on this.

Thanks!

Nothing extraordinary here nor at any other location my developers work around the world.

You asked for logs. I provided them. What do you see in there?

Hi @tmiskiew,

Noted. I don’t have any updates on this for you just yet, but we are doing our best to figure out what could be causing these issues. Please bear with us as we investigate, as the inability to reproduce on our end may cause longer delays than usual.

Regardless, I will let you know as soon as we have any updates or if we need additional information in the future.

Thanks!

Would it make sense to have a short zoom call with one of your devs to demo the problem?

Hi @tmiskiew,

I don’t think that will be necessary. At this point, we fully understand the issue and you have done a great job of outlining the impact it has in your application. It’s just a matter of identifying what could be causing this which is preventing us from reproducing.

If I or anyone else on the team can think of something, I will absolutely reach out. :slightly_smiling_face:

Thanks!