public static bool AuthorizeAPI(string userName, string password, out string errMsg) { System.Web.Mvc.UrlHelper Url = new System.Web.Mvc.UrlHelper(); string backendServiceUrl = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"].ToString(); string providedLoginInfo = "grant_type=password&username="******"&password="******"token", providedLoginInfo, "application/json", "application-x-www-form-urlencode", string.Empty, out errMsg); return(!string.IsNullOrEmpty(token)); }