[SWS-815] Error loading SAML properties file Created: 04/Dec/12  Updated: 05/Dec/12  Resolved: 05/Dec/12

Status: Resolved
Project: Spring Web Services
Component/s: Security
Affects Version/s: 2.1.2
Fix Version/s: 2.1.3

Type: Bug Priority: Minor
Reporter: jaminh Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 5m
Original Estimate: Not Specified

Issue Links:
relates to SWS-796 Ability to specify SAML properties fi... Resolved


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.

Comment by jaminh [ 04/Dec/12 ]

Related to https://jira.springsource.org/browse/SWS-796

Comment by jaminh [ 04/Dec/12 ]

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().

Comment by Arjen Poutsma [ 05/Dec/12 ]

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

Comment by jaminh [ 05/Dec/12 ]

Tried it with the snapshot and it worked. Thanks.

Generated at Tue Nov 13 04:41:29 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.