Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1
-
None
Description
There is a bug in method build(...) of class org.apache.ws.secpolicy.builders.IssuedTokenBuilder,
which processes the <IssuedToken> assertion.
Instead of fetching the <RequestSecurityTokenTemplate> and calling issuedToken.setRstTemplate(...),
the <Issuer> element is fetched again and issuedToken.setIssuerEpr(...) is called a second time.
extract of the incorrect code:
public Assertion build(OMElement element, AssertionBuilderFactory factory)
throws IllegalArgumentException {
IssuedToken issuedToken = new IssuedToken();
// Extract Issuer
OMElement issuerElem = element.getFirstChildWithName(Constants.ISSUER);
if (issuerElem != null && issuerElem.getFirstElement() != null)
// Extract RSTTemplate
OMElement rstTmplElem = element.getFirstChildWithName(Constants.ISSUER);
if (rstTmplElem != null)
...
}
As can be seen, getFirstChildWithName(Constants.ISSUER) is called twice, as well as setIssuerEpr(...).
In result, the <RequestSecurityTokenTemplate> element will not be included in the policy of the deployed service.
A client must must obtain it locally (e.g. from a file) and cannot extract it from the response of a metadata exchange.
Moreover, the complete <Issuer> element will be stored, rather than just the endpoint reference that it contains.
This affects serialization of the element (<IssuedToken><Issuer><Issuer>...</Issuer></Issuer></IssuedToken>).
Thx in advance for fixing this issue.
Best regards,
Uwe Kylau