# ZoomSDK C# Wrapper: AUTHRET\_OVERTIME when calling SDKAuth - Fails to Authenticate

**URL:** <https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069>\
**Category:** Meeting SDK\
**Created:** [February 2, 2024, 10:56am UTC](https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069 "2024-02-02T10:56:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ege.apak](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@ege.apak](https://devforum.zoom.us/u/ege.apak)\
**Post date:** [February 2, 2024, 10:56am UTC](https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069/1 "2024-02-02T10:56:00Z")

</div>

Hi Team!

**Description**  
We have a custom Windows Desktop App integrating with Zoom Meeting SDK using C# Wrapper. On some cases when I call SDKAuth(authContext) the onAuthenticationReturn callback result is AUTHRET\_OVERTIME, however there is no appearent network problem and initialization and authentication usually doesn’t produce this result.

**Which Desktop Client SDK version?**  
v5.16.1

**Device:**  
Windows 10 Desktop

**Additional context**  
I am initializing ZoomSDK with domain “[https://zoom.us](https://zoom.us/)” and after initialization I authenticate the SDK with a JWT token. I enabled logging to find out what the issue is but the log files seems encrypted so I can’t work out the problem. I would like to share the log files as well.

Here is my authentication code.

```auto
        private static string? CreateToken(DateTime issuedAt)
        {
            var tokenExp = issuedAt + TimeSpan.FromDays(1);
            var tokenDescriptor = new SecurityTokenDescriptor
            {
                Claims = new Dictionary<string, object>
                {
                    ["appKey"] = APP_KEY,
                    ["tokenExp"] = ((DateTimeOffset)(tokenExp.ToLocalTime())).ToUnixTimeSeconds()
                },
                IssuedAt = issuedAt.ToLocalTime(),
                Expires = (issuedAt + TimeSpan.FromDays(1)).ToLocalTime(),
                NotBefore = issuedAt.ToLocalTime(),
                SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(Encoding.ASCII.GetBytes(APP_SECRET)), SecurityAlgorithms.HmacSha256)
            };

            var tokenHandler = new JwtSecurityTokenHandler();
            var token = tokenHandler.CreateToken(tokenDescriptor);
            var serializedToken = tokenHandler.WriteToken(token);
            return serializedToken;
        }

        public static async Task<SDKError> Auth(DateTime? issueDate = null)
        {
            AuthContext authContext = new AuthContext()
            {
                jwt_token = CreateToken(issueDate ?? DateTime.UtcNow)
            };
            CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn(OnAuthenticationReturn);
            CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet(OnLoginReturn);
            SDKError err = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authContext);
            
            var authResult = await _authenticationResult.Task;

            System.Diagnostics.Trace.WriteLine(CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().GetSDKIdentity(), "ZoomSDK");

            _authenticationResult = new TaskCompletionSource<AuthResult>();
            if (authResult != AuthResult.AUTHRET_SUCCESS)
            {
                _logger.Error($"AV Authentication failed! Status: {authResult} | Token: {authContext.jwt_token}");
                return SDKError.SDKERR_UNAUTHENTICATION;
            }
            
            SetupCallbacks();

            return err;
        }

```

Thank you,  
Ege.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 6, 2024, 4:38am UTC](https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069/2 "2024-02-06T04:38:52Z")

</div>

@ege.apak do you have a sample of the generated token?

---

<div class="post-metadata">

**Author:** ![ege.apak](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@ege.apak](https://devforum.zoom.us/u/ege.apak)\
**Post date:** [February 6, 2024, 12:26pm UTC](https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069/3 "2024-02-06T12:26:10Z")

</div>

@chunsiong.zoom I have added Zoom SDK logs and the generated token to TS0516608 on Zoom Support.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 6, 2024, 2:26pm UTC](https://devforum.zoom.us/t/zoomsdk-c-wrapper-authret-overtime-when-calling-sdkauth-fails-to-authenticate/103069/4 "2024-02-06T14:26:16Z")

</div>

@ege.apak i don’t have access to specific tickets. I’ll leave it to the support team to investigate and respond on this then
