Author: darran.lofthouse(a)jboss.com
Date: 2010-06-16 08:40:22 -0400 (Wed, 16 Jun 2010)
New Revision: 12485
Modified:
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/Username.java
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/resources/schema/jboss-ws-security_1_0.xsd
Log:
Add digest configuration.
Modified:
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/Username.java
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2010-06-16
11:30:08 UTC (rev 12484)
+++
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2010-06-16
12:40:22 UTC (rev 12485)
@@ -27,4 +27,32 @@
public class Username implements Serializable
{
private static final long serialVersionUID = 8273360977250180943L;
+
+ private boolean digestPassword;
+
+ private boolean useNonce;
+
+ private boolean useCreated;
+
+ public Username(boolean digestPassword, boolean useNonce, boolean useCreated)
+ {
+ this.digestPassword = digestPassword;
+ this.useNonce = useNonce;
+ this.useCreated = useCreated;
+ }
+
+ public boolean isDigestPassword()
+ {
+ return digestPassword;
+ }
+
+ public boolean isUseNonce()
+ {
+ return useNonce;
+ }
+
+ public boolean isUseCreated()
+ {
+ return useCreated;
+ }
}
Modified:
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2010-06-16
11:30:08 UTC (rev 12484)
+++
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2010-06-16
12:40:22 UTC (rev 12485)
@@ -282,7 +282,25 @@
}
else if ("username".equals(localName))
{
- return new Username();
+ //By default, we do not use password digest
+ Boolean digestPassword = new Boolean(false);
+ String digestPasswordAttr = attrs.getValue("",
"digestPassword");
+ if (digestPasswordAttr != null)
+ digestPassword =
(Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME,
digestPasswordAttr, null);
+
+ //if password digest is enabled, we use nonces by default
+ Boolean useNonce = new Boolean(true);
+ String useNonceAttr = attrs.getValue("", "useNonce");
+ if (useNonceAttr != null)
+ useNonce =
(Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, useNonceAttr,
null);
+
+ //if password digest is enabled, we use the created element by default
+ Boolean useCreated = new Boolean(true);
+ String useCreatedAttr = attrs.getValue("", "useCreated");
+ if (useCreatedAttr != null)
+ useCreated =
(Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, useCreatedAttr,
null);
+
+ return new Username(digestPassword, useNonce, useCreated);
}
else if ("authenticate".equals(localName))
{
Modified:
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/resources/schema/jboss-ws-security_1_0.xsd
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/resources/schema/jboss-ws-security_1_0.xsd 2010-06-16
11:30:08 UTC (rev 12484)
+++
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/resources/schema/jboss-ws-security_1_0.xsd 2010-06-16
12:40:22 UTC (rev 12485)
@@ -187,7 +187,21 @@
</xs:attribute>
</xs:complexType>
<xs:complexType name="usernameType">
- <xs:sequence/>
+ <xs:attribute name="digestPassword" type="xs:boolean"
use="optional">
+ <xs:annotation>
+ <xs:documentation>If true a password digest will be used as password
element. The default is false.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="useNonce" type="xs:boolean"
use="optional">
+ <xs:annotation>
+ <xs:documentation>Enables/disables nonce usage in the password digest. The
default is true.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="useCreated" type="xs:boolean"
use="optional">
+ <xs:annotation>
+ <xs:documentation>Enables/disables usage of the Created element in the
password digest. The default is true.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
</xs:complexType>
<xs:complexType name="encryptType">
<xs:sequence>
Show replies by date