Пример #1
0
        public async Task GetUserPrincipals()
        {
            if (!isValidPrivateData())
            {
                return;
            }

            try {
                HttpResponseMessage response = await client.GetAsync(USER_PRINCIPALS_URL);

                response.EnsureSuccessStatusCode();
                string responseBody = await response.Content.ReadAsStringAsync();

                this.userPrincipal = JsonSerializer.Deserialize <UserPrincipalResponse>(responseBody);
            }
            catch (HttpRequestException e)
            {
                Debug.WriteLine("\nException Caught GetUserPrincipals()!");
                Debug.WriteLine("Message :{0} ", e.Message);
            }
        }
Пример #2
0
 public Authentication()
 {
     // Load any saved settings
     this.privateData   = loadPrivateData();
     this.userPrincipal = new UserPrincipalResponse();
 }