private static AadAuthParams[] ReadLocalSecurityAuthParams() { AadAuthParams[] result; using (Stream resourceAsStream = AadAuthParams.GetResourceAsStream("ASAzureSecurityConfig.xml")) { result = AadAuthParams.DeserializeAuthParams(resourceAsStream); } return(result); }
private static AadAuthParams[] ReadRemoteSecurityAuthParams() { AadAuthParams[] result; using (WebClient webClient = new WebClient()) { try { byte[] buffer = webClient.DownloadData("https://global.asazure.windows.net/ASAzureSecurityConfig.xml"); using (MemoryStream memoryStream = new MemoryStream(buffer)) { result = AadAuthParams.DeserializeAuthParams(memoryStream); } } catch (WebException) { result = new AadAuthParams[0]; } } return(result); }