Esempio n. 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));
        }
Esempio n. 2
0
        private static async Task acquireAndAddUser(List <UserBase> userList, UserType type, Windows.Security.Credentials.PasswordCredential cred)
        {
            var token = new TokenBase();

            token.UserType = type;
            token.Id       = cred.UserName;
            if (type == UserType.Google)
            {
                token.RefreshToken = cred.Password;
                token = await token.AcquireNewToken();
            }
            else
            {
                token.AccessToken = cred.Password;
            }
            userList.Add(await UserBase.AcquireUserFromToken(token));
        }