public IHttpActionResult Authorize()
 {
     var retVal = string.Empty;
     if (isSubdomainSet)
     {
         var zdo = new ZendeskOAuth(_configuration);
         retVal = zdo.getLoginURL();
     }
     return Ok(new[] { retVal });
 }
 public IHttpActionResult Authorize()
 {
     var retVal = string.Empty;
     if (isSubdomainSet && Request != null && RequestContext != null)
     {
         _configuration["redirect_uri"] = string.Format(_configuration["redirect_uri"], new Uri(Request.RequestUri, RequestContext.VirtualPathRoot));
         var zdo = new ZendeskOAuth(_configuration);
         retVal = zdo.getLoginURL();
     }
     return Ok(new[] { retVal });
 }
 public IHttpActionResult Complete()
 {
     var state = HttpContext.Current.Request.QueryString["state"];
     if (state.Equals(_state))
     {
         _configuration.Add("code", HttpContext.Current.Request.QueryString["code"]);
         _configuration["scope"] = "read";
         var zdo = new ZendeskOAuth(_configuration);
         var accessToken = zdo.getSession();
         
         if (!string.IsNullOrEmpty(accessToken))
         {
             _settingsManager.AccessToken = accessToken;
         }
         return Ok();
     }
     return new BadRequestResult(this);
 }