cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Pell (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (CXF-4776) UsernameTokenPolicyValidator does not validate that password is not provided.
Date Thu, 24 Jan 2013 01:48:11 GMT

     [ https://issues.apache.org/jira/browse/CXF-4776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Pell updated CXF-4776:
----------------------------

    Comment: was deleted

(was: My suggested patch is an inverse of the NoPassword check validation.

Index: src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/UsernameTokenPolicyValidator.java
===================================================================
--- src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/UsernameTokenPolicyValidator.java
(revision 1437320)
+++ src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/UsernameTokenPolicyValidator.java
(working copy)
@@ -98,6 +98,10 @@
                 ai.setNotAsserted("Username Token NoPassword policy not enforced");
                 return false;
             }
+            if (!usernameTokenPolicy.isNoPassword() && usernameToken.getPassword()
== null) {
+                ai.setNotAsserted("Password policy not enforced");
+                return false;
+            }
             if (usernameTokenPolicy.isRequireCreated() 
                 && (usernameToken.getCreated() == null || usernameToken.isHashed()))
{
                 ai.setNotAsserted("Username Token Created policy not enforced");
)
    
> UsernameTokenPolicyValidator does not validate that password is not provided.
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4776
>                 URL: https://issues.apache.org/jira/browse/CXF-4776
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.7.2
>            Reporter: Jason Pell
>            Assignee: Jason Pell
>         Attachments: patch.txt, UsernamePasswordPolicy.xml
>
>
> See my attached WS-Policy which I attached via @Policies annotation to Placement.BINDING_OPERATION_INPUT.
> If I include an incorrect Password I get the expected authentication error.  If I actually
remove the password I get no authentication failure.  The UsernameTokenPolicyValidator only
checks that the username is provided.
> I have a simple patch for this but would appreciate some weigh in from ws-policy cxf
devs please.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message