コード例 #1
0
        private static async Task acquireAndAddMsUser(List <UserBase> userList, Microsoft.Identity.Client.IAccount msAccount)
        {
            var token = new MicrosoftToken(msAccount);
            await token.AcquireNewToken();

            userList.Add(await UserBase.AcquireUserFromToken(token));
        }
コード例 #2
0
        private async void Microsoft_Click(object sender, RoutedEventArgs e)
        {
            viewModel.IsButtonAvailable = false;
            viewModel.IsLoading         = true;
            try
            {
                var token = new MicrosoftToken();
                await token.AcquireNewToken();

                var msClient = new MicrosoftClient(token);
                AppGlobalVariables.Users.Add(await msClient.GetUserDataAsync());
            }
            catch (Exception ex)
            {
                DebugHelper.Debugger.WriteErrorLog("Error in acquiring MS token on AuthDialog.", ex);
            }
            dialogHost.Hide();
        }