private boolean fileAvailable() { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); return is != null; }
private boolean fileAvailable() { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); return is != null; }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); if (is == null) throw logger.nullValueError(getIdpMetadataLocation()); Object idpMetadata = new SAMLParser().parse(is); EntitiesDescriptorType entities; if (EntitiesDescriptorType.class.isInstance(idpMetadata)) { entities = (EntitiesDescriptorType) idpMetadata; } else { entities = new EntitiesDescriptorType(); entities.addEntityDescriptor(idpMetadata); } return entities; }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); if (is == null) throw logger.nullValueError(getIdpMetadataLocation()); Object idpMetadata = new SAMLParser().parse(is); EntitiesDescriptorType entities; if (EntitiesDescriptorType.class.isInstance(idpMetadata)) { entities = (EntitiesDescriptorType) idpMetadata; } else { entities = new EntitiesDescriptorType(); entities.addEntityDescriptor(idpMetadata); } return entities; }
/** * @see org.picketlink.identity.federation.web.util.SAMLConfigurationProvider#getIDPConfiguration() */ public IDPType getIDPConfiguration() throws ProcessingException { IDPType idpType = null; if (fileAvailable()) { try { EntitiesDescriptorType entities = parseMDFile(); if(entities == null){ throw logger.nullValueError("entities"); } IDPSSODescriptorType idpSSO = CoreConfigUtil.getIDPDescriptor(entities); if (idpSSO != null) { idpType = CoreConfigUtil.getIDPType(idpSSO); } configureTrustedDomainsFromMetadata(idpType, entities); } catch (ParsingException e) { throw logger.processingError(e); } } else { throw logger.nullValueError(getIdpMetadataLocation()); } if (configParsedIDPType != null) { idpType.importFrom(configParsedIDPType); } return idpType; }
/** * @see org.picketlink.identity.federation.web.util.SAMLConfigurationProvider#getIDPConfiguration() */ public IDPType getIDPConfiguration() throws ProcessingException { IDPType idpType = null; if (fileAvailable()) { try { EntitiesDescriptorType entities = parseMDFile(); if(entities == null){ throw logger.nullValueError("entities"); } IDPSSODescriptorType idpSSO = CoreConfigUtil.getIDPDescriptor(entities); if (idpSSO != null) { idpType = CoreConfigUtil.getIDPType(idpSSO); } configureTrustedDomainsFromMetadata(idpType, entities); } catch (ParsingException e) { throw logger.processingError(e); } } else { throw logger.nullValueError(getIdpMetadataLocation()); } if (configParsedIDPType != null) { idpType.importFrom(configParsedIDPType); } return idpType; }