Пример #1
0
        public async void AppLogin()
        {
            var loginResult = await AppDelegate.instance.client.LoginAsync();

            if (loginResult.IsError)
            {
                ToastMessage msg = new ToastMessage();
                msg.LongAlert("Error logging in: " + loginResult.Error);
            }
            else
            {
                AppSettings.Auth0Details.init();
                AppSettings.Auth0Details.identity  = loginResult.User.FindFirst("sub")?.Value;
                AppSettings.Auth0Details.logged_in = true;
            }
        }
Пример #2
0
        protected override void OnNewIntent(Intent intent)
        {
            base.OnNewIntent(intent);
            //var loginInfo = await client.ProcessResponseAsync(intent.DataString, authState);
            var task = Task.Run(async() => await client.ProcessResponseAsync(intent.DataString, authState));

            task.Wait();
            var loginInfo = task.Result;

            if (loginInfo.IsError)
            {
                ToastMessage msg = new ToastMessage();
                msg.LongAlert("Error logging in: " + loginInfo.Error);
            }
            else
            {
                AppSettings.Auth0Details.init();
                AppSettings.Auth0Details.identity  = loginInfo.User.FindFirst("sub")?.Value;
                AppSettings.Auth0Details.logged_in = true;
            }
        }