# ASWebAuthenticationSession Faiure

**URL:** <https://devforum.zoom.us/t/aswebauthenticationsession-faiure/77289>\
**Category:** macOS\
**Tags:** oauth, meeting-sdk\
**Created:** [October 12, 2022, 4:22am UTC](https://devforum.zoom.us/t/aswebauthenticationsession-faiure/77289 "2022-10-12T04:22:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasoundman](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vasoundman/32/34599_2.png) [@vasoundman](https://devforum.zoom.us/u/vasoundman)\
**Post date:** [October 12, 2022, 4:22am UTC](https://devforum.zoom.us/t/aswebauthenticationsession-faiure/77289/1 "2022-10-12T04:22:41Z")

</div>

### 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](https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/build-an-app/pkce/)

I also followed:  
[ZoomSDK for macOS crashes at initSDK](https://devforum.zoom.us/t/zoomsdk-for-macos-crashes-at-initsdk/74180)[ZoomSDK for macOS crashes at initSDK](https://devforum.zoom.us/t/zoomsdk-for-macos-crashes-at-initsdk/74180)

**How To Reproduce**  
_Steps to reproduce the behavior including:_  
_1. Authentication method or app type_  
_2. Any errors_  
_3. Browser/client type and version_

[https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/build-an-app/pkce/](https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/build-an-app/pkce/)

---

<div class="post-metadata">

**Author:** ![vasoundman](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vasoundman/32/34599_2.png) [@vasoundman](https://devforum.zoom.us/u/vasoundman)\
**Post date:** [October 15, 2022, 1:29am UTC](https://devforum.zoom.us/t/aswebauthenticationsession-faiure/77289/2 "2022-10-15T01:29:45Z")

</div>

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.

```auto
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:**

```auto
  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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 14, 2022, 11:30am UTC](https://devforum.zoom.us/t/aswebauthenticationsession-faiure/77289/3 "2022-11-14T11:30:18Z")

</div>

Closed on November 14, 2022, 11:30am UTC

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