URL url = new URL(idpMetaDataUrl);
URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout(3000);
urlConnection.setReadTimeout(3000);
Reader reader = new InputStreamReader(urlConnection.getInputStream());
SamlExternalEntity samlEntity = spConfigApi.addExternalSamlEntity(reader);
FacesMessage facesMessage = new FacesMessage("SAML entity " + samlEntity.getEntityId() + " has been added.");
FacesContext.getCurrentInstance().addMessage(null, facesMessage);
} catch (MalformedURLException e) {
FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Malformed URL.", "");
FacesContext.getCurrentInstance().addMessage(null, facesMessage);
} catch (IOException e) {