Picketlink SVN: r662 - in federation/trunk: picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 21:55:46 -0500 (Wed, 26 Jan 2011)
New Revision: 662
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java
Log:
remove commented out code
Modified: federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java
===================================================================
--- federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java 2011-01-27 02:54:48 UTC (rev 661)
+++ federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/response/SAML2Response.java 2011-01-27 02:55:46 UTC (rev 662)
@@ -82,7 +82,7 @@
public class SAML2Response
{
private SAMLDocumentHolder samlDocumentHolder = null;
-
+
/**
* Create an assertion
* @param id
@@ -93,7 +93,7 @@
{
return AssertionUtil.createAssertion(id, issuer);
}
-
+
/**
* Create an AuthnStatement
* @param authnContextDeclRef such as JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT
@@ -110,7 +110,7 @@
authnStatement.setAuthnContext(act);
return authnStatement;
}
-
+
/**
* Create an Authorization Decision Statement Type
* @param resource
@@ -129,15 +129,15 @@
authzDecST.setDecision(decision);
if(evidence != null)
authzDecST.setEvidence(evidence);
-
+
if(actions != null)
{
authzDecST.getAction().addAll(Arrays.asList(actions));
}
-
+
return authzDecST;
}
-
+
/**
* Create a ResponseType
* @param ID id of the response
@@ -151,43 +151,43 @@
public ResponseType createResponseType(String ID, SPInfoHolder sp, IDPInfoHolder idp, IssuerInfoHolder issuerInfo)
throws ConfigurationException, ProcessingException
{
- String responseDestinationURI = sp.getResponseDestinationURI();
-
+ String responseDestinationURI = sp.getResponseDestinationURI();
+
XMLGregorianCalendar issueInstant = XMLTimeUtil.getIssueInstant();
-
+
//Create an assertion
//String id = IDGenerator.create( "ID_" );
-
+
//Create assertion -> subject
SubjectType subjectType = new SubjectType();
-
+
//subject -> nameid
NameIDType nameIDType = new NameIDType();
nameIDType.setFormat( URI.create( idp.getNameIDFormat() ));
nameIDType.setValue(idp.getNameIDFormatValue());
-
+
SubjectType.STSubType subType = new SubjectType.STSubType();
subType.addBaseID(nameIDType);
subjectType.setSubType(subType);
-
+
SubjectConfirmationType subjectConfirmation = new SubjectConfirmationType();
subjectConfirmation.setMethod( idp.getSubjectConfirmationMethod());
-
+
SubjectConfirmationDataType subjectConfirmationData = new SubjectConfirmationDataType();
subjectConfirmationData.setInResponseTo( sp.getRequestID() );
subjectConfirmationData.setRecipient( responseDestinationURI );
subjectConfirmationData.setNotBefore(issueInstant);
subjectConfirmationData.setNotOnOrAfter(issueInstant);
-
+
subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
subjectType.addConfirmation(subjectConfirmation);
-
+
PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
SAMLProtocolContext samlProtocolContext = new SAMLProtocolContext();
samlProtocolContext.setSubjectType( subjectType );
samlProtocolContext.setIssuerID(nameIDType);
-
+
AssertionType assertionType = idp.getAssertion();
if( assertionType != null )
{
@@ -197,22 +197,19 @@
}
else
sts.issueToken( samlProtocolContext );
-
+
assertionType = samlProtocolContext.getIssuedAssertion();
-
- /*AssertionType assertionType = SAMLAssertionFactory.createAssertion(id,
- nameIDType , issueInstant, (ConditionsType) null, subjectType, (List<StatementAbstractType>)null );
- */
-
+
+
ResponseType responseType = createResponseType(ID, issuerInfo, assertionType);
//InResponseTo ID
responseType.setInResponseTo(sp.getRequestID());
//Destination
responseType.setDestination(responseDestinationURI);
-
+
return responseType;
}
-
+
/**
* Create an empty response type
* @return
@@ -221,7 +218,7 @@
{
return JBossSAMLAuthnResponseFactory.createResponseType();
}
-
+
/**
* Create a ResponseType
* @param ID
@@ -235,7 +232,7 @@
{
return JBossSAMLAuthnResponseFactory.createResponseType(ID, issuerInfo, assertion);
}
-
+
/**
* Add validity conditions to the SAML2 Assertion
* @param assertion
@@ -248,7 +245,7 @@
{
AssertionUtil.createTimedConditions(assertion, durationInMilis);
}
-
+
/**
* Get an encrypted assertion from the stream
* @param is
@@ -259,15 +256,12 @@
{
if(is == null)
throw new IllegalArgumentException( "inputstream is null" );
-
+
SAMLParser samlParser = new SAMLParser();
return ( EncryptedAssertionType ) samlParser.parse(is);
-
- /*Unmarshaller un = JBossSAMLAuthnResponseFactory.getUnmarshaller();
- JAXBElement<EncryptedElementType> jaxb = (JAXBElement<EncryptedElementType>) un.unmarshal(is);
- return jaxb.getValue(); */
+
}
-
+
/**
* Read an assertion from an input stream
* @param is
@@ -278,15 +272,11 @@
{
if(is == null)
throw new IllegalArgumentException( "inputstream is null" );
-
+
SAMLParser samlParser = new SAMLParser();
return (AssertionType) samlParser.parse(is);
-
- /*Unmarshaller un = JBossSAMLAuthnResponseFactory.getUnmarshaller();
- JAXBElement<AssertionType> jaxb = (JAXBElement<AssertionType>) un.unmarshal(is);
- return jaxb.getValue(); */
}
-
+
/**
* Get the parsed {@code SAMLDocumentHolder}
* @return
@@ -295,7 +285,7 @@
{
return samlDocumentHolder;
}
-
+
/**
* Read a ResponseType from an input stream
* @param is
@@ -314,15 +304,11 @@
SAMLParser samlParser = new SAMLParser();
ResponseType responseType = (ResponseType) samlParser.parse( DocumentUtil.getNodeAsStream( samlResponseDocument ));
-
- /*Binder<Node> binder = getBinder();
- JAXBElement<ResponseType> jaxbResponseType = (JAXBElement<ResponseType>) binder.unmarshal(samlResponseDocument);
- ResponseType responseType = jaxbResponseType.getValue();*/
samlDocumentHolder = new SAMLDocumentHolder(responseType, samlResponseDocument);
return responseType;
}
-
-
+
+
/**
* Read a {@code SAML2Object} from an input stream
* @param is
@@ -335,30 +321,19 @@
{
if(is == null)
throw new IllegalArgumentException("inputstream is null");
-
+
Document samlResponseDocument = DocumentUtil.getDocument(is);
-
+
System.out.println( "RESPONSE=" + DocumentUtil.asString(samlResponseDocument));
- /*
- try
- {
- Binder<Node> binder = getBinder();
- JAXBElement<SAML2Object> saml2Object = (JAXBElement<SAML2Object>) binder.unmarshal(samlResponseDocument);
- SAML2Object responseType = saml2Object.getValue();
- */
- SAMLParser samlParser = new SAMLParser();
- SAML2Object responseType = (SAML2Object) samlParser.parse( DocumentUtil.getNodeAsStream( samlResponseDocument ));
-
- samlDocumentHolder = new SAMLDocumentHolder(responseType, samlResponseDocument);
- return responseType;
- /*
- }
- catch (JAXBException e)
- {
- throw new ParsingException(e);
- } */
+
+ SAMLParser samlParser = new SAMLParser();
+ SAML2Object responseType = (SAML2Object) samlParser.parse( DocumentUtil.getNodeAsStream( samlResponseDocument ));
+
+ samlDocumentHolder = new SAMLDocumentHolder(responseType, samlResponseDocument);
+ return responseType;
+
}
-
+
/**
* Convert an EncryptedElement into a Document
* @param encryptedElementType
@@ -368,19 +343,15 @@
public Document convert(EncryptedElementType encryptedElementType)
throws ConfigurationException
{
- /*JAXBContext jaxb = JAXBUtil.getJAXBContext(EncryptedElementType.class);
- Binder<Node> binder = jaxb.createBinder();
- */
if( encryptedElementType == null )
throw new IllegalArgumentException( "encryptedElementType is null ");
Document doc = DocumentUtil.createDocument();
Node importedNode = doc.importNode( encryptedElementType.getEncryptedElement(), true );
doc.appendChild(importedNode);
-
- //binder.marshal(JAXBElementMappingUtil.get(encryptedElementType), doc);
+
return doc;
}
-
+
/**
* Convert a SAML2 Response into a Document
* @param responseType
@@ -389,16 +360,13 @@
* @throws ConfigurationException
* @throws JAXBException
* @throws ParserConfigurationException
- *//*
- public Document convert(StatusResponseType responseType) throws JAXBException, ConfigurationException*/
-
-
+ */
public Document convert( StatusResponseType responseType) throws ProcessingException, ConfigurationException, ParsingException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(bos));
-
+
if( responseType instanceof ResponseType )
{
ResponseType response = (ResponseType) responseType;
@@ -408,45 +376,23 @@
{
writer.write(responseType, new QName( PROTOCOL_NSURI.get(), LOGOUT_RESPONSE.get(), "samlp"));
}
-
- //System.out.println( new String( bos.toByteArray() ) );
- return DocumentUtil.getDocument( new ByteArrayInputStream( bos.toByteArray() ));
-
- /*JAXBContext jaxb = JAXBUtil.getJAXBContext(StatusResponseType.class);
- *
- Binder<Node> binder = jaxb.createBinder();
- Document responseDocument = DocumentUtil.createDocument();
- binder.marshal(JAXBElementMappingUtil.get(responseType), responseDocument);
- return responseDocument; */
+ //System.out.println( new String( bos.toByteArray() ) );
+ return DocumentUtil.getDocument( new ByteArrayInputStream( bos.toByteArray() ));
}
-
+
/**
- * Marshall the response type to the output stream
- * <p> <b>Note:</b> JAXB marshaller by default picks up arbitrary namespace
- * prefixes (ns2,ns3 etc). The NamespacePrefixMapper is a Sun RI customization
- * that may be needed (this is a TODO) to get a prefix such as saml, samlp </b>
- *
+ * Marshall the response type to the output stream
* @param responseType
* @param os
* @throws ProcessingException
*/
public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException
- {
- /*String key = PicketLinkFederationConstants.JAXB_SCHEMA_VALIDATION;
- boolean validate = Boolean.parseBoolean(SecurityActions
- .getSystemProperty(key, "false"));
-
- Marshaller marshaller = JBossSAMLAuthnResponseFactory
- .getValidatingMarshaller(validate);
- JAXBElement<ResponseType> jaxb = SAMLProtocolFactory.getObjectFactory()
- .createResponse(responseType);
- marshaller.marshal(jaxb, os); */
-
+ {
SAMLResponseWriter samlWriter = new SAMLResponseWriter( StaxUtil.getXMLStreamWriter(os));
samlWriter.write(responseType);
}
-
+
/**
* Marshall the ResponseType into a writer
* @param responseType
@@ -456,10 +402,6 @@
public void marshall(ResponseType responseType, Writer writer) throws ProcessingException
{
SAMLResponseWriter samlWriter = new SAMLResponseWriter( StaxUtil.getXMLStreamWriter( writer ));
- samlWriter.write(responseType);
-
- /*Marshaller marshaller = JBossSAMLAuthnResponseFactory.getMarshaller();
- JAXBElement<ResponseType> jaxb = SAMLProtocolFactory.getObjectFactory().createResponse(responseType);
- marshaller.marshal(jaxb, writer);*/
+ samlWriter.write(responseType);
}
}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java 2011-01-27 02:54:48 UTC (rev 661)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java 2011-01-27 02:55:46 UTC (rev 662)
@@ -69,12 +69,7 @@
{
SAMLEntityDescriptorParser parser = new SAMLEntityDescriptorParser();
return (EntityDescriptorType) parser.parse( StaxParserUtil.getXMLEventReader(metadataFileStream));
- /*
- JAXBElement<EntityDescriptorType> j =
- (JAXBElement<EntityDescriptorType>) MetaDataBuilderDelegate.getUnmarshaller().unmarshal(metadataFileStream);
- edt = j.getValue();
- //TODO: use the signing and enc key data
-*/ }
+ }
catch(Exception e)
{
throw new RuntimeException(e);
13 years, 11 months
Picketlink SVN: r661 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 21:54:48 -0500 (Wed, 26 Jan 2011)
New Revision: 661
Removed:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/XACMLStatementFactory.java
Log:
get rid of object factories
Deleted: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/XACMLStatementFactory.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/XACMLStatementFactory.java 2011-01-27 02:32:17 UTC (rev 660)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/XACMLStatementFactory.java 2011-01-27 02:54:48 UTC (rev 661)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.picketlink.identity.federation.core.saml.v2.factories;
-
-import org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.ObjectFactory;
-
-/**
- * Factory for dealing with XACML Statements
- * sent as SAML statements
- * @author Anil.Saldhana(a)redhat.com
- * @since Jan 28, 2009
- */
-public class XACMLStatementFactory
-{
- private static ObjectFactory factory = new ObjectFactory();
-
- /**
- * Return the object factory to be
- * used in chain of method invocation
- * @return
- */
- public static ObjectFactory getObjectFactory()
- {
- return factory;
- }
-}
\ No newline at end of file
13 years, 11 months
Picketlink SVN: r660 - in federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF: classes and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 21:32:17 -0500 (Wed, 26 Jan 2011)
New Revision: 660
Added:
federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/wsdl/
federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/wsdl/SOAPSAMLXACMLPDP.wsdl
Modified:
federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/classes/policyConfig.xml
federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/web.xml
Log:
pdp war now has the soap-saml-xacml jaxws ws provider
Modified: federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/classes/policyConfig.xml
===================================================================
--- federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/classes/policyConfig.xml 2011-01-27 02:31:29 UTC (rev 659)
+++ federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/classes/policyConfig.xml 2011-01-27 02:32:17 UTC (rev 660)
@@ -1,4 +1,4 @@
-<ns:jbosspdp xmlns:ns="urn:picketlink:xacml:2.0">
+<ns:jbosspdp xmlns:ns="urn:jboss:xacml:2.0">
<ns:Policies>
<ns:PolicySet>
<ns:Location>policies/himss-policy.xml</ns:Location>
Modified: federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/web.xml 2011-01-27 02:31:29 UTC (rev 659)
+++ federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/web.xml 2011-01-27 02:32:17 UTC (rev 660)
@@ -13,6 +13,8 @@
<param-name>debug</param-name>
<param-value>false</param-value>
</context-param>
+
+
<servlet>
<servlet-name>SOAPServlet</servlet-name>
<servlet-class>org.picketlink.identity.federation.bindings.servlets.SOAPSAMLXACMLServlet</servlet-class>
@@ -26,8 +28,13 @@
<param-value>true</param-value>
</init-param>
</servlet>
+
+ <servlet>
+ <servlet-name>SOAPSAMLXACMLPDPServlet</servlet-name>
+ <servlet-class>org.picketlink.identity.federation.core.pdp.SOAPSAMLXACMLPDP</servlet-class>
+ </servlet>
<servlet-mapping>
- <servlet-name>SOAPServlet</servlet-name>
- <url-pattern>/SOAPServlet</url-pattern>
+ <servlet-name>SOAPSAMLXACMLPDPServlet</servlet-name>
+ <url-pattern>/SOAPSAMLXACMLPDP</url-pattern>
</servlet-mapping>
</web-app>
Added: federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/wsdl/SOAPSAMLXACMLPDP.wsdl
===================================================================
--- federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/wsdl/SOAPSAMLXACMLPDP.wsdl (rev 0)
+++ federation/trunk/picketlink-webapps/pdp/src/main/webapp/WEB-INF/wsdl/SOAPSAMLXACMLPDP.wsdl 2011-01-27 02:32:17 UTC (rev 660)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<wsdl:definitions name="SOAPSAMLXACMLPDP" targetNamespace="urn:picketlink:identity-federation:pdp"
+ xmlns:tns="urn:picketlink:identity-federation:pdp"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <xs:schema targetNamespace="urn:picketlink:identity-federation:pdp"
+ xmlns:tns="urn:picketlink:identity-federation:pdp"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ version="1.0" elementFormDefault="qualified">
+ <xs:element name="MessageBody">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="Authorize">
+ <wsdl:part name="authorizeMessage" element="tns:MessageBody"/>
+ </wsdl:message>
+ <wsdl:message name="AuthorizeResponse">
+ <wsdl:part name="authorizerMessage" element="tns:MessageBody"/>
+ </wsdl:message>
+ <wsdl:portType name="SOAPSAMLXACMLPort">
+ <wsdl:operation name="Authorize">
+ <wsdl:input wsap10:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" message="tns:Authorize"/>
+ <wsdl:output wsap10:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue" message="tns:AuthorizeResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="PDPBinding" type="tns:SOAPSAMLXACMLPort">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Authorize">
+ <soap12:operation soapAction="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPSAMLXACMLPDP">
+ <wsdl:port name="SOAPSAMLXACMLPort" binding="tns:PDPBinding">
+ <soap12:address location="http://localhost:8080/SOAPSAMLXACMLPDP"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
13 years, 11 months
Picketlink SVN: r659 - in integration-tests/trunk: picketlink-saml-tests and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 21:31:29 -0500 (Wed, 26 Jan 2011)
New Revision: 659
Modified:
integration-tests/trunk/picketlink-openid-tests/pom.xml
integration-tests/trunk/picketlink-saml-tests/pom.xml
integration-tests/trunk/picketlink-sts-tests/pom.xml
Log:
use project version
Modified: integration-tests/trunk/picketlink-openid-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/pom.xml 2011-01-27 02:22:27 UTC (rev 658)
+++ integration-tests/trunk/picketlink-openid-tests/pom.xml 2011-01-27 02:31:29 UTC (rev 659)
@@ -65,7 +65,7 @@
<configuration>
<tasks>
<property name="depclasspath" refid="maven.dependency.classpath"/>
- <property name="version" value="${version}"/>
+ <property name="version" value="${project.version}"/>
<property name="localRepository" value="${user.home}/.m2/repository"/>
<ant antfile="${basedir}/ant-build.xml" target="start-jboss" />
</tasks>
Modified: integration-tests/trunk/picketlink-saml-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-saml-tests/pom.xml 2011-01-27 02:22:27 UTC (rev 658)
+++ integration-tests/trunk/picketlink-saml-tests/pom.xml 2011-01-27 02:31:29 UTC (rev 659)
@@ -69,7 +69,7 @@
<configuration>
<tasks>
<property name="depclasspath" refid="maven.dependency.classpath"/>
- <property name="version" value="${version}"/>
+ <property name="version" value="${project.version}"/>
<property name="localRepository" value="${user.home}/.m2/repository"/>
<ant antfile="${basedir}/ant-build.xml" target="start-jboss" />
</tasks>
Modified: integration-tests/trunk/picketlink-sts-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-sts-tests/pom.xml 2011-01-27 02:22:27 UTC (rev 658)
+++ integration-tests/trunk/picketlink-sts-tests/pom.xml 2011-01-27 02:31:29 UTC (rev 659)
@@ -68,7 +68,7 @@
<phase>compile</phase>
<configuration>
<tasks>
- <property name="version" value="${version}"/>
+ <property name="version" value="${project.version}"/>
<property name="depclasspath" refid="maven.dependency.classpath"/>
<property name="localRepository" value="${user.home}/.m2/repository"/>
<ant antfile="${basedir}/ant-build.xml" target="install-jboss" />
13 years, 11 months
Picketlink SVN: r658 - in integration-tests/trunk: picketlink-pdp-tests and 9 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 21:22:27 -0500 (Wed, 26 Jan 2011)
New Revision: 658
Added:
integration-tests/trunk/picketlink-pdp-tests/
integration-tests/trunk/picketlink-pdp-tests/.classpath
integration-tests/trunk/picketlink-pdp-tests/.project
integration-tests/trunk/picketlink-pdp-tests/ant-build.xml
integration-tests/trunk/picketlink-pdp-tests/pom.xml
integration-tests/trunk/picketlink-pdp-tests/src/
integration-tests/trunk/picketlink-pdp-tests/src/test/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java
integration-tests/trunk/picketlink-pdp-tests/src/test/resources/
integration-tests/trunk/picketlink-pdp-tests/src/test/resources/log4j.xml
Log:
PDP integration tests
Added: integration-tests/trunk/picketlink-pdp-tests/.classpath
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/.classpath (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/.classpath 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,18 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/ant/ant/1.5/ant-1.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2.jar" sourcepath="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/httpunit/httpunit/1.7/httpunit-1.7.jar" sourcepath="M2_REPO/httpunit/httpunit/1.7/httpunit-1.7-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.4/jbossxacml-2.0.4.jar" sourcepath="M2_REPO/org/jboss/security/jbossxacml/2.0.4/jbossxacml-2.0.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/rhino/js/1.6R7/js-1.6R7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar" sourcepath="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/1.9.12/nekohtml-1.9.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed/2.0.0-SNAPSHOT/picketlink-fed-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed/2.0.0-SNAPSHOT/picketlink-fed-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-pdp-tests/.project
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/.project (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/.project 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>picketlink-integration-pdp-tests</name>
+ <comment>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-pdp-tests/ant-build.xml
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/ant-build.xml (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/ant-build.xml 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,40 @@
+<project default="install-jboss" name="PicketLink Federation Integration Test Suite">
+
+ <property name="JBAS_ZIP" location="${basedir}/../common-dist/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip"/>
+ <property name="JBAS_DEPLOY" location="${basedir}/target/jboss-5.1.0.GA/server/default/deploy/" />
+ <property name="OPENID4JAVA_VERSION" value="0.9.5" />
+
+ <property environment="env" />
+
+ <target name="install-jboss">
+ <echo>Installing JBOSS AS 5.1.0.GA</echo>
+ <unzip src="${JBAS_ZIP}" dest="${basedir}/target"/>
+
+ <!-- Copy PicketLink jars and webapps to JBoss AS -->
+ <mkdir dir="${JBAS_DEPLOY}/picketlink" />
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings/${version}/picketlink-bindings-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings-jboss/${version}/picketlink-bindings-jboss-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-fed/${version}/picketlink-fed-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/org/openid4java/openid4java-nodeps/${OPENID4JAVA_VERSION}/openid4java-nodeps-${OPENID4JAVA_VERSION}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <unzip src="${localRepository}/org/picketlink/picketlink-fed-webapps-assembly/${version}/picketlink-fed-webapps-assembly-${version}.zip"
+ dest="${JBAS_DEPLOY}"/>
+ <chmod file="${basedir}/target/jboss-5.1.0.GA/bin/run.sh" perm="700"/>
+ </target>
+
+ <target name="start-jboss">
+ <echo>Starting Local 8080</echo>
+ <exec executable="${basedir}/target/jboss-5.1.0.GA/bin/run.sh"
+ osfamily="unix" spawn="true" />
+ <waitfor maxwait="1" maxwaitunit="minute"
+ checkevery="100" checkeveryunit="millisecond">
+ <http url="http://localhost:8080" />
+ </waitfor>
+ <echo>Local 8080 Started</echo>
+ </target>
+
+ <target name="stop-jboss">
+ <echo>Stopping Local 8080</echo>
+ <echo>Going to Kill the JBoss Process</echo>
+ <exec executable="${basedir}/../common-dist/scripts/stopjboss.sh" osfamily="unix"/>
+ </target>
+</project>
Property changes on: integration-tests/trunk/picketlink-pdp-tests/ant-build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: integration-tests/trunk/picketlink-pdp-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/pom.xml (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/pom.xml 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,159 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-integration-tests-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>picketlink-integration-pdp-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>PicketLink Integration Tests for PDP</name>
+ <url>http://labs.jboss.org/portal/picketlink/</url>
+ <description>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <phase>test</phase>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <trimStackTrace>false</trimStackTrace>
+ <reportsDirectory>${project.build.directory}/surefire-reports-native</reportsDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>phase-1</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <property name="version" value="${project.version}"/>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/ant-build.xml" target="install-jboss" />
+ <ant antfile="${basedir}/ant-build.xml" target="start-jboss" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-2</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/ant-build.xml" target="stop-jboss" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbossxacml</artifactId>
+ <version>2.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-fed</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b2</version>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+ -link http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Property changes on: integration-tests/trunk/picketlink-pdp-tests/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.integration.pdp;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.security.xacml.core.model.context.ActionType;
+import org.jboss.security.xacml.core.model.context.AttributeType;
+import org.jboss.security.xacml.core.model.context.AttributeValueType;
+import org.jboss.security.xacml.core.model.context.EnvironmentType;
+import org.jboss.security.xacml.core.model.context.RequestType;
+import org.jboss.security.xacml.core.model.context.ResourceType;
+import org.jboss.security.xacml.core.model.context.SubjectType;
+import org.jboss.security.xacml.factories.RequestAttributeFactory;
+import org.junit.Test;
+import org.picketlink.identity.federation.api.soap.SOAPSAMLXACML;
+import org.picketlink.identity.federation.api.soap.SOAPSAMLXACML.Result;
+
+/**
+ * Unit test the SOAP SAML XACML Unit Test
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 31, 2009
+ */
+public class SOAPSAMLXACMLUnitTestCase
+{
+ //Change it to true when you have an end point running locally
+ private boolean sendRequest = true;
+
+ private String endpoint = "http://localhost:8080/pdp/SOAPSAMLXACMLPDP";
+
+ private String issuer = "testIssuer";
+
+ @Test
+ public void testXACML() throws Exception
+ {
+ if(sendRequest)
+ {
+ //Create an XACML Request
+ RequestType xacmlRequest = getXACMLRequest();
+ SOAPSAMLXACML soapSAMLXACML = new SOAPSAMLXACML();
+
+ Result result = soapSAMLXACML.send(endpoint, issuer, xacmlRequest);
+ assertTrue("No fault", result.isFault() == false);
+ assertTrue("Decision available", result.isResponseAvailable());
+ assertTrue("Deny", result.isDeny());
+ }
+ }
+
+
+ private RequestType getXACMLRequest()
+ {
+ RequestType requestType = new RequestType();
+ requestType.getSubject().add(createSubject());
+ requestType.getResource().add(createResource());
+ requestType.setAction(createAction());
+ requestType.setEnvironment(createEnvironment());
+ return requestType;
+ }
+
+ private SubjectType createSubject()
+ {
+ //Create a subject type
+ SubjectType subject = new SubjectType();
+ subject.setSubjectCategory("urn:oasis:names:tc:xacml:1.0:subject-category:access-subject");
+
+ subject.getAttribute().addAll(getSubjectAttributes());
+
+ return subject;
+ }
+
+ public ResourceType createResource()
+ {
+ ResourceType resourceType = new ResourceType();
+
+ AttributeType attResourceID = RequestAttributeFactory.createStringAttributeType(
+ "urn:va:xacml:2.0:interop:rsa8:resource:hl7:type", issuer,
+ "urn:va:xacml:2.0:interop:rsa8:resource:hl7:medical-record");
+
+ //Create a multi-valued attribute - hl7 permissions
+ AttributeType multi = new AttributeType();
+ multi.setAttributeId("urn:va:xacml:2.0:interop:rsa8:subject:hl7:permission");
+ multi.setDataType("http://www.w3.org/2001/XMLSchema#string");
+
+ if (issuer != null)
+ multi.setIssuer(issuer);
+
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-010"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-012"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-005"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-003"));
+
+
+ AttributeType attConfidentialityCode = RequestAttributeFactory.createStringAttributeType(
+ "urn:va:xacml:2.0:interop:rsa8:resource:hl7:confidentiality-code", issuer,
+ "MA");
+
+ AttributeType attDissentedSubjectId = RequestAttributeFactory.createStringAttributeType(
+ "urn:va:xacml:2.0:interop:rsa8:resource:hl7:radiology:dissented-subject-id", issuer,
+ "Doctor, Bob I");
+
+ //Add the attributes into the resource
+ resourceType.getAttribute().add(attResourceID);
+ resourceType.getAttribute().add(multi);
+ resourceType.getAttribute().add(attConfidentialityCode);
+ resourceType.getAttribute().add(attDissentedSubjectId);
+ return resourceType;
+ }
+
+ private ActionType createAction()
+ {
+ ActionType actionType = new ActionType();
+ AttributeType attActionID = RequestAttributeFactory.createStringAttributeType(
+ "urn:oasis:names:tc:xacml:1.0:action:action-id", issuer, "read");
+ actionType.getAttribute().add(attActionID);
+ return actionType;
+ }
+
+ private List<AttributeType> getSubjectAttributes()
+ {
+ List<AttributeType> attrList = new ArrayList<AttributeType>();
+
+ //create the subject attributes
+
+ //SubjectID - Bob
+ AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
+ "urn:oasis:names:tc:xacml:1.0:subject:subject-id", issuer, "Doctor, Bob I");
+
+ //Role - Physician
+ AttributeType attRole = RequestAttributeFactory.createStringAttributeType(
+ "urn:va:xacml:2.0:interop:rsa8:subject:role", issuer, "Physician");
+
+
+ //Create a multi-valued attribute - hl7 permissions
+ AttributeType multi = new AttributeType();
+ multi.setAttributeId("urn:va:xacml:2.0:interop:rsa8:subject:hl7:permission");
+ multi.setDataType("http://www.w3.org/2001/XMLSchema#string");
+
+ if (issuer != null)
+ multi.setIssuer(issuer);
+
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-010"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-012"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-017"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-005"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-003"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-009"));
+ multi.getAttributeValue().add(createAttributeValueType("urn:va:xacml:2.0:interop:rsa8:hl7:prd-006"));
+
+ //Locality
+ AttributeType attLocality = RequestAttributeFactory.createStringAttributeType(
+ "urn:oasis:names:tc:xacml:1.0:subject:locality", issuer, "Facility A");
+
+ attrList.add(attSubjectID);
+ attrList.add(attRole);
+ attrList.add(multi);
+ attrList.add(attLocality);
+
+ return attrList;
+ }
+
+ private EnvironmentType createEnvironment()
+ {
+ EnvironmentType env = new EnvironmentType();
+
+ AttributeType attFacility = RequestAttributeFactory.createStringAttributeType(
+ "urn:va:xacml:2.0:interop:rsa8:environment:locality", issuer, "Facility A");
+
+ env.getAttribute().add(attFacility);
+ return env;
+ }
+
+ private AttributeValueType createAttributeValueType(String value)
+ {
+ AttributeValueType avt = new AttributeValueType();
+ avt.getContent().add(value);
+ return avt;
+ }
+}
\ No newline at end of file
Added: integration-tests/trunk/picketlink-pdp-tests/src/test/resources/log4j.xml
===================================================================
--- integration-tests/trunk/picketlink-pdp-tests/src/test/resources/log4j.xml (rev 0)
+++ integration-tests/trunk/picketlink-pdp-tests/src/test/resources/log4j.xml 2011-01-27 02:22:27 UTC (rev 658)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 34717 2005-08-08 18:15:31Z adrian $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${basedir}/target/test.log"/>
+ <param name="Append" value="true"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Threshold" value="TRACE"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit JBoss categories to INFO
+ <category name="org.jboss">
+ <priority value="INFO" class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <category name="org.jboss">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.picketlink">
+ <priority value="TRACE"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
13 years, 11 months
Picketlink SVN: r657 - federation/trunk/picketlink-fed-api.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 13:47:14 -0500 (Wed, 26 Jan 2011)
New Revision: 657
Modified:
federation/trunk/picketlink-fed-api/pom.xml
Log:
openid related dep
Modified: federation/trunk/picketlink-fed-api/pom.xml
===================================================================
--- federation/trunk/picketlink-fed-api/pom.xml 2011-01-26 18:46:45 UTC (rev 656)
+++ federation/trunk/picketlink-fed-api/pom.xml 2011-01-26 18:47:14 UTC (rev 657)
@@ -66,6 +66,11 @@
<artifactId>openid4java-nodeps</artifactId>
</dependency>
<dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+ <dependency>
<groupId>org.apache</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
13 years, 11 months
Picketlink SVN: r656 - federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/workflow/openid.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 13:46:45 -0500 (Wed, 26 Jan 2011)
New Revision: 656
Modified:
federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/workflow/openid/OpenIDWorkflowUnitTestCase.java
Log:
remove unused
Modified: federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/workflow/openid/OpenIDWorkflowUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/workflow/openid/OpenIDWorkflowUnitTestCase.java 2011-01-26 18:45:55 UTC (rev 655)
+++ federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/workflow/openid/OpenIDWorkflowUnitTestCase.java 2011-01-26 18:46:45 UTC (rev 656)
@@ -21,7 +21,6 @@
*/
package org.picketlink.test.identity.federation.web.workflow.openid;
-import java.io.InputStream;
import java.net.URL;
import org.mortbay.jetty.servlet.Context;
@@ -50,9 +49,6 @@
protected void establishUserApps()
{
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- InputStream is = tcl.getResourceAsStream("openid/localhost-yadis.xml");
-
- assertNotNull("Yadis descriptor not null", is);
final String WEBAPPDIR = "openid/webapp";
13 years, 11 months
Picketlink SVN: r655 - in federation/trunk: picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 13:45:55 -0500 (Wed, 26 Jan 2011)
New Revision: 655
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/openid/OpenIDManager.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/OpenIDConsumerServlet.java
Log:
add setUserString
Modified: federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/openid/OpenIDManager.java
===================================================================
--- federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/openid/OpenIDManager.java 2011-01-26 18:44:46 UTC (rev 654)
+++ federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/openid/OpenIDManager.java 2011-01-26 18:45:55 UTC (rev 655)
@@ -25,14 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.picketlink.identity.federation.api.openid.OpenIDLifecycleEvent.OP;
-import org.picketlink.identity.federation.api.openid.OpenIDLifecycleEvent.TYPE;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDAssociationException;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDConsumerException;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDDiscoveryException;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDLifeCycleException;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDMessageException;
-import org.picketlink.identity.federation.api.openid.exceptions.OpenIDProtocolException;
import org.openid4java.association.AssociationException;
import org.openid4java.consumer.ConsumerException;
import org.openid4java.consumer.ConsumerManager;
@@ -48,6 +40,14 @@
import org.openid4java.message.ParameterList;
import org.openid4java.message.ax.FetchRequest;
import org.openid4java.message.sreg.SRegRequest;
+import org.picketlink.identity.federation.api.openid.OpenIDLifecycleEvent.OP;
+import org.picketlink.identity.federation.api.openid.OpenIDLifecycleEvent.TYPE;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDAssociationException;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDConsumerException;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDDiscoveryException;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDLifeCycleException;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDMessageException;
+import org.picketlink.identity.federation.api.openid.exceptions.OpenIDProtocolException;
/**
* OpenID Manager for consumers
@@ -87,6 +87,7 @@
consumerManager = new ConsumerManager();
consumerManager.setAssociations(new InMemoryConsumerAssociationStore());
consumerManager.setNonceVerifier(new InMemoryNonceVerifier(5000));
+
userString = request.getURL();
}
catch(ConsumerException ce)
@@ -96,6 +97,15 @@
}
/**
+ * Set the user string
+ * @param userString
+ */
+ public void setUserString(String userString)
+ {
+ this.userString = userString;
+ }
+
+ /**
* Get the OpenID Request
* @return
*/
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/OpenIDConsumerServlet.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/OpenIDConsumerServlet.java 2011-01-26 18:44:46 UTC (rev 654)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/OpenIDConsumerServlet.java 2011-01-26 18:45:55 UTC (rev 655)
@@ -79,6 +79,7 @@
manager = new OpenIDManager(openIDReq);
session.setAttribute("openid_manager", manager);
}
+ manager.setUserString( userEntry );
try
{
13 years, 11 months
Picketlink SVN: r654 - in federation/trunk/picketlink-webapps: openid-consumer/resources and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 13:44:46 -0500 (Wed, 26 Jan 2011)
New Revision: 654
Modified:
federation/trunk/picketlink-webapps/assembly/bin.xml
federation/trunk/picketlink-webapps/openid-consumer/resources/WEB-INF/web.xml
federation/trunk/picketlink-webapps/openid-consumer/resources/formredirection.jsp
Log:
openid changes
Modified: federation/trunk/picketlink-webapps/assembly/bin.xml
===================================================================
--- federation/trunk/picketlink-webapps/assembly/bin.xml 2011-01-26 18:24:06 UTC (rev 653)
+++ federation/trunk/picketlink-webapps/assembly/bin.xml 2011-01-26 18:44:46 UTC (rev 654)
@@ -50,6 +50,16 @@
<fileMode>0444</fileMode>
</file>
<file>
+ <source>${basedir}/../openid-consumer/target/openid-consumer.war</source>
+ <outputDirectory>picketlink</outputDirectory>
+ <fileMode>0444</fileMode>
+ </file>
+ <file>
+ <source>${basedir}/../openid-provider/target/openid-provider.war</source>
+ <outputDirectory>picketlink</outputDirectory>
+ <fileMode>0444</fileMode>
+ </file>
+ <file>
<source>${basedir}/src/main/resources/picketlink-sp-jboss-beans.xml</source>
<outputDirectory>picketlink</outputDirectory>
<fileMode>0444</fileMode>
Modified: federation/trunk/picketlink-webapps/openid-consumer/resources/WEB-INF/web.xml
===================================================================
--- federation/trunk/picketlink-webapps/openid-consumer/resources/WEB-INF/web.xml 2011-01-26 18:24:06 UTC (rev 653)
+++ federation/trunk/picketlink-webapps/openid-consumer/resources/WEB-INF/web.xml 2011-01-26 18:44:46 UTC (rev 654)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
Modified: federation/trunk/picketlink-webapps/openid-consumer/resources/formredirection.jsp
===================================================================
--- federation/trunk/picketlink-webapps/openid-consumer/resources/formredirection.jsp 2011-01-26 18:24:06 UTC (rev 653)
+++ federation/trunk/picketlink-webapps/openid-consumer/resources/formredirection.jsp 2011-01-26 18:44:46 UTC (rev 654)
@@ -1,7 +1,3 @@
-<%--
- ~ Copyright 2006-2008 Sxip Identity Corporation
- --%>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
13 years, 11 months
Picketlink SVN: r653 - in integration-tests/trunk: picketlink-openid-tests and 8 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-01-26 13:24:06 -0500 (Wed, 26 Jan 2011)
New Revision: 653
Added:
integration-tests/trunk/picketlink-openid-tests/
integration-tests/trunk/picketlink-openid-tests/.classpath
integration-tests/trunk/picketlink-openid-tests/.project
integration-tests/trunk/picketlink-openid-tests/ant-build.xml
integration-tests/trunk/picketlink-openid-tests/pom.xml
integration-tests/trunk/picketlink-openid-tests/src/
integration-tests/trunk/picketlink-openid-tests/src/test/
integration-tests/trunk/picketlink-openid-tests/src/test/java/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/openid/
integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/openid/OpenIDConsumerUnitTestCase.java
Modified:
integration-tests/trunk/pom.xml
Log:
incorporate openid integration
Added: integration-tests/trunk/picketlink-openid-tests/.classpath
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/.classpath (rev 0)
+++ integration-tests/trunk/picketlink-openid-tests/.classpath 2011-01-26 18:24:06 UTC (rev 653)
@@ -0,0 +1,22 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var" path="M2_REPO/ant/ant/1.5/ant-1.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2.jar" sourcepath="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar" sourcepath="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar" sourcepath="M2_REPO/commons-io/commons-io/2.0.1/commons-io-2.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/cssparser/cssparser/0.9.4/cssparser-0.9.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/htmlunit/htmlunit/2.1/htmlunit-2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/rhino/js/1.6R7/js-1.6R7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/1.9.12/nekohtml-1.9.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-openid-tests/.project
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/.project (rev 0)
+++ integration-tests/trunk/picketlink-openid-tests/.project 2011-01-26 18:24:06 UTC (rev 653)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>picketlink-integration-openid-tests</name>
+ <comment>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-openid-tests/ant-build.xml
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/ant-build.xml (rev 0)
+++ integration-tests/trunk/picketlink-openid-tests/ant-build.xml 2011-01-26 18:24:06 UTC (rev 653)
@@ -0,0 +1,111 @@
+<project default="init" name="PicketLink Federation Integration Test Suite">
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath path="${depclasspath}"/>
+ </taskdef>
+ <property name="JBAS_DEPLOY" location="${basedir}/target/jboss-5.1.0.GA/server/default/deploy/" />
+ <property name="TOMCAT" location="${basedir}/target/apache-tomcat-6.0.26/" />
+ <property name="TOMCAT_DEPLOY" location="${basedir}/target/apache-tomcat-6.0.26/webapps/" />
+ <property name="TOMCAT_LIB" location="${basedir}/target/apache-tomcat-6.0.26/lib/" />
+ <property name="COMMONS_HTTPCLIENT_VERSION" value="3.1" />
+ <property name="COMMONS_CODEC_VERSION" value="1.3" />
+ <property name="COMMONS_LOGGING_VERSION" value="1.0.4" />
+ <property name="OPENID4JAVA_VERSION" value="0.9.5" />
+ <property name="JSTL_VERSION" value="1.2" />
+ <property environment="env" />
+
+ <target name="init-jboss">
+ <!-- Unzip JBoss AS and Tomcat -->
+ <echo>Unzip JBOSS AS 5.1.0.GA</echo>
+ <unzip src="${basedir}/../common-dist/jbossas/5.1.0.GA/jboss-5.1.0.GA-jdk6.zip"
+ dest="${basedir}/target"/>
+ </target>
+ <target name="init-tomcat">
+ <echo>Unzip Apache Tomcat 6.0.26</echo>
+ <unzip src="${basedir}/../common-dist/tomcat/6.0.26/apache-tomcat-6.0.26.zip"
+ dest="${basedir}/target"/>
+ </target>
+
+
+ <target name="tomcat-thirdparty-deps" depends="init-tomcat" >
+ <copy file="${localRepository}/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" todir="${TOMCAT_LIB}"/>
+ </target>
+
+ <target name="copy-picketlink-tomcat" depends="tomcat-thirdparty-deps" >
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings/${version}/picketlink-bindings-${version}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings-jboss/${version}/picketlink-bindings-jboss-${version}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-fed/${version}/picketlink-fed-${version}.jar" todir="${TOMCAT_LIB}"/>
+
+ <copy file="${localRepository}/org/openid4java/openid4java-nodeps/${OPENID4JAVA_VERSION}/openid4java-nodeps-${OPENID4JAVA_VERSION}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/commons-httpclient/commons-httpclient/${COMMONS_HTTPCLIENT_VERSION}/commons-httpclient-${COMMONS_HTTPCLIENT_VERSION}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/commons-codec/commons-codec/${COMMONS_CODEC_VERSION}/commons-codec-${COMMONS_CODEC_VERSION}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/commons-logging/commons-logging/${COMMONS_LOGGING_VERSION}/commons-logging-${COMMONS_LOGGING_VERSION}.jar" todir="${TOMCAT_LIB}"/>
+ <copy file="${localRepository}/jstl/jstl/${JSTL_VERSION}/jstl-${JSTL_VERSION}.jar" todir="${TOMCAT_LIB}"/>
+
+ <unzip src="${localRepository}/org/picketlink/picketlink-fed-webapps-assembly/${version}/picketlink-fed-webapps-assembly-${version}.zip"
+ dest="${TOMCAT_DEPLOY}"/>
+
+ <move todir="${TOMCAT_DEPLOY}">
+ <fileset dir="${TOMCAT_DEPLOY}/picketlink">
+ <include name="**/*.war"/>
+ </fileset>
+ </move>
+
+ <copy file="${basedir}/../common-dist/tomcat/tomcat-users.xml"
+ todir="${TOMCAT}/conf" />
+ <copy file="${basedir}/../common-dist/tomcat/log4j.xml"
+ todir="${TOMCAT}/lib" />
+ <chmod dir="${basedir}/target/apache-tomcat-6.0.26/bin" perm="700" includes="**/*.sh"/>
+ <chmod dir="${basedir}/target/apache-tomcat-6.0.26/bin" perm="700" includes="**/*.jar"/>
+ </target>
+
+ <target name="copy-picketlink-jbas" depends="init-jboss" >
+ <mkdir dir="${basedir}/target/jboss-5.1.0.GA/server/default/deploy/picketlink" />
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings/${version}/picketlink-bindings-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-bindings-jboss/${version}/picketlink-bindings-jboss-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/org/picketlink/picketlink-fed/${version}/picketlink-fed-${version}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <unzip src="${localRepository}/org/picketlink/picketlink-fed-webapps-assembly/${version}/picketlink-fed-webapps-assembly-${version}.zip"
+ dest="${JBAS_DEPLOY}"/>
+
+ <copy file="${localRepository}/org/openid4java/openid4java-nodeps/${OPENID4JAVA_VERSION}/openid4java-nodeps-${OPENID4JAVA_VERSION}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/commons-httpclient/commons-httpclient/${COMMONS_HTTPCLIENT_VERSION}/commons-httpclient-${COMMONS_HTTPCLIENT_VERSION}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+ <copy file="${localRepository}/commons-codec/commons-codec/${COMMONS_CODEC_VERSION}/commons-codec-${COMMONS_CODEC_VERSION}.jar" todir="${JBAS_DEPLOY}/picketlink"/>
+
+ <chmod file="${basedir}/target/jboss-5.1.0.GA/bin/run.sh" perm="700"/>
+ </target>
+
+ <target name="start-jboss" depends="copy-picketlink-jbas" >
+ <echo>Starting Local 8080 </echo>
+ <exec executable="${basedir}/target/jboss-5.1.0.GA/bin/run.sh"
+ osfamily="unix" spawn="true" />
+ <waitfor maxwait="1" maxwaitunit="minute"
+ checkevery="100" checkeveryunit="millisecond">
+ <http url="http://localhost:8080" />
+ </waitfor>
+ <echo>:Local 8080 Started</echo>
+ </target>
+
+ <target name="start-tomcat" depends="copy-picketlink-tomcat" >
+ <echo>Starting Local 8080 </echo>
+ <exec executable="${TOMCAT_DEPLOY}/../bin/startup.sh"
+ osfamily="unix" spawn="true" />
+ <waitfor maxwait="25" maxwaitunit="second"
+ checkevery="100" checkeveryunit="millisecond">
+ <http url="http://localhost:8080" />
+ </waitfor>
+ <echo>:Local 8080 Started</echo>
+ </target>
+
+ <target name="stop-jboss">
+ <echo>Stopping Local 8080 </echo>
+ <echo>Going to Kill the JBoss Process</echo>
+ <exec executable="${basedir}/../common-dist/scripts/stopjboss.sh"
+ osfamily="unix" />
+ </target>
+
+ <target name="stop-tomcat">
+ <echo>Stopping Local 8080 </echo>
+ <echo>Going to stop tomcat</echo>
+ <exec executable="${TOMCAT_DEPLOY}/../bin/shutdown.sh"
+ osfamily="unix" />
+ </target>
+</project>
Property changes on: integration-tests/trunk/picketlink-openid-tests/ant-build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: integration-tests/trunk/picketlink-openid-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/pom.xml (rev 0)
+++ integration-tests/trunk/picketlink-openid-tests/pom.xml 2011-01-26 18:24:06 UTC (rev 653)
@@ -0,0 +1,238 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-integration-tests-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>picketlink-integration-openid-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>PicketLink Integration Tests for OPENID</name>
+ <url>http://labs.jboss.org/portal/picketlink/</url>
+ <description>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <properties>
+ <java.endorsed.dirs>${basedir}/src/test/resources/endorsed</java.endorsed.dirs>
+ <SERVICE_1_URL>http://localhost:8080/openid-consumer/</SERVICE_1_URL>
+ <SERVICE_2_URL>http://localhost:8080/openid-provider/</SERVICE_2_URL>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <phase>test</phase>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>-Djava.endorsed.dirs=${basedir}/src/test/resources/endorsed</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>phase-1</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/ant-build.xml" target="start-jboss" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-2</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/ant-build.xml" target="stop-jboss" />
+ <ant antfile="${basedir}/ant-build.xml" target="start-tomcat" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-3</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="version" value="${version}"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/ant-build.xml" target="stop-tomcat" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.0.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>cssparser</groupId>
+ <artifactId>cssparser</artifactId>
+ <version>0.9.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b2</version>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+ -link http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Property changes on: integration-tests/trunk/picketlink-openid-tests/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/openid/OpenIDConsumerUnitTestCase.java
===================================================================
--- integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/openid/OpenIDConsumerUnitTestCase.java (rev 0)
+++ integration-tests/trunk/picketlink-openid-tests/src/test/java/org/picketlink/test/integration/openid/OpenIDConsumerUnitTestCase.java 2011-01-26 18:24:06 UTC (rev 653)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.integration.openid;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.junit.Test;
+import org.w3c.dom.Document;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
+
+/**
+ * Unit Test the OpenID Consumer App
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jan 25, 2011
+ */
+public class OpenIDConsumerUnitTestCase
+{
+ String SERVICE_1_URL = System.getProperty( "SERVICE_1_URL", "http://localhost:8080/openid-consumer/" );
+
+ @Test
+ public void testOpenIDConsumer() throws Exception
+ {
+ final WebClient webClient = new WebClient();
+ webClient.setJavaScriptEnabled(true);
+
+ final HtmlPage page = (HtmlPage) webClient.getPage( SERVICE_1_URL );
+ HtmlForm form = page.getForms().get(0);
+ HtmlTextInput textField = (HtmlTextInput) form.getInputByName( "openid" );
+
+ // Change the value of the text field
+ textField.setValueAttribute( "http://jbosstest.myopenid.com/" );
+ Iterable<HtmlElement> children = form.getAllHtmlChildElements();
+ HtmlSubmitInput button = null;
+
+ for( HtmlElement elem: children )
+ {
+ if (elem instanceof HtmlSubmitInput )
+ {
+ button = (HtmlSubmitInput) elem;
+ }
+ }
+
+ // Now submit the form by clicking the button and get back the second page.
+ HtmlPage page2 = (HtmlPage) button.click();
+ form = page2.getForms().get(0);
+
+ HtmlPasswordInput passwordField = (HtmlPasswordInput) form.getInputByName( "password" );
+ passwordField.setValueAttribute( "jbosstest123" );
+
+ button = (HtmlSubmitInput) form.getInputByValue( "Sign In" );
+
+ page2 = (HtmlPage) button.click();
+ System.out.println( "Response after button click on myopenid" );
+
+ page2 = (HtmlPage) webClient.getPage( SERVICE_1_URL );
+ write( page2 );
+ String afterLoggingIn = page2.asText();
+ assertTrue( afterLoggingIn.contains( "Logged in as http://jbosstest.myopenid.com/" ));
+ }
+
+ protected void write( HtmlPage page) throws Exception
+ {
+ Document doc = page;
+ Source source = new DOMSource( doc );
+ StringWriter sw = new StringWriter();
+
+ Result streamResult = new StreamResult(sw);
+ // Write the DOM document to the stream
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.INDENT, "no");
+
+ transformer.transform(source, streamResult);
+
+ System.out.println( sw.toString() );
+ }
+}
\ No newline at end of file
Modified: integration-tests/trunk/pom.xml
===================================================================
--- integration-tests/trunk/pom.xml 2011-01-25 05:36:20 UTC (rev 652)
+++ integration-tests/trunk/pom.xml 2011-01-26 18:24:06 UTC (rev 653)
@@ -17,5 +17,6 @@
<module>parent</module>
<module>picketlink-saml-tests</module>
<module>picketlink-sts-tests</module>
+ <module>picketlink-openid-tests</module>
</modules>
</project>
13 years, 11 months