Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2805 - in branches/new-structure/trunk/perfsonar_base: ant src/main/java/org/perfsonar/base/ant src/main/java/org/perfsonar/base/auxiliary src/main/java/org/perfsonar/base/auxiliary/components/authn src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec src/main/java/org/perfsonar/client/base src/main/java/org/perfsonar/client/base/authn src/main/java/org/perfsonar/client/base/authn/edugain src/main/java/org/perfsonar/client/base/authn/edugain/mds src/main/java/org/perfsonar/client/base/authn/saslca src/main/java/org/perfsonar/client/base/requests src/main/java/org/perfsonar/client/base/requests/authService src/main/java/org/perfsonar/service/base/authn src/main/java/org/perfsonar/service/base/authn/tokens src/main/java/org/perfsonar/service/base/engine src/main/java/org/perfsonar/service/base/messages src/main/java/org/perfsonar/service/base/web

Subject: perfsonar development work

List archive

perfsonar: r2805 - in branches/new-structure/trunk/perfsonar_base: ant src/main/java/org/perfsonar/base/ant src/main/java/org/perfsonar/base/auxiliary src/main/java/org/perfsonar/base/auxiliary/components/authn src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec src/main/java/org/perfsonar/client/base src/main/java/org/perfsonar/client/base/authn src/main/java/org/perfsonar/client/base/authn/edugain src/main/java/org/perfsonar/client/base/authn/edugain/mds src/main/java/org/perfsonar/client/base/authn/saslca src/main/java/org/perfsonar/client/base/requests src/main/java/org/perfsonar/client/base/requests/authService src/main/java/org/perfsonar/service/base/authn src/main/java/org/perfsonar/service/base/authn/tokens src/main/java/org/perfsonar/service/base/engine src/main/java/org/perfsonar/service/base/messages src/main/java/org/perfsonar/service/base/web


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2805 - in branches/new-structure/trunk/perfsonar_base: ant src/main/java/org/perfsonar/base/ant src/main/java/org/perfsonar/base/auxiliary src/main/java/org/perfsonar/base/auxiliary/components/authn src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec src/main/java/org/perfsonar/client/base src/main/java/org/perfsonar/client/base/authn src/main/java/org/perfsonar/client/base/authn/edugain src/main/java/org/perfsonar/client/base/authn/edugain/mds src/main/java/org/perfsonar/client/base/authn/saslca src/main/java/org/perfsonar/client/base/requests src/main/java/org/perfsonar/client/base/requests/authService src/main/java/org/perfsonar/service/base/authn src/main/java/org/perfsonar/service/base/authn/tokens src/main/java/org/perfsonar/service/base/engine src/main/java/org/perfsonar/service/base/messages src/main/java/org/perfsonar/service/base/web
  • Date: Tue, 11 Sep 2007 07:32:48 -0400

Author: rodriguez
Date: 2007-09-11 07:32:48 -0400 (Tue, 11 Sep 2007)
New Revision: 2805

Added:

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/AuthNComponent.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/AuthNData.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/AuthNDataFactory.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/WSSAuthNData.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/EduGAINFilterHelper.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/EduGAINMetadataService.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/mds/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/mds/BridgingElement.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClient.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserID.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AuthNEERequestGenerator.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/AuthNEERequest.java
Modified:
branches/new-structure/trunk/perfsonar_base/ant/const.properties

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/ant/antlib.xml

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentNames.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchManager.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchProtocol.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNRequest.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenManager.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecurityToken.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ActionType.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
Log:
Adding the 20070911 version. Changes are:
+ Updating all authn libraries.
+ Updating jar dependencies.
+ Updating the class org.perfsonar.service.base.web.RequestHandler.

Modified: branches/new-structure/trunk/perfsonar_base/ant/const.properties
===================================================================
--- branches/new-structure/trunk/perfsonar_base/ant/const.properties
2007-09-10 10:10:17 UTC (rev 2804)
+++ branches/new-structure/trunk/perfsonar_base/ant/const.properties
2007-09-11 11:32:48 UTC (rev 2805)
@@ -13,4 +13,4 @@
# name of jar file to be created
jarfilename=perfsonar-base
# version of the product (will be included in the final name of jar file)
-version=1.0.20070814
+version=1.0.20070911

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/ant/antlib.xml
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/ant/antlib.xml
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/ant/antlib.xml
2007-09-11 11:32:48 UTC (rev 2805)
@@ -162,23 +162,25 @@
<macrodef name="lib-dependencies"
xmlns:artifact="urn:maven-artifact-ant">
<sequential>
- <artifact:dependencies>
+ <artifact:dependencies>
<dependency groupId="axis" artifactId="axis"
version="1.4"/>
<dependency groupId="axis" artifactId="axis-jaxrpc"
version="1.4"/>
<dependency groupId="axis" artifactId="axis-saaj"
version="1.4"/>
<dependency groupId="axis" artifactId="axis-ant"
version="1.4"/>
- <dependency groupId="xerces" artifactId="xercesImpl"
version="2.6.2"/>
- <dependency groupId="xerces" artifactId="xmlParserAPIs"
version="2.6.2"/>
+ <dependency groupId="xerces" artifactId="xercesImpl"
version="2.8.0"/>
+ <dependency groupId="xerces" artifactId="xerces-xml-apis"
version="2.8.0"/>
<dependency groupId="xml-apis" artifactId="xml-apis"
version="1.3.02"/>
<dependency groupId="jdom" artifactId="jdom"
version="1.0b8"/>
<dependency groupId="urbanophile" artifactId="java-getopt"
version="1.0.9"/>
<dependency groupId="junit" artifactId="junit"
version="4.0"/>
<dependency groupId="xalan" artifactId="xalan"
version="2.7.0"/>
+ <dependency groupId="xalan"
artifactId="xalan-serializer" version="2.7.0"/>
<dependency groupId="commons-pool" artifactId="commons-pool"
version="1.1"/>
<dependency groupId="commons-collections"
artifactId="commons-collections" version="3.2"/>
<dependency groupId="commons-beanutils"
artifactId="commons-beanutils" version="1.7.0"/>
<dependency groupId="commons-digester"
artifactId="commons-digester" version="1.7"/>
<dependency groupId="commons-logging" artifactId="commons-logging"
version="1.0.4"/>
+ <dependency groupId="commons-lang" artifactId="commons-lang"
version="2.3"/>

<dependency groupId="javax.activation" artifactId="activation"
version="1.0.2"/>
<dependency groupId="javax.mail" artifactId="mail"
version="1.3.2"/>
@@ -197,6 +199,13 @@
<dependency groupId="xml-security" artifactId="xmlsec"
version="1.3.0"/>
<dependency groupId="bouncycastle" artifactId="bcprov-jdk15"
version="124"/>
<dependency groupId="wss4j" artifactId="wss4j"
version="1.5.1"/>
+ <dependency groupId="javolution"
artifactId="javolution" version="3.7"/>
+ <dependency groupId="opensaml" artifactId="opensaml"
version="2.0-TP2-jdk-1.5"/>
+ <dependency groupId="xmltooling"
artifactId="xmltooling" version="1.0-TP2-jdk-1.5"/>
+ <dependency groupId="opensaml"
artifactId="opensaml1" version="1.1"/>
+ <dependency groupId="edugain" artifactId="edugain"
version="0.5"/>
+ <dependency groupId="sasl-ca" artifactId="sasl-ca"
version="1.0"/>
+ <dependency groupId="codec"
artifactId="codec" version="1.0"/>

<dependency groupId="joda-time" artifactId="joda-time"
version="1.4"/>

@@ -661,14 +670,15 @@
<copy
file="${basedir}/lib/repository/axis/axis-saaj/1.4/axis-saaj-1.4.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/axis/axis-wsdl4j/1.5.1/axis-wsdl4j-1.5.1.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>

- <copy
file="${basedir}/lib/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/xerces/xercesImpl/2.8.0/xercesImpl-2.8.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/xerces/xerces-xml-apis/2.8.0/xerces-xml-apis-2.8.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/xml-apis/xml-apis/1.3.02/xml-apis-1.3.02.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy file="${basedir}/lib/repository/jdom/jdom/1.0b8/jdom-1.0b8.jar"

todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/xalan/xalan-serializer/2.7.0/xalan-serializer-2.7.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/commons-pool/commons-pool/1.1/commons-pool-1.1.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
@@ -676,6 +686,7 @@
<copy
file="${basedir}/lib/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/commons-discovery/commons-discovery/0.2/commons-discovery-0.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/javax/activation/activation/1.0.2/activation-1.0.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/javax/mail/mail/1.3.2/mail-1.3.2.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
@@ -690,6 +701,13 @@
<copy
file="${basedir}/lib/repository/xml-security/xmlsec/1.3.0/xmlsec-1.3.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/bouncycastle/bcprov-jdk15/124/bcprov-jdk15-124.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
<copy
file="${basedir}/lib/repository/wss4j/wss4j/1.5.1/wss4j-1.5.1.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/javolution/javolution/3.7/javolution-3.7.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/opensaml/opensaml/2.0-TP2-jdk-1.5/opensaml-2.0-TP2-jdk-1.5.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/xmltooling/xmltooling/1.0-TP2-jdk-1.5/xmltooling-1.0-TP2-jdk-1.5.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/opensaml/opensaml1/1.1/opensaml1-1.1.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/edugain/edugain/0.5/edugain-0.5.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/sasl-ca/sasl-ca/1.0/sasl-ca-1.0.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>
+ <copy file="${basedir}/lib/repository/codec/codec/1.0/codec-1.0.jar"

todir="@{dest-jars-path}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/joda-time/joda-time/1.4/joda-time-1.4.jar"
todir="@{dest-jars-path}/WEB-INF/lib"/>


Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentNames.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentNames.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentNames.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -16,5 +16,7 @@

public static final String REGISTRATOR = "registrator";

+ public static final String AUTHN = "authn";

+
} //ComponentNames

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/AuthNComponent.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/AuthNData.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/AuthNDataFactory.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/WSSAuthNData.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/EduGAINFilterHelper.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/EduGAINMetadataService.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/edugain/mds/BridgingElement.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClient.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserID.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AuthNEERequestGenerator.java

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchManager.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchManager.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchManager.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -1,5 +1,7 @@
package org.perfsonar.service.base.authn;

+import org.perfsonar.base.exceptions.PerfSONARException;
+
public class AADispatchManager {
AADispatchProtocol protocol;

@@ -7,7 +9,7 @@
this.protocol=prot;
}

- public AuthNResponse getAuthentication(AuthNRequest req) {
+ public AuthNResponse getAuthentication(AuthNRequest req) throws
PerfSONARException {
return protocol.getAuthentication(req);
}
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchProtocol.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchProtocol.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchProtocol.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -1,5 +1,7 @@
package org.perfsonar.service.base.authn;

+import org.perfsonar.base.exceptions.PerfSONARException;
+
public interface AADispatchProtocol {
- public AuthNResponse getAuthentication(AuthNRequest req);
+ public AuthNResponse getAuthentication(AuthNRequest req) throws
PerfSONARException;
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -1,28 +1,52 @@
package org.perfsonar.service.base.authn;

+import java.io.FileNotFoundException;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.soap.SOAPHeaderElement;
+
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.axis.message.SOAPBodyElement;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axis.utils.XMLUtils;
+import org.ggf.ns.nmwg.base.v2_0.Message;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
+import
org.perfsonar.client.base.requests.authService.AuthNEERequestGenerator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;

public class AADispatchSOAPProtocol implements AADispatchProtocol {
- private final String AUTHN_DECISION = "service.authn.response";
+ public static final String
WSS_X509="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3";;
+ public static final String
WSS_SAML="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1";;
+ private final String AS_POINT_PARAM = "service.as.point";
+ private final String SAX_PARSER_CONFIG = "service.sax_parser.config";
private LoggerComponent logger;
private ConfigurationComponent config;
- private boolean isAuthorized=false;
+ private String asPoint;
+ private String saxParser;

public AADispatchSOAPProtocol() throws PerfSONARException {
try {
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
- .getComponent(ComponentNames.LOGGER);
+ .getComponent(ComponentNames.LOGGER);
} catch (PerfSONARException e) {
String m = "AADispatchSOAPProtocol: Can't obtain
Logger component ";
throw new PerfSONARException(m);
}
try {
config = (ConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ .getInstance().getComponent(ComponentNames.CONFIG);
} catch (PerfSONARException e) {

String m = "AADispatchSOAPProtocol: Can't obtain
Config component ";
@@ -30,20 +54,111 @@
throw new PerfSONARException(m);
}
try {
- Boolean
b=Boolean.valueOf(config.getProperty(AUTHN_DECISION));
- isAuthorized=b.booleanValue();
+ asPoint=config.getProperty(AS_POINT_PARAM);
+ saxParser=config.getProperty(SAX_PARSER_CONFIG);
} catch (Exception e) {
- isAuthorized=false;
+ String m = "AADispatchSOAPProtocol: Can't obtain
required parameters ";
+ logger.error(m);
+ throw new PerfSONARException(m);
}
}

- public AuthNResponse getAuthentication(AuthNRequest req) {
- // TODO Make a real response
+ public AADispatchSOAPProtocol(String asPoint, String saxParser)
throws PerfSONARException {
+ try {
+ logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
+ .getComponent(ComponentNames.LOGGER);
+ } catch (PerfSONARException e) {
+ String m = "AADispatchSOAPProtocol: Can't obtain
Logger component ";
+ throw new PerfSONARException(m);
+ }
+ this.asPoint=asPoint;
+ this.saxParser=saxParser;
+ }
+
+ public AuthNResponse getAuthentication(AuthNRequest req) throws
PerfSONARException {
AuthNResponse resp=new AuthNResponse();
- if (!isAuthorized)
- resp.setStatus(AuthNResponse.NOT_AUTHORIZED);
- else
- resp.setStatus(AuthNResponse.AUTHORIZED);
+ // prepare to call - set service elements
+ try {
+ Service service = new Service();
+ Call call = (Call)service.createCall();
+ call.setTargetEndpointAddress(new URL(asPoint));
+ call.setOperationName(new
QName("http://soapinterop.org/","submit";));
+
+ // read the request into a org.w3c.DOM.Document
+ DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+
+ DocumentBuilder builder =
factory.newDocumentBuilder();
+ Document request = builder.newDocument();
+ Message authnRequest = new
AuthNEERequestGenerator().generateRequestMessage();
+ request = authnRequest.getDOM(request);
+
+ // get the parameter which specifies the format of
the security token
+ Element parameter=null;
+ NodeList nodelist =
org.apache.xpath.XPathAPI.selectNodeList(request,
"//nmwg:parameter[@name='SecurityToken']");
+ if (nodelist.getLength()>0) {
+ parameter=(Element)nodelist.item(0);
+ }
+
+ // build a SOAPBodyElement from the document
+ SOAPBodyElement requestMessage =
+ new
SOAPBodyElement(request.getDocumentElement());
+ SOAPEnvelope envelope = new SOAPEnvelope();
+ envelope.addBodyElement(requestMessage);
+ javax.xml.soap.SOAPHeader
header=(javax.xml.soap.SOAPHeader)req.getSecurityToken().getSecToken();
+ Iterator it=header.examineAllHeaderElements();
+ while (it.hasNext()) {
+ SOAPHeaderElement
he=(SOAPHeaderElement)it.next();
+
+ // if there is any assertion, it should be a
saml security token
+ NodeList nodelist2 =
org.apache.xpath.XPathAPI.selectNodeList(he, "//Assertion");
+ if (parameter!=null&&nodelist2.getLength()>0) {
+
parameter.setTextContent(AADispatchSOAPProtocol.WSS_SAML);
+ }
+
+ envelope.getHeader().addChildElement(he);
+ }
+
+ StringWriter sw=new StringWriter();
+
XMLUtils.PrettyElementToWriter(requestMessage.getAsDOM(),sw);
+
+ // call on the end point
+ Object resultObject = call.invoke(envelope);
+
+ SOAPEnvelope envelopeResult;
+ SOAPBodyElement resultSBE;
+ Document result = null;
+
+ envelopeResult= (SOAPEnvelope)resultObject;
+ resultSBE= envelopeResult.getFirstBody();
+
+ // change it to document - here is where validity
+ // can be checked..
+ result = resultSBE.getAsDocument();
+
+ Message responseNmwg =
org.perfsonar.base.util.XMLUtils.convertToMessage(
+ result, saxParser);
+
+ resp=AuthNResponse.getAuthNResponse(responseNmwg);
+ logger.debug("Authentication response:
("+resp.getResultCode()+","+resp.getStatus()+")");
+
+ } catch (ClassCastException e) {
+ e.printStackTrace();
+ String m = "AADispatchSOAPProtocol.getAuthentication:
We didn't get a Vector of SOAPBodyElements!";
+ System.out.println(m);
+ throw new PerfSONARException("error.as.body",m);
+ } catch (FileNotFoundException e2) {
+ e2.printStackTrace();
+ String m = "AADispatchSOAPProtocol.getAuthentication:
Authentication request file not found";
+ System.out.println(m);
+ throw new PerfSONARException("error.as.query",m);
+ } catch (Exception e) {
+ e.printStackTrace();
+ String m="AADispatchSOAPProtocol.getAuthentication:
General exception while retrieving report";
+ System.out.println(m);
+ throw new PerfSONARException("error.as.query",m);
+ }
+
return resp;
}


Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNRequest.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNRequest.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNRequest.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -4,12 +4,13 @@

public class AuthNRequest {
private SecurityToken st;
-
+
public AuthNRequest() {
st=null;
}
-
+
public AuthNRequest(SecurityToken st) {
+ this();
this.st=st;
}

@@ -20,4 +21,5 @@
public void setSecurityToken(SecurityToken st) {
this.st = st;
}
+
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -1,12 +1,19 @@
package org.perfsonar.service.base.authn;

+import org.ggf.ns.nmwg.base.v2_0.EventType;
+import org.ggf.ns.nmwg.base.v2_0.Message;
+import org.ggf.ns.nmwg.base.v2_0.Metadata;
+
public class AuthNResponse {
- public static final int AUTHORIZED=0;
- public static final int NOT_AUTHORIZED=1;
+ public static final int AUTHENTICATED=0;
+ public static final int NOT_AUTHENTICATED=1;

private int status;
+ private String resultCode;
+
public AuthNResponse() {
- status=AuthNResponse.NOT_AUTHORIZED;
+ status=AuthNResponse.NOT_AUTHENTICATED;
+ resultCode="";
}

public int getStatus() {
@@ -17,4 +24,29 @@
this.status = status;
}

+ public String getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(String codeResult) {
+ this.resultCode = codeResult;
+ }
+
+ public static AuthNResponse getAuthNResponse(Message message) {
+ AuthNResponse res=new AuthNResponse();
+
+ Metadata[] metadatas=message.getMetadataArray();
+ for (int i=0; i<metadatas.length; i++) {
+ EventType et=metadatas[i].getEventType();
+ res.setResultCode(et.getEventType());
+ if (et.getEventType().equals("success.as.authn")) {
+ res.setStatus(AuthNResponse.AUTHENTICATED);
+ }
+ else {
+
res.setStatus(AuthNResponse.NOT_AUTHENTICATED);
+ }
+ }
+
+ return res;
+ }
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenManager.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenManager.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenManager.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -5,4 +5,5 @@
public interface SecTokenManager {
public boolean hasSTInRequest() throws PerfSONARException;
public Object getSTFromRequest() throws PerfSONARException;
+ public Object getSTValue() throws PerfSONARException;
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -1,13 +1,29 @@
package org.perfsonar.service.base.authn.tokens;

+import java.io.ByteArrayInputStream;
+import java.security.cert.X509Certificate;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
import javax.xml.soap.SOAPException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;

+import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPHeader;
+import org.apache.ws.security.WSSecurityEngine;
+import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.util.Base64;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import org.perfsonar.base.auxiliary.components.authn.DynamicCrypto;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class SecTokenSOAPManager implements SecTokenManager {
@@ -20,7 +36,7 @@

if (logger == null) {
String m = "SecTokenSOAPManager: can't obtain Logger
object";
- throw new
PerfSONARException("error.authn.dependency", m);
+ throw new
PerfSONARException("error.common.no_logger", m);
}
}

@@ -29,13 +45,13 @@
return null;
MessageContext mc=MessageContext.getCurrentContext();
try {
- SOAPHeader
sh=(SOAPHeader)mc.getCurrentMessage().getSOAPHeader();
- NodeList
nl=sh.getElementsByTagNameNS(WSSECHEADER_NS,WSSECHEADER);
- return nl.item(0);
+ Message m=mc.getCurrentMessage();
+ SOAPHeader sh=(SOAPHeader)m.getSOAPHeader();
+ return sh;
} catch (SOAPException e) {
- String m = "Error checking the WS-SEC header";
+ String m = "Error getting the SOAP header";
logger.error(m);
- throw new PerfSONARException("error.authn.checking", m);
+ throw new PerfSONARException("error.authn.soap", m);
}
}

@@ -48,8 +64,59 @@
} catch (SOAPException e) {
String m = "Error checking the WS-SEC header";
logger.error(m);
- throw new PerfSONARException("error.authn.checking", m);
+ throw new PerfSONARException("error.authn.soap", m);
}
}

+ public Object getSTValue() throws PerfSONARException {
+ if (!hasSTInRequest())
+ return null;
+ SOAPHeader sh=(SOAPHeader)getSTFromRequest();
+
+ try {
+ Document doc=sh.getAsDocument();
+ Crypto crypto = new DynamicCrypto();
+ WSSecurityEngine secEngine = new WSSecurityEngine();
+ // If there is any problem validating the SOAP header, it
throws an exception
+ secEngine.processSecurityHeader(doc, null, null, crypto);
+
+ XPathFactory factory = XPathFactory.newInstance();
+ XPath xpath = factory.newXPath();
+ xpath.setNamespaceContext(new WSSENamespaceContext());
+ XPathExpression expr =
xpath.compile("//wsse:BinarySecurityToken");
+ Object result = expr.evaluate(doc, XPathConstants.NODESET);
+ NodeList nodes = (NodeList) result;
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Element e=(Element)nodes.item(i);
+ if
(e.getAttribute("ValueType").equals("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3";))
{
+ byte[] bytes=Base64.decode(e.getTextContent());
+ ByteArrayInputStream bais=new
ByteArrayInputStream(bytes);
+ X509Certificate cert=crypto.loadCertificate(bais);
+ return cert;
+ }
+ }
+ } catch (Throwable t) {
+ String m = "SecTokenSOAPManager: "+t.getMessage();
+ logger.info(m);
+ throw new
PerfSONARException("error.authn.getting_sec_token",m);
+ }
+ return null;
+ }
+
+ class WSSENamespaceContext implements NamespaceContext {
+
+ public String getNamespaceURI(String prefix) {
+ return
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";;
+ }
+
+ // This method isn't necessary for XPath processing either.
+ public String getPrefix(String uri) {
+ throw new UnsupportedOperationException();
+ }
+
+ // This method isn't necessary for XPath processing either.
+ public Iterator<?> getPrefixes(String uri) {
+ throw new UnsupportedOperationException();
+ }
+ }
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecurityToken.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecurityToken.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecurityToken.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -5,10 +5,12 @@
public class SecurityToken {
private SecTokenManager tm;
private Object secToken;
+ private Object secTokenValue;

public SecurityToken(SecTokenManager tm) {
this.tm=tm;
this.secToken=null;
+ this.secTokenValue=null;
}

public Object getSecToken() {
@@ -21,9 +23,18 @@

public void setSecTokenFromRequest() throws PerfSONARException {
setSecToken(tm.getSTFromRequest());
+ setSecTokenValue(tm.getSTValue());
}

public boolean hasSecTokenInRequest() throws PerfSONARException {
return tm.hasSTInRequest();
}
+
+ public Object getSecTokenValue() {
+ return secTokenValue;
+ }
+
+ public void setSecTokenValue(Object secTokenValue) {
+ this.secTokenValue = secTokenValue;
+ }
}

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ActionType.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ActionType.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ActionType.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -115,6 +115,15 @@
* Action type to request a full topology database download
*/
public static final String SETUP_DATA_DB = "SETUP_DATA_DB";
+
+ // ------------------------------------------ Authentication Service
Actions

+ /**
+ * Action type to request the authentication of the client/user
+ */

+ public static final String AUTHN_EE_REQUEST = "AuthNEERequest";
+
+
+
} //ActionType

Added:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/AuthNEERequest.java

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
2007-09-10 10:10:17 UTC (rev 2804)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
2007-09-11 11:32:48 UTC (rev 2805)
@@ -13,6 +13,7 @@
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import org.perfsonar.base.auxiliary.components.authn.AuthNComponent;
import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
@@ -40,6 +41,7 @@
private AuxiliaryComponentManager componentManager;
private ConfigurationComponent configuration;
private LoggerComponent logger;
+ private AuthNComponent authnComponent;
private String saxParserConfig;
private boolean initialised;
private volatile Object initialisationMutex = new Object();
@@ -159,6 +161,28 @@
);
}

+ // Check if it's needed authentication for this type of message
+ String checkAuthNParam=null;
+ try {
+
checkAuthNParam=configuration.getProperty(AuthNComponent.CHECK_AUTHN_PARAM);
+ } catch (PerfSONARException e) {
+ checkAuthNParam=null;
+ }
+ if
(checkAuthNParam!=null&&checkAuthNParam.equals(AuthNComponent.YES_CHECK_AUTHN))
{
+ logger.debug(
+ "RequestHandler: " +
+ "Authenticating the message");
+ if (authnComponent == null) throw new
PerfSONARException(
+ "error.common.no_authn",
+ "Cannot find authn component");
+ authnComponent.requestAuthN(requestMessage.getType());
+ }
+ else {
+ logger.debug(
+ "RequestHandler: " +
+ "Automated authentication not
required");
+ }
+
// Call on the MessageHandlerFactory to get the appropriate
// message handler for this type of message.
MessageHandler messageHandler =
MessageHandlerFactory.getMessageHandler(requestMessage.getType());



  • perfsonar: r2805 - in branches/new-structure/trunk/perfsonar_base: ant src/main/java/org/perfsonar/base/ant src/main/java/org/perfsonar/base/auxiliary src/main/java/org/perfsonar/base/auxiliary/components/authn src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec src/main/java/org/perfsonar/client/base src/main/java/org/perfsonar/client/base/authn src/main/java/org/perfsonar/client/base/authn/edugain src/main/java/org/perfsonar/client/base/authn/edugain/mds src/main/java/org/perfsonar/client/base/authn/saslca src/main/java/org/perfsonar/client/base/requests src/main/java/org/perfsonar/client/base/requests/authService src/main/java/org/perfsonar/service/base/authn src/main/java/org/perfsonar/service/base/authn/tokens src/main/java/org/perfsonar/service/base/engine src/main/java/org/perfsonar/service/base/messages src/main/java/org/perfsonar/service/base/web, svnlog, 09/11/2007

Archive powered by MHonArc 2.6.16.

Top of Page