internal bool AuthenticateWithLogin(string username, string password) { if (string.IsNullOrEmpty(username)) { return(false); } if (string.IsNullOrEmpty(password)) { return(false); } using (var req = new AccessTokenRequestPassword(username, password) { Url = $@"{endpoint}/oauth/token", Method = HttpMethod.POST, ClientId = clientId, ClientSecret = clientSecret }) { try { req.Perform(); } catch { return(false); } Token = req.ResponseObject; return(true); } }
internal bool AuthenticateWithLogin(string username, string password) { var req = new AccessTokenRequestPassword(username, password) { Url = $@"{endpoint}/oauth/access_token", Method = HttpMethod.POST, ClientId = clientId, ClientSecret = clientSecret }; try { req.BlockingPerform(); } catch { return(false); } Token = req.ResponseObject; return(true); }