spring-attic / spring-security-saml-dsl

Spring security okta dsl.
MIT License
43 stars 61 forks source link

Cannot load metadata file packed in JAR #48

Open captSL opened 6 years ago

captSL commented 6 years ago

Hi,

in the current version it seems not to be possible to load a metadata file embedded in a JAR, like a packaged Spring Boot application. I get this exception:

java.io.FileNotFoundException: class path resource [saml/idp-meta.xml] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/test/test.jar!/WEB-INF/classes!/saml/idp-meta.xml

For me it looks like the FilesystemMetadataProvider being used requires a File handle and getting a File handle from a JAR is not possible. Instead, an InputStream should be used.

Can anyone confirm this?

Thanks, Thorsten

WalterHillAKQA commented 6 years ago

I have run into the same issue when starting spring boot using java -jar. It appears that running the application this way cannot find files on the classpath using a spring resource getFile method. When the code is changed to use an InputStream, then the file is found