axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r468631 - in /webservices/axis2/branches/java/1_1/modules: rahas/src/org/apache/rahas/ rahas/src/org/apache/rahas/impl/ samples/security/ samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/ security/src/org/apache/rampa...
Date Sat, 28 Oct 2006 05:40:11 GMT
Author: ruchithf
Date: Fri Oct 27 22:40:10 2006
New Revision: 468631

URL: http://svn.apache.org/viewvc?view=rev&rev=468631
Log:
- Fixing typos - Thanks George Stanchev
- Use plain text passwd in UsernameToken by default
- Fixed AXIS2-1535 -  Thanks Ali Sadik Kumlali


Modified:
    webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/RahasConstants.java
    webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/TrustUtil.java
    webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/impl/SAMLTokenIssuer.java
    webservices/axis2/branches/java/1_1/modules/samples/security/README.txt
    webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
    webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/builder/TransportBindingBuilder.java

Modified: webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/RahasConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/RahasConstants.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/RahasConstants.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/RahasConstants.java
Fri Oct 27 22:40:10 2006
@@ -88,16 +88,16 @@
 
     //RST actions
     public static final String RST_ACTION_ISSUE = "/RST" + REQ_TYPE_ISSUE;
-    public static final String RST_ACTOIN_VALIDATE = "/RST" + REQ_TYPE_VALIDATE;
-    public static final String RST_ACTOIN_RENEW = "/RST" + REQ_TYPE_RENEW;
+    public static final String RST_ACTION_VALIDATE = "/RST" + REQ_TYPE_VALIDATE;
+    public static final String RST_ACTION_RENEW = "/RST" + REQ_TYPE_RENEW;
     public static final String RST_ACTION_CANCEL = "/RST" + REQ_TYPE_CANCEL;
     public static final String RST_ACTION_SCT = "/RST/SCT";
     public static final String RST_ACTION_CANCEL_SCT = "/RST/SCT" + REQ_TYPE_CANCEL;
 
     //RSTR actions
-    public static final String RSTR_ACTON_ISSUE = "/RSTR" + REQ_TYPE_ISSUE;
-    public static final String RSTR_ACTON_VALIDATE = "/RSTR" + REQ_TYPE_VALIDATE;
-    public static final String RSTR_ACTON_RENEW = "/RSTR" + REQ_TYPE_RENEW;
+    public static final String RSTR_ACTION_ISSUE = "/RSTR" + REQ_TYPE_ISSUE;
+    public static final String RSTR_ACTION_VALIDATE = "/RSTR" + REQ_TYPE_VALIDATE;
+    public static final String RSTR_ACTION_RENEW = "/RSTR" + REQ_TYPE_RENEW;
     public static final String RSTR_ACTION_CANCEL = "/RSTR" + REQ_TYPE_CANCEL;
     public static final String RSTR_ACTION_SCT = "/RSTR/SCT";
     public static final String RSTR_ACTION_CANCEL_SCT = "/RSTR/SCT" + REQ_TYPE_CANCEL;

Modified: webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/TrustUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/TrustUtil.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/TrustUtil.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/TrustUtil.java
Fri Oct 27 22:40:10 2006
@@ -315,13 +315,13 @@
     public static String getActionValue(int version, String action) throws TrustException
{
         if (RahasConstants.RST_ACTION_ISSUE.equals(action) ||
             RahasConstants.RST_ACTION_CANCEL.equals(action) ||
-            RahasConstants.RST_ACTOIN_RENEW.equals(action) ||
-            RahasConstants.RST_ACTOIN_VALIDATE.equals(action) ||
+            RahasConstants.RST_ACTION_RENEW.equals(action) ||
+            RahasConstants.RST_ACTION_VALIDATE.equals(action) ||
             RahasConstants.RST_ACTION_SCT.equals(action) ||
-            RahasConstants.RSTR_ACTON_ISSUE.equals(action) ||
+            RahasConstants.RSTR_ACTION_ISSUE.equals(action) ||
             RahasConstants.RSTR_ACTION_CANCEL.equals(action) ||
-            RahasConstants.RSTR_ACTON_RENEW.equals(action) ||
-            RahasConstants.RSTR_ACTON_VALIDATE.equals(action) ||
+            RahasConstants.RSTR_ACTION_RENEW.equals(action) ||
+            RahasConstants.RSTR_ACTION_VALIDATE.equals(action) ||
             RahasConstants.RSTR_ACTION_SCT.equals(action)) {
 
             return getWSTNamespace(version) + action;

Modified: webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/impl/SAMLTokenIssuer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/impl/SAMLTokenIssuer.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/impl/SAMLTokenIssuer.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/rahas/src/org/apache/rahas/impl/SAMLTokenIssuer.java
Fri Oct 27 22:40:10 2006
@@ -546,7 +546,7 @@
     *      org.apache.axis2.context.MessageContext)
     */
     public String getResponseAction(RahasData data) throws TrustException {
-        return TrustUtil.getActionValue(data.getVersion(), RahasConstants.RSTR_ACTON_ISSUE);
+        return TrustUtil.getActionValue(data.getVersion(), RahasConstants.RSTR_ACTION_ISSUE);
     }
 
 

Modified: webservices/axis2/branches/java/1_1/modules/samples/security/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/README.txt?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/README.txt (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/README.txt Fri Oct 27 22:40:10
2006
@@ -17,3 +17,7 @@
 2.) Set the AXIS2_HOME envirenment variable
 3.) Run ant from the "samples" directory to copy the required libraries and 
     modules to relevant directories in AXIS2_HOME.
+4.) Download xalan-2.7.0.jar from here[1] and put under AXIS2_HOME\lib folder,
+    if you use JDK 1.5. 
+
+[1] http://www.apache.org/dist/java-repository/xalan/jars/
\ No newline at end of file

Modified: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java
Fri Oct 27 22:40:10 2006
@@ -28,12 +28,14 @@
 
     public void handle(Callback[] callbacks) throws IOException,
             UnsupportedCallbackException {
+
         for (int i = 0; i < callbacks.length; i++) {
             
             //When the server side need to authenticate the user
             WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
             if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
                 if(pwcb.getIdentifer().equals("bob") && pwcb.getPassword().equals("bobPW"))
{
+                    //If authentication successful, simply return
                     return;
                 } else {
                     throw new UnsupportedCallbackException(callbacks[i], "check failed");

Modified: webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/samples/security/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java
Fri Oct 27 22:40:10 2006
@@ -30,48 +30,7 @@
 
 public class SimpleService {
 
-    MessageContext msgCtx;
-
-    public void setOperationContext(OperationContext opContext)  throws AxisFault {
-        this.msgCtx = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-    }
-
     public String echo(String arg) {
-        Vector results = null;
-        if ((results = (Vector) msgCtx
-                .getProperty(WSHandlerConstants.RECV_RESULTS)) == null) {
-            System.out.println("No security results!!");
-            throw new RuntimeException("No security results!!");
-        } else {
-            System.out.println("Number of results: " + results.size());
-            for (int i = 0; i < results.size(); i++) {
-                WSHandlerResult rResult = (WSHandlerResult) results.get(i);
-                Vector wsSecEngineResults = rResult.getResults();
-
-                for (int j = 0; j < wsSecEngineResults.size(); j++) {
-                    WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults.get(j);
-                    if (wser.getAction() == WSConstants.UT
-                            && wser.getPrincipal() != null) {
-                        
-                        //Extract the principal
-                        WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal)wser.getPrincipal();
-                        
-                        //Get user/pass
-                        String user = principal.getName();
-                        String passwd = principal.getPassword();
-                        
-                        //Authenticate
-                        if("bob".equals(user) && "bobPW".equals(passwd)) {
-                            //Authentication suceessful
-                            return arg;
-                        } else {
-                            throw new RuntimeException("Authentication Faliure!!");
-                        }
-                        
-                    }
-                }
-            }
-
             return arg;
         }
 

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/builder/TransportBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/builder/TransportBindingBuilder.java?view=diff&rev=468631&r1=468630&r2=468631
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/builder/TransportBindingBuilder.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/builder/TransportBindingBuilder.java
Fri Oct 27 22:40:10 2006
@@ -30,6 +30,7 @@
 import org.apache.ws.secpolicy.model.Token;
 import org.apache.ws.secpolicy.model.UsernameToken;
 import org.apache.ws.secpolicy.model.X509Token;
+import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSEncryptionPart;
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.conversation.ConversationException;
@@ -76,6 +77,7 @@
                     Token token = (Token) iter.next();
                     if(token instanceof UsernameToken) {
                         WSSecUsernameToken utBuilder = addUsernameToken(rmd);
+                        utBuilder.setPasswordType(WSConstants.PW_TEXT);
                         
                         utBuilder.prepare(rmd.getDocument());
                         



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message