# getAuthService authSDK returned with ZoomSDKError(rawValue: 3)

**URL:** <https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499>\
**Category:** macOS\
**Created:** [February 16, 2021, 5:50pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499 "2021-02-16T17:50:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.zhang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/m.zhang/32/18203_2.png) [@m.zhang](https://devforum.zoom.us/u/m.zhang)\
**Post date:** [February 16, 2021, 5:50pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/1 "2021-02-16T17:50:53Z")

</div>

**Description**  
I have my own application and have imported all the Zoom SDK Frameworks. However, I could not authenticate with JWT.

**Which version?**  
zoom-sdk-macos-5.4.54802.0124

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Download zoom-sdk-macos-5.4.54802.0124.zip from marketplace
2. Launched Sample App and verified the JWT token generated is working. Join Meeting without Login works as expected in the Sample App.
3. Drag and drop the folder ZoomSDK into my own application and add all the embeded binaries and Frameworks.
4. Use the code below

> ```
> let params = ZoomSDKInitParams()
> params.needCustomizedUI = false;
> params.teamIdentifier = nil;
> params.enableLog = true;
> params.logFileSize = 50;
> 
> ZoomSDK.shared().initSDK(with: params)
> let sdk: ZoomSDK = ZoomSDK.shared()
> // set zoom domain
> sdk.zoomDomain = kZoomSDKDomain // set to "zoom.us"
> 
> let jwt = JWTTOKEN // generated from jwt.io 
> 
> let authContext = ZoomSDKAuthContext()
> authContext.jwtToken = jwt
> let authService = ZoomSDK.shared().getAuthService()
> let authDelegate = ZMAuthDelegate(). // a class similar to ZMSDKAuthHelper in the sample app.
> authService?.delegate = authDelegate
> let response = authService!.sdkAuth(authContext)
> if response == ZoomSDKError_Success{
> print("SUCCESS")
> } else {
> print("fail")
> print(response)
> }
> 
> ```

Console Output:

> fail  
> ZoomSDKError(rawValue: 3)

**Screenshots**  
Some of the other posts said to check if the ZoomSDK is in the same folder ![Screen Shot 2021-02-16 at 12.41.56 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/c/ccbc1188824753fcbd5228f856fd97713a0cd2e2.png)

**Smartphone (please complete the following information):**

- Device: Macbook Pro
- OS: macOS Catalina
- Version 10.15.7

**Additional context**  
Any help is appreciated! Thanks in advance!

---

<div class="post-metadata">

**Author:** ![m.zhang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/m.zhang/32/18203_2.png) [@m.zhang](https://devforum.zoom.us/u/m.zhang)\
**Post date:** [February 17, 2021, 5:50pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/2 "2021-02-17T17:50:35Z")

</div>

I’ve read through many similar issues in the forum and tried the suggested solutions, but cannot seem to identify the problem here. It’s been a couple days that I’m stuck on this error. Could someone offer some insights please?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 17, 2021, 6:28pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/3 "2021-02-17T18:28:06Z")

</div>

Hi @m.zhang, thanks for the post.

Can you please provide the content of your JWT **with all credentials edited out** (i.e. replace SDK key/secret with arbitrary values) so that we may investigate further?

Thanks!

---

<div class="post-metadata">

**Author:** ![m.zhang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/m.zhang/32/18203_2.png) [@m.zhang](https://devforum.zoom.us/u/m.zhang)\
**Post date:** [February 17, 2021, 6:57pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/4 "2021-02-17T18:57:32Z")

</div>

Hi @jon.zoom,

For sure. This is the code I wrote to generate the JWT token with JSONWebToken v2.2.0 library which is one of the listed libraries from [JWT.io](http://JWT.io).

> ```
> let issuedAt: Int = Int(Date().timeIntervalSince1970)
> let expAt: Int = issuedAt + 2*24*60*60
> let payload = ["appKey": appKey,
> "iat": issuedAt, // timestamp of now in epoch time
> "exp": expAt, // timestamp of expiration (max gap is 2 days)
> "tokenExp": expAt] as [String : Any]
> print(payload)
> let jwt = JWT.encode(claims: payload, algorithm: .hs256(appSecret.data(using: .utf8)!))
> print(jwt)
> 
> ```

Here’s the Payload section generated by the code above.  
[“iat”: 1613587687, “exp”: 1613760487, “tokenExp”: 1613760487, “appKey”: “AppKeyFromMarketplace”]

With the jwt token printed, I could run the sample application no problem at all. Maybe you can spot some caveats that I didn’t find? Thank you!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 17, 2021, 8:45pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/5 "2021-02-17T20:45:15Z")

</div>

Hi @m.zhang,

Everything appears to be correct in terms of the JWT format, especially since it runs fine in our sample app. Can you please confirm that you have correctly imported the SDK package into your project by comparing your Build Phases tab against that of the sample app? Let me know if you’re uncertain about anything you see and I’ll be happy to help. 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![m.zhang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/m.zhang/32/18203_2.png) [@m.zhang](https://devforum.zoom.us/u/m.zhang)\
**Post date:** [February 17, 2021, 8:51pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/6 "2021-02-17T20:51:51Z")

</div>

Hi @jon.zoom ,

I was comparing the Sample App Xcode project and mine just now and I realized that in the Xcode project, `Build Phases` tab, under `Copy Files`, I don’t have all of the `.bundle`, `.app` files listed as they appeared in the Sample App. Therefore I added them to my `Copy Files` with destination set to `Frameworks`. However, when I build, I encountered this Code Sign issue  
`Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.` I read on the other post that I’m suppose to re-sign the library files. This is my first time doing this so I’m very confused about what need to be done to re-sign. Do you mind give me a bit more instructions?  
Thank you!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 17, 2021, 10:09pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/7 "2021-02-17T22:09:40Z")

</div>

Hi @m.zhang,

Yes, you seem to have the right idea that you will need to re-sign some of the SDK files. 🙂 (Note: this should only be necessary for files with the `app` file extension) Here is some [documentation](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html) from Apple on the topic that should be extremely helpful.

Thanks!

---

<div class="post-metadata">

**Author:** ![m.zhang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/m.zhang/32/18203_2.png) [@m.zhang](https://devforum.zoom.us/u/m.zhang)\
**Post date:** [February 18, 2021, 12:14am UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/8 "2021-02-18T00:14:25Z")

</div>

Yeeee! I resolved this problem. Like @jon.zoom mentioned, I only needed to re-sign the `.app` files and the command I used is `codesign --force --verify --timestamp --verbose --options=runtime --sign "identity" filename.app` which comes from this [other post](https://devforum.zoom.us/t/zoom-mac-sdk-has-been-released/772/3) in the forum.  
Thank you @jon.zoom for your help!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 18, 2021, 5:25pm UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/9 "2021-02-18T17:25:21Z")

</div>

That’s great to hear. 🙂

Please don’t hesitate to reach back out with a new post if you encounter any other issues!

---

<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:** [March 21, 2021, 3:26am UTC](https://devforum.zoom.us/t/getauthservice-authsdk-returned-with-zoomsdkerror-rawvalue-3/43499/10 "2021-03-21T03:26:05Z")

</div>

Closed on March 21, 2021, 3:26am UTC

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