/** * @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 SAMLConfigurationProvider#getIDPConfiguration() */ public IDPType getIDPConfiguration() throws ProcessingException { IDPType idpType = null; if (fileAvailable()) { try { EntitiesDescriptorType entities = parseMDFile(); 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(IDP_MD_FILE); } if (configParsedIDPType != null) { idpType.importFrom(configParsedIDPType); } return idpType; }
/** * @see SAMLConfigurationProvider#getIDPConfiguration() */ public IDPType getIDPConfiguration() throws ProcessingException { IDPType idpType = null; if (fileAvailable()) { try { EntitiesDescriptorType entities = parseMDFile(); IDPSSODescriptorType idpSSO = CoreConfigUtil.getIDPDescriptor(entities); if (idpSSO != null) { idpType = CoreConfigUtil.getIDPType(idpSSO); } } catch (ParsingException e) { throw new ProcessingException(e); } } if (configParsedIDPType != null) { idpType.importFrom(configParsedIDPType); } return idpType; }
@Override public IDPType getIDPConfiguration() { ProviderType providerType = getPicketLinkConfiguration().getIdpOrSP(); if (providerType instanceof IDPConfiguration) { IDPConfiguration configuration = (IDPConfiguration) providerType; if (configuration.isSupportMetadata()) { try { IDPType metadataConfig = new IDPMetadataConfigurationProvider().getIDPConfiguration(); metadataConfig.importFrom(configuration); providerType = metadataConfig; } catch (ProcessingException e) { throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e); } } if (configParsedIDPType != null) { configuration.importFrom(configParsedIDPType); } return (IDPType) providerType; } return null; }
private boolean fileAvailable() { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); return is != null; }
/** * @see SAMLConfigurationProvider#getIDPConfiguration() */ public IDPType getIDPConfiguration() throws ProcessingException { IDPType idpType = null; if (fileAvailable()) { try { EntitiesDescriptorType entities = parseMDFile(); IDPSSODescriptorType idpSSO = CoreConfigUtil.getIDPDescriptor(entities); if (idpSSO != null) { idpType = CoreConfigUtil.getIDPType(idpSSO); } } catch (ParsingException e) { throw new ProcessingException(e); } } if (configParsedIDPType != null) { idpType.importFrom(configParsedIDPType); } return idpType; }
@Override public IDPType getIDPConfiguration() { ProviderType providerType = getPicketLinkConfiguration().getIdpOrSP(); if (providerType instanceof IDPConfiguration) { IDPConfiguration configuration = (IDPConfiguration) providerType; if (configuration.isSupportMetadata()) { try { IDPType metadataConfig = new IDPMetadataConfigurationProvider().getIDPConfiguration(); metadataConfig.importFrom(configuration); providerType = metadataConfig; } catch (ProcessingException e) { throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e); } } if (configParsedIDPType != null) { configuration.importFrom(configParsedIDPType); } return (IDPType) providerType; } return null; }
private boolean fileAvailable() { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); return is != null; }
/** * @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; }
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; }