if (providerType instanceof SPConfiguration) {
SPConfiguration configuration = (SPConfiguration) providerType;
if (configuration.isSupportMetadata()) {
try {
SPType metadataConfig;
if (configuration.isPostBinding()) {
metadataConfig = new SPPostMetadataConfigurationProvider().getSPConfiguration();
} else {
metadataConfig = new SPRedirectMetadataConfigurationProvider().getSPConfiguration();
}
metadataConfig.importFrom(configuration);
providerType = metadataConfig;
} catch (ProcessingException e) {
throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e);
}