ASWebAuthenticationSession Faiure

Format Your New Topic as Follows:

Which macOS Meeting SDK version?
macos-5.12.0.11229

Device (please complete the following information):

  • Device: Apple MacBook Pro (16-inch, M1)

Error?
The attempt returns error:
" The provided scheme is not valid. A scheme should not include special characters such as “:” or “/”"

Troubleshooting Routes
I have visited the site below site, there I followed the steps exactly as intended. However, the error still occurs.

PKCE OAuth and the iOS Meeting SDK

I also followed:
ZoomSDK for macOS crashes at initSDKZoomSDK for macOS crashes at initSDK

How To Reproduce
Steps to reproduce the behavior including:
1. Authentication method or app type
2. Any errors
3. Browser/client type and version

This is my code. See where the code breaks down in the area below. Pretty much copy from how you say we can do it from the instructions you give. But for some reason it does not work.

guard var oauthUrlComp = URLComponents(string: "https://zoom.us/oauth/authorize") else { return }

        let codeChallenge = URLQueryItem(name: "code_challenge", value: codeChallengeHelper.getCodeChallenge())
        let codeChallengeMethod = URLQueryItem(name: "code_challenge_method", value: "S256")
        let responseType = URLQueryItem(name: "response_type", value: "code")
        let clientId = URLQueryItem(name: "client_id", value: "MYSPECIALCODE") // TODO: Enter your OAuth client ID.
        let redirectUri = URLQueryItem(name: "redirect_uri", value: "https://myApp.com") // TODO: Enter the redirect URI of your OAuth app.
        oauthUrlComp.queryItems = [responseType, clientId, redirectUri, codeChallenge, codeChallengeMethod]
                
        let scheme = "myApp.com" // TODO: Enter the custom scheme of the redirect URI of your OAuth app.

        guard let oauthUrl = oauthUrlComp.url else { return }

This is where the error occurs. callbackUri = NIL:

  let session = ASWebAuthenticationSession(url: oauthUrl, callbackURLScheme: scheme) { callbackUrl, error in
            self.handleAuthResult(callbackUrl: callbackUrl, error: error)
        }
        session.prefersEphemeralWebBrowserSession = true
        session.presentationContextProvider = self
        session.start()
    }
    
    private func handleAuthResult(callbackUrl: URL?, error: Error?) {
        guard let callbackUrl = callbackUrl else { return }
        if (error == nil) {
            guard let url = URLComponents(string: callbackUrl.absoluteString) else { return }
            guard let code = url.queryItems?.first(where: { $0.name == "code" })?.value else { return }
            self.requestAccessToken(code: code, codeChallengeHelper: self.codeChallengeHelper)
        }
        print(error)
    }

I reached out to Apple Code Level Support. They responded as follows (ticket number: 811071814):

Thanks for contacting Developer Technical Support. This question generated much discussion on our team, and after investigating, we’ve determined that this is an issueto address with Zoom.

From what I’ve been able to determine after a brief look at Zoom’s documentation, they only support the http or https URIs for their oauth method of authentication. … Please contact Zoom for further assistance on implementing their APIs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.