[
https://issues.apache.org/jira/browse/RAMPART-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18147661#comment-18147661
]
Andreas Martens commented on RAMPART-463:
-----------------------------------------
Actually... less than perfect... I set that and now I get:
java.lang.NullPointerException: Cannot invoke
"java.lang.String.equals(java.lang.Object)" because the return value of
"org.apache.wss4j.dom.message.token.UsernameToken.getPasswordType()" is null
at
org.apache.rampart.PolicyBasedResultsValidator.handleSupportingTokens(PolicyBasedResultsValidator.java:352)
at
org.apache.rampart.PolicyBasedResultsValidator.validateSupportingTokens(PolicyBasedResultsValidator.java:309)
at
org.apache.rampart.PolicyBasedResultsValidator.validate(PolicyBasedResultsValidator.java:177)
at
com.ibm.broker.wssecurity.ImbConsumeTokenValidator.validate(ImbConsumeTokenValidator.java:81)
at org.apache.rampart.RampartEngine.process(RampartEngine.java:403)
at
org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:125)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:335)
at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:250)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:156)
at
com.ibm.broker.axis2.Axis2Invoker.processInboundRequest(Axis2Invoker.java:3662)
that ImbConsumeTokenValidator::validate function line is just calling
`super.validate()`
The code in the PolicyBasedResultsValidator around the problem is:
org.apache.wss4j.dom.message.token.UsernameToken wssUt =
(org.apache.wss4j.dom.message.token.UsernameToken)
utResult.get(WSSecurityEngineResult.TAG_USERNAME_TOKEN);
if(ut.isNoPassword() && wssUt.getPassword() != null) {
throw new RampartException("invalidUsernameTokenType");
}
if(ut.isHashPassword() && !wssUt.isHashed()) {
throw new RampartException("invalidUsernameTokenType");
} else if (!ut.isHashPassword() && (wssUt.getPassword() == null
||
!wssUt.getPasswordType().equals(WSConstants.PASSWORD_TEXT))) {
throw new RampartException("invalidUsernameTokenType");
}
so we're _assuming_ that there will be a password type.
Is this a problem with WSS4J (i.e. WSS4J should be defaulting the PW Type when
none specified and disableBSPEnforcement is specified. Or is it a problem in
Rampart that Rampart should default it when disableBSPEnforcement is specified?
> Conformance to WS-I Basic Security Profile
> ------------------------------------------
>
> Key: RAMPART-463
> URL: https://issues.apache.org/jira/browse/RAMPART-463
> Project: Rampart
> Issue Type: Question
> Components: rampart-core
> Affects Versions: 2.0.0
> Reporter: Andreas Martens
> Priority: Major
>
> Does Rampart prioritise Basic Security Profile Version 1.1 over WS-Security
> 1.1?
> Loaded question.
> On the Rampart homepage it says
> {quote}Rampart implements the following specifications:
> {quote} *
> {quote}WS - Security 1.0{quote}
> *
> {quote}WS - Security 1.1{quote}
> *
> {quote}WS - Secure Conversation - February 2005{quote}
> *
> {quote}WS - Security Policy - 1.1 - July 2005{quote}
> *
> {quote}WS - Security Policy - 1.2{quote}
> *
> {quote}WS - Trust - February 2005{quote}
> *
> {quote}WS - Trust - WS-SX specification{quote}
> *
> {quote}SAML Specification - 1.1{quote}
> *
> {quote}SAML Specification - 2.0{quote}
> But!
> Try to put in a message that conforms to WS-Security UsernameToken Profile
> 1.1
> [https://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-pr-UsernameTokenProfile-01.htm,]
> which explicitly states:
> {quote}/wsse:UsernameToken/wsse:Password/@Type
> This optional URI attribute specifies the type of password being provided.
> The table below identifies the pre-defined types (note that the URI fragments
> are relative to the URI for this specification).
> {quote}
> if we don't include the Type in the header, Rampart raises a Fault,
> explicitly mentioning
> {quote}R4201 Any PASSWORD MUST specify a Type attribute.
> {quote}
> Which is a requirement from Basic Security Profile Version 1.1
> ([https://www.ws-i.org/profiles/basicsecurityprofile-1.1.html#Password).]
>
> Normally I'd be fine with it, but we've received complaints :(
> Can we have clarification whether this is _intended_ behaviour?
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]