# SDK authentication failed, error code: 2

**URL:** <https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018>\
**Category:** iOS\
**Created:** [September 3, 2020, 9:16am UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018 "2020-09-03T09:16:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca.milanesi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/luca.milanesi/32/14623_2.png) [@luca.milanesi](https://devforum.zoom.us/u/luca.milanesi)\
**Post date:** [September 3, 2020, 9:16am UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/1 "2020-09-03T09:16:56Z")

</div>

**Description**  
Every time I try to authenticate the SKD, I got this error (code 2)  
The documentation says to contact the support in this case.

This is my code:

- (void)SDKAuth:(NSString \*)clientKey clientSecret:(NSString \*)clientSecret  
{  
clientKey = clientKey;  
clientSecret = clientSecret;  
MobileRTCAuthService \*authService = [[MobileRTC sharedRTC] getAuthService];  
if (authService)  
{  
authService.delegate = self;  
authService.clientKey = clientKey;  
authService.clientSecret = clientSecret;

- (void)onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue  
{  
NSLog(@“onMobileRTCAuthReturn %d”, returnValue);

In the didFinishLaunchingWithOptions:

```
MobileRTCSDKInitContext *context = [[MobileRTCSDKInitContext alloc] init];
context.domain = kSDKDomain;
context.enableLog = YES;
context.locale = MobileRTC_ZoomLocale_Default;
MobileRTC *mr = [MobileRTC sharedRTC];
[mr initialize:context];

[self SDKAuth:kSDKAppKey clientSecret:kSDKAppSecret]; 

```

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

- iPhone 7
- iOS 13.6.1

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [September 3, 2020, 7:28pm UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/2 "2020-09-03T19:28:49Z")

</div>

Hey @luca.milanesi

Thanks for using the dev forum!

This error actually just means the key and/or secret are incorrect. Are you getting the clientKey and clientSecret from [https://marketplace.zoom.us/](https://marketplace.zoom.us/)?

Thanks  
Michael

---

<div class="post-metadata">

**Author:** ![luca.milanesi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/luca.milanesi/32/14623_2.png) [@luca.milanesi](https://devforum.zoom.us/u/luca.milanesi)\
**Post date:** [September 4, 2020, 7:57am UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/3 "2020-09-04T07:57:57Z")

</div>

Good morning. I use the key provided also for the android App, that works

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [September 4, 2020, 6:38pm UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/4 "2020-09-04T18:38:43Z")

</div>

Hey @luca.milanesi

What domain are you using?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![luca.milanesi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/luca.milanesi/32/14623_2.png) [@luca.milanesi](https://devforum.zoom.us/u/luca.milanesi)\
**Post date:** [September 7, 2020, 7:45am UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/5 "2020-09-07T07:45:27Z")

</div>

> **[Video Conferencing, Web Conferencing, Webinars, Screen Sharing](https://zoom.us/)**
>
> Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference...

I have found the bug checking the chars for the keys. the last chars missed. Thanks for help. I ave found the bug with your help.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [September 8, 2020, 11:26pm UTC](https://devforum.zoom.us/t/sdk-authentication-failed-error-code-2/29018/6 "2020-09-08T23:26:36Z")

</div>

@luca.milanesi

Awesome! I am glad to hear it is working now!

Michael
