# Zoom Meeting SDK issue with Auth (Oauth Server to Server App)

**URL:** <https://devforum.zoom.us/t/zoom-meeting-sdk-issue-with-auth-oauth-server-to-server-app/89616>\
**Category:** Meeting SDK\
**Created:** [June 5, 2023, 11:12am UTC](https://devforum.zoom.us/t/zoom-meeting-sdk-issue-with-auth-oauth-server-to-server-app/89616 "2023-06-05T11:12:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlachance](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@dlachance](https://devforum.zoom.us/u/dlachance)\
**Post date:** [June 5, 2023, 11:12am UTC](https://devforum.zoom.us/t/zoom-meeting-sdk-issue-with-auth-oauth-server-to-server-app/89616/1 "2023-06-05T11:12:45Z")

</div>

**Meeting SDK Type and Version**  
Meeting SDK Windows + C# Wrapper 5.14.5.15340

**Description**  
Hi, I have some trouble to authenticate with the Windows Meeting SDK (C# Wrapper).

I have 2 main issues:

1. Sometime, the CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add\_CB\_onAuthenticationReturn callback is not actually called and I have no idea why. I activated the log and there is nothing in it.

2. When the callback work, I always receive an error code 11 who is not documented and not part of the enum **AuthResult**.

Here is the code:

```
private void ButtonAuth_Click( object sender, RoutedEventArgs e )
{
  //register callback
  CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn( OnAuthenticationReturn );
  CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet( OnLoginRet );
  CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLogout( OnLogout );

  AuthContext authContext = new AuthContext { jwt_token = GenerateJwtToken() };
  CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth( authContext );
  Hide();
}

private static string GenerateJwtToken()
{
  long iat = (int)( DateTime.Now - new DateTime( 1970, 1, 1 ) ).TotalSeconds;
  long exp = iat + 60 * 60 * 24; // 24 hours
  long tokenExp = exp;

  string payload = JsonSerializer.Serialize(
    new
    {
      appKey = "OAuth Server to Server App Client ID", 
      iat,
      exp,
      tokenExp
    } );

  string token = JWT.Encode(
    $"{payload}",
    Encoding.ASCII.GetBytes( "OAuth Server to Server App Client Secret" ), 
    JwsAlgorithm.HS256 );

  return token;
}

```

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [October 11, 2023, 12:23pm UTC](https://devforum.zoom.us/t/zoom-meeting-sdk-issue-with-auth-oauth-server-to-server-app/89616/2 "2023-10-11T12:23:18Z")

</div>

@dlachance ,

Sorry for not getting back to you sooner. We sincerely apologize for any inconvenience caused. We wanted to reach out and see if the issue you mentioned is still persisting. Rest assured, we are more than happy to lend a hand in diagnosing, troubleshooting, and finding a solution for you. We understand how frustrating technical issues can be, and we’re here to support you every step of the way. Please don’t hesitate to let us know if there’s anything else we can do to assist you. We’re committed to providing the best possible assistance and ensuring your satisfaction.

Thank you for your patience, and we look forward to hearing from you!
