Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4852 - in branches/simple-service-with-base2/src/main/java/org/perfsonar: base2/client base2/client/authn base2/client/authn/edugain base2/client/authn/saslca service/authService/auth/client

Subject: perfsonar development work

List archive

perfsonar: r4852 - in branches/simple-service-with-base2/src/main/java/org/perfsonar: base2/client base2/client/authn base2/client/authn/edugain base2/client/authn/saslca service/authService/auth/client


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4852 - in branches/simple-service-with-base2/src/main/java/org/perfsonar: base2/client base2/client/authn base2/client/authn/edugain base2/client/authn/saslca service/authService/auth/client
  • Date: Wed, 7 Jan 2009 04:44:56 -0500

Author: rodriguez
Date: 2009-01-07 04:44:55 -0500 (Wed, 07 Jan 2009)
New Revision: 4852

Added:

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNDataFactory.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNSAMLData.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNX509Data.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINMetadataService.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
Modified:

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/Axis2Client.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/X509TestClient.java

branches/simple-service-with-base2/src/main/java/org/perfsonar/service/authService/auth/client/AuthNEERequestGenerator.java
Log:
- Adding the client part for the authN/authR

Modified:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/Axis2Client.java
===================================================================
---
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/Axis2Client.java
2009-01-06 15:05:09 UTC (rev 4851)
+++
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/Axis2Client.java
2009-01-07 09:44:55 UTC (rev 4852)
@@ -16,16 +16,16 @@
public class Axis2Client implements Client {

private boolean parseFromConfiguration = false;
-
-
+
+
public boolean isParseFromConfiguration() {
-
+
return parseFromConfiguration;
}

-
+
public void setParseFromConfiguration(boolean parseFromConfiguration) {
-
+
this.parseFromConfiguration = parseFromConfiguration;
}

@@ -41,10 +41,10 @@
} catch (Exception excp) {
throw new PerfSONARException("client","Cannot send message to
["+url+"]: "+excp.getMessage());
}
-
+
}

-
+
public void sendNoResponse(String url, Element e) throws
PerfSONARException {

AXIOMCreator ac = new AXIOMCreator();
@@ -53,13 +53,13 @@
} catch (Exception excp) {
throw new PerfSONARException("client","Cannot send message to
["+url+"]: "+excp.getMessage());
}
-
- }
-
+
+ }
+
public OMElement send(String url, OMElement requestOMElement) throws
AxisFault {

EndpointReference targetEPR = new EndpointReference(url);
-
+
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
@@ -69,9 +69,26 @@

OMElement result = sender.sendReceive(requestOMElement);
return result;
-
+
}

-
-
+ public OMElement send(String url, OMElement headerBlock, OMElement
requestOMElement) throws AxisFault {
+
+ EndpointReference targetEPR = new EndpointReference(url);
+
+ Options options = new Options();
+ options.setTo(targetEPR);
+ options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.addHeader(headerBlock);
+
+ OMElement result = sender.sendReceive(requestOMElement);
+ return result;
+
+ }
+
+
+
}

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java

Modified:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/X509TestClient.java
===================================================================
---
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/X509TestClient.java
2009-01-06 15:05:09 UTC (rev 4851)
+++
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/X509TestClient.java
2009-01-07 09:44:55 UTC (rev 4852)
@@ -3,11 +3,23 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.TimeZone;

+import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.rampart.util.Axis2Util;
+import org.perfsonar.base2.client.authn.AuthNDataFactory;
+import org.perfsonar.base2.client.authn.AuthNX509Data;
import org.perfsonar.base2.xml.AXIOMCreator;
import org.perfsonar.base2.xml.Element;
import org.perfsonar.base2.xml.StaxParser;
+import org.w3c.dom.Document;

public class X509TestClient {

@@ -28,7 +40,7 @@
keyFile = args[3];
certFile = args[4];
} else {
- System.out.println("Error: Wrong number of parameters!!!");
+ System.out.println("Error: Wrong number of parameters
("+args.length+") !!!");
return;
}
System.out.println("End point: " + endPoint);
@@ -36,6 +48,10 @@
System.out.println("Response: " + outFile);
System.out.println("Private key file: " + keyFile);
System.out.println("Certificate file: " + certFile);
+ DateFormat zulu = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ zulu.setTimeZone(TimeZone.getTimeZone("UTC"));
+ Calendar cal=Calendar.getInstance();
+ System.out.println("Date host: "+zulu.format(cal.getTime()));

File file = new File(inFile);
FileInputStream fis = new FileInputStream(file);
@@ -44,8 +60,20 @@
AXIOMCreator cr = new AXIOMCreator();

OMElement requestOMElement = cr.getElement(e);
- OMElement result = new Axis2Client().send(endPoint,
requestOMElement);
+ SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
+ SOAPEnvelope se = soapFactory.createSOAPEnvelope();
+ SOAPBody soapBody = soapFactory.createSOAPBody(se);
+ soapBody.addChild(requestOMElement);

+ Document doc =
Axis2Util.getDocumentFromSOAPEnvelope(se, true);
+
+ AuthNX509Data
authnData=AuthNDataFactory.getDefaultAuthNX509Data();
+ Object reqRaw=authnData.addX509STInMessage(doc, keyFile,
certFile);
+ SOAPEnvelope envelope = (SOAPEnvelope)reqRaw;
+
+ OMElement result = new Axis2Client().send(endPoint,
+ envelope.getHeader().getFirstElement(),
requestOMElement);
+
FileOutputStream fos = new FileOutputStream(new File(outFile));

result.serialize(fos);

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNDataFactory.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNSAMLData.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/AuthNX509Data.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINMetadataService.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClientConfiguration.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserID.java

Added:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java

Modified:
branches/simple-service-with-base2/src/main/java/org/perfsonar/service/authService/auth/client/AuthNEERequestGenerator.java
===================================================================
---
branches/simple-service-with-base2/src/main/java/org/perfsonar/service/authService/auth/client/AuthNEERequestGenerator.java
2009-01-06 15:05:09 UTC (rev 4851)
+++
branches/simple-service-with-base2/src/main/java/org/perfsonar/service/authService/auth/client/AuthNEERequestGenerator.java
2009-01-07 09:44:55 UTC (rev 4852)
@@ -22,7 +22,8 @@
Parameters params = new Parameters();
params.setId(paramsId);
Parameter param = new Parameter();
- param.setParameter(paramKey, WSS_X509);
+ param.setParameter("name", paramKey);
+ param.setText(WSS_X509);
params.addParameter(param);
meta.setParameters(params);

@@ -45,7 +46,8 @@
Parameters params = new Parameters();
params.setId(paramsId);
Parameter param = new Parameter();
- param.setParameter(paramKey, secToken);
+ param.setParameter("name", paramKey);
+ param.setText(secToken);
params.addParameter(param);
meta.setParameters(params);




  • perfsonar: r4852 - in branches/simple-service-with-base2/src/main/java/org/perfsonar: base2/client base2/client/authn base2/client/authn/edugain base2/client/authn/saslca service/authService/auth/client, svnlog, 01/07/2009

Archive powered by MHonArc 2.6.16.

Top of Page