private void Initialize(WebApiLoginResult loginResult) { Success = loginResult.Success; Error = loginResult.Error; ErrorDescription = loginResult.ErrorDescription; ErrorUri = loginResult.ErrorUri; TokenResult = loginResult.TokenResult; }
/// <summary> /// Tries to log the user in on the WebApi in an asynchronous manner. /// </summary> /// <param name="username">The username</param> /// <param name="password">The password</param> /// <returns></returns> public async Task <WebApiLoginResult> LoginAsync(string username, string password) { var request = new RestRequest("/token", Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded") .AddParameter("grant_type", "password") .AddParameter("username", username) .AddParameter("password", password); var response = await Client.ExecuteTaskAsync <Dictionary <string, string> >(request); var loginResult = new WebApiLoginResult(response.Data); return(loginResult); }
public WebApiLoginIdentityResult(WebApiLoginResult loginResult) : base(loginResult) { }
public WebApiLoginResult(WebApiLoginResult loginResult) { Initialize(loginResult); }