# Authorization Callback Never Returns in C# wrapper

**URL:** <https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324>\
**Category:** Windows\
**Created:** [April 30, 2021, 9:59pm UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324 "2021-04-30T21:59:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyler](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyler](https://devforum.zoom.us/u/tyler)\
**Post date:** [April 30, 2021, 9:59pm UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324/1 "2021-04-30T21:59:21Z")

</div>

**Description**  
I have two setups for running the Zoom Client SDK. I’m trying to run the C# wrapper in a standalone console application, and C++ calls to the sdk\_util class from an MVC project.

My console application:

Program.cs

```auto
        static void Main(string[] args)
        {
            DebugLogService debugLogService = new DebugLogService();
            ZoomService zoomService = new ZoomService(debugLogService);

            zoomService.InitializationAsync("...", "...").Wait();

            zoomService.JoinMeetingAsync("User", Convert.ToUInt64(123456789), "Pass").Wait();

            Console.WriteLine("Press enter to leave meeting");
            Console.ReadLine();

            zoomService.LeaveMeeting();
        }

```

ZoomService.cs

```auto
        public async Task<bool> InitializationAsync(string appKey, string appSecret)
        {
            try
            {
                var sdkInitialized = SdkInitialize();
                if (!sdkInitialized) return false;

                Initialized = await SdkAuthenticationAsync(appKey, appSecret);
            }
            catch (Exception)
            {
                Initialized = false;
            }

            return Initialized;
        }

        private bool SdkInitialize()
        {
            InitParam param = new InitParam
            {
                web_domain = "https://zoom.us",
                config_opts = { optionalFeatures = 1 << 5 }, // Using Zoom Customized UI
                enable_log = true,
            };
            SDKError error = CZoomSDKeDotNetWrap.Instance.Initialize(param);

            _logService.Log($"ZOOM InitSDK request result: {error}");

            return error == SDKError.SDKERR_SUCCESS;
        }

        private async Task<bool> SdkAuthenticationAsync(string appKey, string appSecret)
        {
            RegisterAuthenticationCallbacks();

            AuthParam authParam = new AuthParam
            {
                appKey = appKey,
                appSecret = appSecret
            };

            SDKError error = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authParam);

            _logService.Log($"ZOOM SDKAuth request result: {error}");

            if (error == SDKError.SDKERR_SUCCESS)
            {
                _authTaskCompletion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
                await _authTaskCompletion.Task;
                return true;
            }

            return false;
        }

        private void RegisterAuthenticationCallbacks()
        { CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn(OnAuthenticationReturn);
        }

        private void OnAuthenticationReturn(AuthResult result)
        {
            _logService.Log($"ZOOM OnAuthenticationReturn callback AuthResult: {result}");

            _authTaskCompletion.SetResult(result == AuthResult.AUTHRET_SUCCESS);
        }

```

Is there something else that I need to do to get this callback called? In hangs indefinitely.

**Which Windows Client SDK version?**  
5.5.12509.0330  
Assembly zoom\_sdk\_dotnet\_wrap, Version=1.0.7575.37543

---

<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:** [April 30, 2021, 11:09pm UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324/2 "2021-04-30T23:09:17Z")

</div>

Hey @tyler,

Thanks for using the dev forum!

This may be due to the fact you are using MVC. Are you seeing the same thing in the C# wrapper demo?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![tyler](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyler](https://devforum.zoom.us/u/tyler)\
**Post date:** [May 3, 2021, 10:52pm UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324/3 "2021-05-03T22:52:43Z")

</div>

No, only in MVC. Is there something in the C# wrapper that only works in a WPF application?

---

<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:** [May 4, 2021, 7:14pm UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324/4 "2021-05-04T19:14:08Z")

</div>

Hey @tyler,

I am not sure as we do not guarantee support for MVC.

Thanks!  
Michael

---

<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:** [June 4, 2021, 5:14am UTC](https://devforum.zoom.us/t/authorization-callback-never-returns-in-c-wrapper/49324/5 "2021-06-04T05:14:56Z")

</div>

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