Beispiel #1
0
 public HttpResponseMessage UpdateAdvancedSettings(AzureADB2CProviderSettings settings)
 {
     try
     {
         AzureADB2CProviderSettings.SaveAdvancedSettings("AzureB2C", PortalId, settings);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }
Beispiel #2
0
 public HttpResponseMessage UpdateAdvancedSettings(AzureADB2CProviderSettings settings)
 {
     try
     {
         if (!UserInfo.IsSuperUser)
         {
             var config = new AzureConfig(AzureConfig.ServiceName, PortalId);
             if (config.UseGlobalSettings || config.UseGlobalSettings != settings.UseGlobalSettings)
             {
                 return(Request.CreateResponse(HttpStatusCode.Forbidden, "Only super users can change this setting"));
             }
         }
         AzureADB2CProviderSettings.SaveAdvancedSettings(AzureConfig.ServiceName, PortalId, settings);
         return(Request.CreateResponse(HttpStatusCode.OK, new { Success = true }));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }