Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Error loading SAML properties file [SWS-815] #895
Wss4j is unable to load the properties file when it is given an absolute path. Wss4j is using the ClassLoader to load the properties file. See http://grepcode.com/file/repository.springsource.com/org.apache.ws/com.springsource.org.apache.ws.security/1.6.5/org/apache/ws/security/saml/SAMLIssuerFactory.java#SAMLIssuerFactory.getProperties%28java.lang.String%29 for how the saml properties file gets loaded by Wss4j.
Referenced from: commits e014fbf
It is probably worth mentioning that I used a ClassPathResource for specifying the saml properties location. Perhaps if I used a different kind of Resource getAbsolutePath() would just return the string I pass into it when I construct it? Ultimately I think using Resource for the parameter on the setSamlProperties() method in the Wss4jSecurityInterceptor is inappropriate since the properties file has to be on the Classpath. Perhaps it would make sense to require a ClassPathResource that way we can ensure that the file is on the classpath and that it exists, but instead of calling getFile().getAbsolutePath() we can just call getPath().
Arjen Poutsma commented
I'm sorry for this. I thought that using a Resource would allow for more flexibility, but it turns out WSS4J is a bit picky (as always).
I have changed the Resource parameter into a String in SVN. I've also triggered a snapshot build of 2.1.3 that contains this change. Could you please try a snapshot and see if it works? See http://static.springsource.org/spring-ws/site/downloads/snapshots.html