public HttpResponseMessage UpdateSettings(CasProviderSettings settings) { try { CasProviderSettings.SaveSettings("Cas", PortalId, settings); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception ex) { Logger.Error(ex); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }
public static void SaveSettings(string service, int portalId, CasProviderSettings settings) { var config = new CasConfig(service, portalId) { ServerUrl = settings.ServerUrl, APIKey = settings.ApiKey, APISecret = settings.ApiSecret, AutoRedirect = settings.AutoRedirect, Enabled = settings.Enabled }; CasConfig.UpdateConfig(config); }
public HttpResponseMessage GetSettings() { try { var settings = CasProviderSettings.LoadSettings("Cas", PortalId); return(Request.CreateResponse(HttpStatusCode.OK, settings)); } catch (Exception ex) { Logger.Error(ex); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }