...
Use
FilesystemMetadataProvider
orLocalDynamicMetadataProvider
for local metadataUse
FileBackedHTTPMetadataProvider
orDynamicHTTPMetadataProvider
for remote metadataUse entity attributes to drive automated relying party configuration (this is called a metadata-driven configuration)
In addition, consider using one or more MetadataFilterPlugins to secure or optimize your configuration; for example the SchemaValidationFilter to ensure your metadata has no obvious errors in it, or the EntityRoleWhiteListFilter to decrease the memory use of the loaded metadata.
The following sections expand on these best practices from the perspective of an IdP deployer.
...