Picketlink SVN: r880 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-13 01:04:17 -0400 (Wed, 13 Apr 2011)
New Revision: 880
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java
Log:
add method to create issuer
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java 2011-04-13 05:00:48 UTC (rev 879)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java 2011-04-13 05:04:17 UTC (rev 880)
@@ -141,6 +141,20 @@
}
/**
+ * Given an address, create the WS-Addressing issuer
+ * @param addressUri
+ * @return
+ */
+ public static EndpointReferenceType createIssuer(String addressUri)
+ {
+ AttributedURIType attributedURI = new AttributedURIType();
+ attributedURI.setValue(addressUri);
+ EndpointReferenceType endpointReference = new EndpointReferenceType();
+ endpointReference.setAddress(attributedURI);
+ return endpointReference;
+ }
+
+ /**
* <p>
* Parses the contents of the {@code AppliesTo} element and returns the address the uniquely identify the service
* provider.
@@ -258,7 +272,7 @@
* @param entropy a reference to the {@code EntropyType} that contains the binary secret.
* @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain
* any secret.
- */
+ */
public static byte[] getBinarySecret(EntropyType entropy)
{
byte[] secret = null;
@@ -285,7 +299,7 @@
public static void persistSTSConfiguration(STSType stsConfiguration, OutputStream outputStream)
{
throw new RuntimeException();
-
+
/*String pkgName = "org.picketlink.identity.federation.core.config";
Marshaller marshaller = JAXBUtil.getMarshaller(pkgName);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
@@ -396,7 +410,7 @@
secret.length * 8);
Element encryptedKeyElement = XMLCipher.getInstance().martial(key);
keyInfo = new KeyInfoType();
- keyInfo.addContent( encryptedKeyElement );
+ keyInfo.addContent(encryptedKeyElement);
}
catch (Exception e)
{
@@ -431,11 +445,11 @@
X509DataType x509 = new X509DataType();
X509CertificateType cert = new X509CertificateType();
cert.setEncodedCertificate(Base64.encodeBytes(encodedCert).getBytes());
- x509.add( cert );
-
+ x509.add(cert);
+
// set the X509DataType in the KeyInfoType.
keyInfo = new KeyInfoType();
- keyInfo.addContent( x509 );
+ keyInfo.addContent(x509);
}
catch (Exception e)
{
@@ -482,7 +496,7 @@
dsaKeyValue.setQ(Base64.encodeBytes(Q).getBytes());
dsaKeyValue.setG(Base64.encodeBytes(G).getBytes());
dsaKeyValue.setY(Base64.encodeBytes(Y).getBytes());
-
+
KeyValueType keyValue = new KeyValueType();
keyValue.getContent().add(dsaKeyValue);
return keyValue;
@@ -490,18 +504,18 @@
else
return null;
}
-
- public static String getServiceNameFromAppliesTo( RequestSecurityToken requestSecurityToken )
+
+ public static String getServiceNameFromAppliesTo(RequestSecurityToken requestSecurityToken)
{
String serviceName = null;
- if( requestSecurityToken != null )
+ if (requestSecurityToken != null)
{
- AppliesTo appliesTo = requestSecurityToken.getAppliesTo();
+ AppliesTo appliesTo = requestSecurityToken.getAppliesTo();
if (appliesTo != null)
{
serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
- }
+ }
}
- return serviceName;
+ return serviceName;
}
}
\ No newline at end of file
13 years, 6 months
Picketlink SVN: r879 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-13 01:00:48 -0400 (Wed, 13 Apr 2011)
New Revision: 879
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java
Log:
PLFED-175: assertion sig
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java 2011-04-13 03:03:02 UTC (rev 878)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java 2011-04-13 05:00:48 UTC (rev 879)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.core.saml.v2.util;
+import java.security.PublicKey;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -31,6 +32,7 @@
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.exceptions.IssueInstantMissingException;
+import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType.ASTChoiceType;
@@ -38,6 +40,8 @@
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.StatementAbstractType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
/**
@@ -148,6 +152,29 @@
}
/**
+ * Given an assertion element, validate the signature
+ * @param assertionElement
+ * @param publicKey the {@link PublicKey}
+ * @return
+ */
+ public static boolean isSignatureValid(Element assertionElement, PublicKey publicKey)
+ {
+ try
+ {
+ Document doc = DocumentUtil.createDocument();
+ Node n = doc.importNode(assertionElement, true);
+ doc.appendChild(n);
+
+ return XMLSignatureUtil.validate(doc, publicKey);
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot validate signature of assertion", e);
+ }
+ return false;
+ }
+
+ /**
* Check whether the assertion has expired
* @param assertion
* @return
13 years, 6 months
Picketlink SVN: r878 - trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-12 23:03:02 -0400 (Tue, 12 Apr 2011)
New Revision: 878
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
Log:
PLFED-174: return true if no assertion
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-04-13 02:51:34 UTC (rev 877)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-04-13 03:03:02 UTC (rev 878)
@@ -109,6 +109,15 @@
assertion = getAssertionFromSubject();
}
+ if(assertion == null )
+ {
+ if(trace)
+ {
+ log.trace("No Assertion was found on the message context or authenticated subject. Returning");
+ }
+ return true;
+ }
+
// add wsse header
Document document = soapMessage.getSOAPPart();
Element soapHeader = Util.findOrCreateSoapHeader(document.getDocumentElement());
13 years, 6 months
Picketlink SVN: r877 - in federation/trunk/picketlink-fed-core/src: test/java/org/picketlink/test/identity/federation/core/saml/v2/util and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-12 22:51:34 -0400 (Tue, 12 Apr 2011)
New Revision: 877
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/util/AssertionUtilUnitTestCase.java
Log:
PLFED-170: assertion util getRoles
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java 2011-04-12 18:23:27 UTC (rev 876)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/AssertionUtil.java 2011-04-13 02:51:34 UTC (rev 877)
@@ -21,6 +21,10 @@
*/
package org.picketlink.identity.federation.core.saml.v2.util;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
import javax.xml.datatype.XMLGregorianCalendar;
import org.apache.log4j.Logger;
@@ -28,9 +32,13 @@
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.exceptions.IssueInstantMissingException;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType.ASTChoiceType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.StatementAbstractType;
+import org.w3c.dom.Node;
/**
* Utility to deal with assertions
@@ -38,10 +46,11 @@
* @since Jun 3, 2009
*/
public class AssertionUtil
-{
+{
private static Logger log = Logger.getLogger(AssertionUtil.class);
+
private static boolean trace = log.isTraceEnabled();
-
+
/**
* Create an assertion
* @param id
@@ -57,13 +66,13 @@
}
catch (ConfigurationException e)
{
- throw new RuntimeException( e );
+ throw new RuntimeException(e);
}
- AssertionType assertion = new AssertionType( id, issueInstant, JBossSAMLConstants.VERSION_2_0.get() );
- assertion.setIssuer( issuer );
- return assertion;
+ AssertionType assertion = new AssertionType(id, issueInstant, JBossSAMLConstants.VERSION_2_0.get());
+ assertion.setIssuer(issuer);
+ return assertion;
}
-
+
/**
* Create an attribute type
* @param name Name of the attribute
@@ -71,22 +80,21 @@
* @param attributeValues an object array of attribute values
* @return
*/
- public static AttributeType createAttribute(String name, String nameFormat,
- Object... attributeValues)
- {
- AttributeType att = new AttributeType( name );
+ public static AttributeType createAttribute(String name, String nameFormat, Object... attributeValues)
+ {
+ AttributeType att = new AttributeType(name);
att.setNameFormat(nameFormat);
- if(attributeValues != null && attributeValues.length > 0)
+ if (attributeValues != null && attributeValues.length > 0)
{
- for(Object attributeValue:attributeValues)
+ for (Object attributeValue : attributeValues)
{
att.addAttributeValue(attributeValue);
- }
+ }
}
-
+
return att;
}
-
+
/**
* <p>
* Add validity conditions to the SAML2 Assertion
@@ -100,20 +108,20 @@
* @throws ConfigurationException
* @throws IssueInstantMissingException
*/
- public static void createTimedConditions(AssertionType assertion, long durationInMilis)
- throws ConfigurationException, IssueInstantMissingException
+ public static void createTimedConditions(AssertionType assertion, long durationInMilis)
+ throws ConfigurationException, IssueInstantMissingException
{
XMLGregorianCalendar issueInstant = assertion.getIssueInstant();
- if(issueInstant == null)
+ if (issueInstant == null)
throw new IssueInstantMissingException("assertion does not have issue instant");
XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis);
ConditionsType conditionsType = new ConditionsType();
conditionsType.setNotBefore(issueInstant);
conditionsType.setNotOnOrAfter(assertionValidityLength);
-
- assertion.setConditions(conditionsType);
+
+ assertion.setConditions(conditionsType);
}
-
+
/**
* Add validity conditions to the SAML2 Assertion
* @param assertion
@@ -121,24 +129,24 @@
* @throws ConfigurationException
* @throws IssueInstantMissingException
*/
- public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew )
- throws ConfigurationException, IssueInstantMissingException
+ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew)
+ throws ConfigurationException, IssueInstantMissingException
{
XMLGregorianCalendar issueInstant = assertion.getIssueInstant();
- if(issueInstant == null)
+ if (issueInstant == null)
throw new IssueInstantMissingException("assertion does not have issue instant");
- XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add( issueInstant, durationInMilis + clockSkew );
-
+ XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew);
+
ConditionsType conditionsType = new ConditionsType();
-
- XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew );
-
- conditionsType.setNotBefore( beforeInstant );
+
+ XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew);
+
+ conditionsType.setNotBefore(beforeInstant);
conditionsType.setNotOnOrAfter(assertionValidityLength);
-
- assertion.setConditions(conditionsType);
+
+ assertion.setConditions(conditionsType);
}
-
+
/**
* Check whether the assertion has expired
* @param assertion
@@ -148,41 +156,90 @@
public static boolean hasExpired(AssertionType assertion) throws ConfigurationException
{
boolean expiry = false;
-
+
//Check for validity of assertion
ConditionsType conditionsType = assertion.getConditions();
- if(conditionsType != null)
+ if (conditionsType != null)
{
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant();
XMLGregorianCalendar notBefore = conditionsType.getNotBefore();
XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter();
- if(trace) log.trace("Now="+now.toXMLFormat() + " ::notBefore="+notBefore.toXMLFormat()
- + "::notOnOrAfter="+notOnOrAfter);
- expiry = !XMLTimeUtil.isValid(now, notBefore, notOnOrAfter);
- if( expiry )
+ if (trace)
+ log.trace("Now=" + now.toXMLFormat() + " ::notBefore=" + notBefore.toXMLFormat() + "::notOnOrAfter="
+ + notOnOrAfter);
+ expiry = !XMLTimeUtil.isValid(now, notBefore, notOnOrAfter);
+ if (expiry)
{
- log.info( "Assertion has expired with id=" + assertion.getID() );
+ log.info("Assertion has expired with id=" + assertion.getID());
}
}
-
+
//TODO: if conditions do not exist, assume the assertion to be everlasting?
- return expiry;
- }
-
+ return expiry;
+ }
+
/**
* Extract the expiration time from an {@link AssertionType}
* @param assertion
* @return
*/
- public static XMLGregorianCalendar getExpiration( AssertionType assertion )
+ public static XMLGregorianCalendar getExpiration(AssertionType assertion)
{
XMLGregorianCalendar expiry = null;
-
+
ConditionsType conditionsType = assertion.getConditions();
- if(conditionsType != null)
+ if (conditionsType != null)
{
expiry = conditionsType.getNotOnOrAfter();
}
- return expiry;
+ return expiry;
}
+
+ /**
+ * Given an assertion, return the list of roles it may have
+ * @param assertion The {@link AssertionType}
+ * @param roleKeys a list of string values representing the role keys. The list can be null.
+ * @return
+ */
+ public static List<String> getRoles(AssertionType assertion, List<String> roleKeys)
+ {
+ List<String> roles = new ArrayList<String>();
+ Set<StatementAbstractType> statements = assertion.getStatements();
+ for (StatementAbstractType statement : statements)
+ {
+ if (statement instanceof AttributeStatementType)
+ {
+ AttributeStatementType attributeStatement = (AttributeStatementType) statement;
+ List<ASTChoiceType> attList = attributeStatement.getAttributes();
+ for (ASTChoiceType obj : attList)
+ {
+ AttributeType attr = obj.getAttribute();
+ if (roleKeys != null && roleKeys.size() > 0)
+ {
+ if (!roleKeys.contains(attr.getName()))
+ continue;
+ }
+ List<Object> attributeValues = attr.getAttributeValue();
+ if (attributeValues != null)
+ {
+ for (Object attrValue : attributeValues)
+ {
+ if (attrValue instanceof String)
+ {
+ roles.add((String) attrValue);
+ }
+ else if (attrValue instanceof Node)
+ {
+ Node roleNode = (Node) attrValue;
+ roles.add(roleNode.getFirstChild().getNodeValue());
+ }
+ else
+ throw new RuntimeException("Unknown role object type : " + attrValue);
+ }
+ }
+ }
+ }
+ }
+ return roles;
+ }
}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/util/AssertionUtilUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/util/AssertionUtilUnitTestCase.java 2011-04-12 18:23:27 UTC (rev 876)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/util/AssertionUtilUnitTestCase.java 2011-04-13 02:51:34 UTC (rev 877)
@@ -21,64 +21,93 @@
*/
package org.picketlink.test.identity.federation.core.saml.v2.util;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.List;
+
import javax.xml.datatype.XMLGregorianCalendar;
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import org.picketlink.identity.federation.core.parsers.saml.SAMLParser;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil;
import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType.RTChoiceType;
/**
* Unit test the AssertionUtil
* @author Anil.Saldhana(a)redhat.com
* @since Jun 3, 2009
*/
-public class AssertionUtilUnitTestCase extends TestCase
-{
-
+public class AssertionUtilUnitTestCase
+{
+ @Test
public void testValidAssertion() throws Exception
{
- NameIDType nameIdType = new NameIDType();
+ NameIDType nameIdType = new NameIDType();
nameIdType.setValue("somename");
-
- AssertionType assertion = new AssertionType( "SomeID", XMLTimeUtil.getIssueInstant(), JBossSAMLConstants.VERSION_2_0.get() );
+
+ AssertionType assertion = new AssertionType("SomeID", XMLTimeUtil.getIssueInstant(),
+ JBossSAMLConstants.VERSION_2_0.get());
assertion.setIssuer(nameIdType);
-
+
//Assertions with no conditions are everlasting
assertTrue(AssertionUtil.hasExpired(assertion) == false);
-
+
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant();
-
+
XMLGregorianCalendar sometimeLater = XMLTimeUtil.add(now, 5555);
-
+
ConditionsType conditions = new ConditionsType();
conditions.setNotBefore(now);
conditions.setNotOnOrAfter(sometimeLater);
- assertion.setConditions(conditions);
+ assertion.setConditions(conditions);
assertTrue(AssertionUtil.hasExpired(assertion) == false);
}
-
+
+ @Test
public void testExpiredAssertion() throws Exception
{
-
NameIDType nameIdType = new NameIDType();
nameIdType.setValue("somename");
-
- AssertionType assertion = new AssertionType( "SomeID", XMLTimeUtil.getIssueInstant(), JBossSAMLConstants.VERSION_2_0.get());
- assertion.setIssuer(nameIdType);
-
+
+ AssertionType assertion = new AssertionType("SomeID", XMLTimeUtil.getIssueInstant(),
+ JBossSAMLConstants.VERSION_2_0.get());
+ assertion.setIssuer(nameIdType);
+
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant();
-
+
XMLGregorianCalendar sometimeAgo = XMLTimeUtil.subtract(now, 55555);
-
+
ConditionsType conditions = new ConditionsType();
- conditions.setNotBefore(XMLTimeUtil.subtract(now,55575));
+ conditions.setNotBefore(XMLTimeUtil.subtract(now, 55575));
conditions.setNotOnOrAfter(sometimeAgo);
- assertion.setConditions(conditions);
+ assertion.setConditions(conditions);
assertTrue(AssertionUtil.hasExpired(assertion));
- }
+ }
+
+ @Test
+ public void testRoleExtraction() throws Exception
+ {
+ String file = "parser/saml2/saml2-response-assertion-subject.xml";
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
+ assertNotNull(is);
+ SAMLParser parser = new SAMLParser();
+ ResponseType response = (ResponseType) parser.parse(is);
+ List<RTChoiceType> assertionList = response.getAssertions();
+ assertEquals(1, assertionList.size());
+ RTChoiceType rtc = assertionList.get(0);
+ AssertionType assertion = rtc.getAssertion();
+ List<String> roles = AssertionUtil.getRoles(assertion, null);
+ assertEquals(2, roles.size());
+ assertTrue(roles.contains("manager"));
+ assertTrue(roles.contains("employee"));
+ }
}
\ No newline at end of file
13 years, 6 months
Picketlink SVN: r876 - integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-12 14:23:27 -0400 (Tue, 12 Apr 2011)
New Revision: 876
Modified:
integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java
Log:
update pdp test for PERMIT condition also
Modified: 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 2011-04-12 16:59:57 UTC (rev 875)
+++ integration-tests/trunk/picketlink-pdp-tests/src/test/java/org/picketlink/test/integration/pdp/SOAPSAMLXACMLUnitTestCase.java 2011-04-12 18:23:27 UTC (rev 876)
@@ -26,6 +26,10 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
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;
@@ -53,29 +57,46 @@
private String issuer = "testIssuer";
@Test
- public void testXACML() throws Exception
+ public void testPermit() throws Exception
{
if(sendRequest)
{
//Create an XACML Request
- RequestType xacmlRequest = getXACMLRequest();
+ RequestType xacmlRequest = getXACMLRequest(true);
SOAPSAMLXACML soapSAMLXACML = new SOAPSAMLXACML();
Result result = soapSAMLXACML.send(endpoint, issuer, xacmlRequest);
assertTrue("No fault", result.isFault() == false);
assertTrue("Decision available", result.isResponseAvailable());
+ assertTrue("Permit", result.isPermit());
+ }
+ }
+
+ @Test
+ public void testDeny() throws Exception
+ {
+ if(sendRequest)
+ {
+ //Create an XACML Request
+ RequestType xacmlRequest = getXACMLRequest(false);
+ 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()
+ private RequestType getXACMLRequest( boolean permit)
{
RequestType requestType = new RequestType();
requestType.getSubject().add(createSubject());
- requestType.getResource().add(createResource());
+ requestType.getResource().add(createResource(permit));
requestType.setAction(createAction());
- requestType.setEnvironment(createEnvironment());
+ requestType.setEnvironment(createEnvironment(permit));
return requestType;
}
@@ -90,8 +111,8 @@
return subject;
}
- public ResourceType createResource()
- {
+ public ResourceType createResource(boolean permit)
+ {
ResourceType resourceType = new ResourceType();
AttributeType attResourceID = RequestAttributeFactory.createStringAttributeType(
@@ -123,8 +144,24 @@
//Add the attributes into the resource
resourceType.getAttribute().add(attResourceID);
resourceType.getAttribute().add(multi);
+
+ if(!permit)
resourceType.getAttribute().add(attConfidentialityCode);
- resourceType.getAttribute().add(attDissentedSubjectId);
+
+ resourceType.getAttribute().add(attDissentedSubjectId);
+
+ if(permit)
+ {
+ AttributeType start = RequestAttributeFactory.createTimeAttributeType(
+ "urn:oasis:names:tc:xspa:1.0:resource:org:hoursofoperation:start",
+ issuer, getXMLTime("00:00:00-08:00"));
+ AttributeType end = RequestAttributeFactory.createTimeAttributeType(
+ "urn:oasis:names:tc:xspa:1.0:resource:org:hoursofoperation:end",
+ issuer, getXMLTime("23:59:00-08:00"));
+ resourceType.getAttribute().add(start);
+ resourceType.getAttribute().add(end);
+ }
+
return resourceType;
}
@@ -168,6 +205,7 @@
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");
@@ -175,12 +213,13 @@
attrList.add(attSubjectID);
attrList.add(attRole);
attrList.add(multi);
+
attrList.add(attLocality);
return attrList;
}
- private EnvironmentType createEnvironment()
+ private EnvironmentType createEnvironment(boolean permit)
{
EnvironmentType env = new EnvironmentType();
@@ -188,6 +227,15 @@
"urn:va:xacml:2.0:interop:rsa8:environment:locality", issuer, "Facility A");
env.getAttribute().add(attFacility);
+
+ if(permit)
+ {
+
+ AttributeType currentTime = RequestAttributeFactory.createTimeAttributeType(
+ "urn:oasis:names:tc:xacml:1.0:environment:current-time",
+ issuer, getXMLTime("12:59:00-08:00"));
+ env.getAttribute().add(currentTime);
+ }
return env;
}
@@ -197,4 +245,18 @@
avt.getContent().add(value);
return avt;
}
+
+ private XMLGregorianCalendar getXMLTime( String time)
+ {
+ DatatypeFactory dtf;
+ try
+ {
+ dtf = DatatypeFactory.newInstance();
+ }
+ catch (DatatypeConfigurationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ return dtf.newXMLGregorianCalendar(time);
+ }
}
\ No newline at end of file
13 years, 6 months
Picketlink SVN: r875 - eclipse-settings and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-12 12:59:57 -0400 (Tue, 12 Apr 2011)
New Revision: 875
Added:
eclipse-settings/
eclipse-settings/codetemplates.xml
eclipse-settings/jboss-format.xml
Log:
add picketlink eclipse settings
Added: eclipse-settings/codetemplates.xml
===================================================================
--- eclipse-settings/codetemplates.xml (rev 0)
+++ eclipse-settings/codetemplates.xml 2011-04-12 16:59:57 UTC (rev 875)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?><templates><template autoinsert="true" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/**
+ * @return the ${bare_field_name}
+ */</template><template autoinsert="true" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/**
+ * @param ${param} the ${bare_field_name} to set
+ */</template><template autoinsert="true" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/**
+ * ${tags}
+ */</template><template autoinsert="true" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
+ *
+ */</template><template autoinsert="true" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/**
+ * @author ${user}
+ *
+ * ${tags}
+ */</template><template autoinsert="true" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment">/**
+ *
+ */</template><template autoinsert="true" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/**
+ * ${tags}
+ */</template><template autoinsert="true" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/* (non-Javadoc)
+ * ${see_to_overridden}
+ */</template><template autoinsert="true" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/**
+ * ${tags}
+ * ${see_to_target}
+ */</template><template autoinsert="false" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.
+ */
+${filecomment}
+${package_declaration}
+
+/**
+ * @author YOUR_NAME
+ * @since ${date}
+ */
+${type_declaration}</template><template autoinsert="true" context="classbody_context" deleted="false" description="Code in new class type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.classbody" name="classbody">
+</template><template autoinsert="true" context="interfacebody_context" deleted="false" description="Code in new interface type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name="interfacebody">
+</template><template autoinsert="true" context="enumbody_context" deleted="false" description="Code in new enum type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.enumbody" name="enumbody">
+</template><template autoinsert="true" context="annotationbody_context" deleted="false" description="Code in new annotation type bodies" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name="annotationbody">
+</template><template autoinsert="true" context="catchblock_context" deleted="false" description="Code in new catch blocks" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.catchblock" name="catchblock">// ${todo} Auto-generated catch block
+${exception_var}.printStackTrace();</template><template autoinsert="true" context="methodbody_context" deleted="false" description="Code in created method stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodbody" name="methodbody">// ${todo} Auto-generated method stub
+${body_statement}</template><template autoinsert="true" context="constructorbody_context" deleted="false" description="Code in created constructor stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name="constructorbody">${body_statement}
+// ${todo} Auto-generated constructor stub</template><template autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field};</template><template autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};</template></templates>
Property changes on: eclipse-settings/codetemplates.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: eclipse-settings/jboss-format.xml
===================================================================
--- eclipse-settings/jboss-format.xml (rev 0)
+++ eclipse-settings/jboss-format.xml 2011-04-12 16:59:57 UTC (rev 875)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profiles version="8">
+<profile name="JBoss" version="8">
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="52"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="64"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="64"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/>
+</profile>
+</profiles>
Property changes on: eclipse-settings/jboss-format.xml
___________________________________________________________________
Added: svn:executable
+ *
13 years, 6 months
Picketlink SVN: r873 - in integration-tests/trunk: common-dist and 7 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-11 20:56:51 -0400 (Mon, 11 Apr 2011)
New Revision: 873
Added:
integration-tests/trunk/common-dist/files/
integration-tests/trunk/common-dist/files/jboss-log4j.xml
integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/POJOWSAuthorizationTestCase.java
integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/POJOBean.java
integration-tests/trunk/picketlink-trust-tests/src/test/resources/authorize-handlers.xml
integration-tests/trunk/picketlink-trust-tests/src/test/resources/log4j.xml
integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/
integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/
integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-web.xml
integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-wsse.xml
integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/web.xml
Modified:
integration-tests/trunk/ant-scripts/ant-build.xml
integration-tests/trunk/picketlink-trust-tests/pom.xml
integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/TestBean.java
Log:
PLFED-167: handlers for authentication, authz for POJO WS
Modified: integration-tests/trunk/ant-scripts/ant-build.xml
===================================================================
--- integration-tests/trunk/ant-scripts/ant-build.xml 2011-04-12 00:55:10 UTC (rev 872)
+++ integration-tests/trunk/ant-scripts/ant-build.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -77,6 +77,7 @@
<param name="deploy" value="${JBAS5_DEPLOY}"/>
<param name="jbossas" value="${basedir}/target/jboss-5.1.0.GA"/>
</antcall>
+ <copy file="${basedir}/../common-dist/files/jboss-log4j.xml" todir="${JBAS5_DEPLOY}/../conf"/>
<!--
<mkdir dir="${JBAS5_DEPLOY}/picketlink" />
@@ -109,6 +110,7 @@
<target name="copy-trust-settings-jbas5">
<copy file="${basedir}/../picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml" todir="${JBAS5_DEPLOY}/picketlink" />
<copy file="${basedir}/../picketlink-trust-tests/target/picketlink-wstest-tests.jar" todir="${JBAS5_DEPLOY}/picketlink" />
+ <copy file="${basedir}/../picketlink-trust-tests/target/pojo-test.war" todir="${JBAS5_DEPLOY}/picketlink" />
<copy file="${basedir}/../picketlink-trust-tests/src/test/resources/props/sts-users.properties" todir="${JBAS5_DEPLOY}/../conf" />
<copy file="${basedir}/../picketlink-trust-tests/src/test/resources/props/sts-roles.properties" todir="${JBAS5_DEPLOY}/../conf" />
<copy file="${localRepository}/org/picketlink/picketlink-trust-jbossws/${version}/picketlink-trust-jbossws-${version}.jar" todir="${JBAS5_DEPLOY}/picketlink"/>
Added: integration-tests/trunk/common-dist/files/jboss-log4j.xml
===================================================================
--- integration-tests/trunk/common-dist/files/jboss-log4j.xml (rev 0)
+++ integration-tests/trunk/common-dist/files/jboss-log4j.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: jboss-log4j.xml 87678 2009-04-22 16:47:08Z bstansberry(a)jboss.com $ -->
+
+<!--
+ | For more configuration information 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.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/server.log"/>
+ <param name="Append" value="true"/>
+ <!-- In AS 5.0.x the server log threshold was set by a system
+ property. In 5.1 and later we are instead using the system
+ property to set the priority on the root logger (see <root/> below)
+ <param name="Threshold" value="${jboss.server.log.threshold}"/>
+ -->
+
+ <!-- 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] (Thread) Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] (%t) %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>
+
+ <!-- A size based file rolling appender
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/server.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <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>
+
+ <!-- ====================== -->
+ <!-- More Appender examples -->
+ <!-- ====================== -->
+
+ <!-- Buffer events and log them asynchronously
+ <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <appender-ref ref="FILE"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="SMTP"/>
+ </appender>
+ -->
+
+ <!-- EMail events to an administrator
+ <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="To" value="admin(a)myhost.domain.com"/>
+ <param name="From" value="nobody(a)myhost.domain.com"/>
+ <param name="Subject" value="JBoss Sever Errors"/>
+ <param name="SMTPHost" value="localhost"/>
+ <param name="BufferSize" value="10"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Syslog events
+ <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Facility" value="LOCAL7"/>
+ <param name="FacilityPrinting" value="true"/>
+ <param name="SyslogHost" value="localhost"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Log events to JMS (requires a topic to be created)
+ <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
+ <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
+ </appender>
+ -->
+
+ <!-- Log events through SNMP
+ <appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="ImplementationClassName" value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+ <param name="ManagementHost" value="127.0.0.1"/>
+ <param name="ManagementHostTrapListenPort" value="162"/>
+ <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+ <param name="LocalIPAddress" value="127.0.0.1"/>
+ <param name="LocalTrapSendPort" value="161"/>
+ <param name="GenericTrapType" value="6"/>
+ <param name="SpecificTrapType" value="12345678"/>
+ <param name="CommunityString" value="public"/>
+ <param name="ForwardStackTraceWithTrap" value="true"/>
+ <param name="Threshold" value="DEBUG"/>
+ <param name="ApplicationTrapOID" value="1.3.6.1.4.1.24.12.10.22.64"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Emit events as JMX notifications
+ <appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+
+ <param name="Threshold" value="WARN"/>
+ <param name="ObjectName" value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Security AUDIT Appender
+ <appender name="AUDIT" class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/audit.log"/>
+ <param name="Append" value="true"/>
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] (%t:%x) %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Set the logging level of the JSF implementation that uses
+ | java.util.logging. The jdk logging levels can be controlled
+ | through the org.jboss.logging.log4j.JDKLevel class that
+ | in addition to the standard log4j levels it adds support for
+ | SEVERE, WARNING, CONFIG, FINE, FINER, FINEST
+ -->
+ <category name="javax.enterprise.resource.webcontainer.jsf">
+ <priority value="INFO" class="org.jboss.logging.log4j.JDKLevel"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the org.quartz category to INFO as its DEBUG is verbose -->
+ <category name="org.quartz">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the com.sun category to INFO as its FINE is verbose -->
+ <category name="com.sun">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the sun category to INFO as its FINE is verbose -->
+ <category name="sun">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the javax.xml.bind category to INFO as its FINE is verbose -->
+ <category name="javax.xml.bind">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit JBoss categories
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+ -->
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the verbose facelets compiler -->
+ <category name="facelets.compiler">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the verbose ajax4jsf cache initialization -->
+ <category name="org.ajax4jsf.cache">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the verbose embedded jopr categories -->
+ <category name="org.rhq">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the verbose seam categories -->
+ <category name="org.jboss.seam">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]
+ <category name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
+ <priority value="TRACE"/>
+ </category>
+ -->
+ <category name="org.picketlink">
+ <priority value="TRACE"/>
+ </category>
+
+ <category name="org.jboss.security">
+ <priority value="TRACE"/>
+ </category>
+
+ <category name="org.jboss.ws">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.apache">
+ <priority value="TRACE"/>
+ </category>
+
+ <!-- Category specifically for Security Audit Provider
+ <category name="org.jboss.security.audit.providers.LogAuditProvider" additivity="false">
+ <priority value="TRACE"/>
+ <appender-ref ref="AUDIT"/>
+ </category>
+ -->
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Decrease the priority threshold for the org.jboss.varia category
+ <category name="org.jboss.varia">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!-- Enable JBossWS message tracing
+ <category name="org.jboss.ws.core.MessageTrace">
+ <priority value="TRACE"/>
+ </category>
+ -->
+
+ <!--
+ | An example of enabling the custom TRACE level priority that is used
+ | by the JBoss internals to diagnose low level details. This example
+ | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+ | subpackages. This will produce A LOT of logging output.
+ |
+ | Note: since jboss AS 4.2.x, the trace level is supported natively by
+ | log4j, so although the custom org.jboss.logging.XLevel priority will
+ | still work, there is no need to use it. The two examples that follow
+ | will both enable trace logging.
+ <category name="org.jboss.system">
+ <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ </category>
+ <category name="org.jboss.ejb.plugins">
+ <priority value="TRACE"/>
+ </category>
+ -->
+
+ <!--
+ | Logs these events to SNMP:
+ - server starts/stops
+ - cluster evolution (node death/startup)
+ - When an EJB archive is deployed (and associated verified messages)
+ - When an EAR archive is deployed
+
+ <category name="org.jboss.system.server.Server">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.MainDeployer">
+ <priority value="ERROR" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.ejb.EJBDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.EARDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+ -->
+
+ <!-- Clustering logging -->
+ <!-- Uncomment the following to redirect the org.jgroups and
+ org.jboss.ha categories to a cluster.log file.
+
+ <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ <category name="org.jgroups">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ <category name="org.jboss.ha">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--
+ Set the root logger priority via a system property. Note this is parsed by log4j,
+ so the full JBoss system property format is not supported; e.g.
+ setting a default via ${jboss.server.log.threshold:WARN} will not work.
+ -->
+ <priority value="${jboss.server.log.threshold}"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Modified: integration-tests/trunk/picketlink-trust-tests/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/pom.xml 2011-04-12 00:55:10 UTC (rev 872)
+++ integration-tests/trunk/picketlink-trust-tests/pom.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -26,6 +26,36 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <warName>pojo-test</warName>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+ <warSourceDirectory>src/test/resources/webapp</warSourceDirectory>
+ <webResources>
+ <resource>
+ <!-- this is relative to the pom.xml directory -->
+ <directory>target/test-classes</directory>
+ <targetPath>WEB-INF/classes</targetPath>
+ <includes>
+ <include>**/POJOBean*</include>
+ <include>**/auth*</include>
+ </includes>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
@@ -38,12 +68,14 @@
<configuration>
<finalName>picketlink-wstest</finalName>
<excludes>
+ <exclude>**/WEB-INF/**</exclude>
<exclude>**/*jboss-beans.xml</exclude>
<exclude>**/*TestCase*</exclude>
+ <exclude>**/POJO*</exclude>
+ <exclude>**/author*</exclude>
</excludes>
</configuration>
- </plugin>
-
+ </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
@@ -94,7 +126,7 @@
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-core</artifactId>
- <version>3.4.1.GA</version>
+ <version>3.1.2.GA</version>
<scope>test</scope>
<exclusions>
<exclusion>
Added: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/POJOWSAuthorizationTestCase.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/POJOWSAuthorizationTestCase.java (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/tests/POJOWSAuthorizationTestCase.java 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,85 @@
+/*
+ * 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.trust.tests;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import org.junit.Test;
+import org.picketlink.identity.federation.api.wstrust.WSTrustClient;
+import org.picketlink.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
+import org.picketlink.identity.federation.core.wstrust.WSTrustException;
+import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
+import org.picketlink.test.trust.ws.WSTest;
+import org.picketlink.trust.jbossws.SAML2Constants;
+import org.picketlink.trust.jbossws.handler.SAML2Handler;
+import org.w3c.dom.Element;
+
+/**
+ * A Simple WS Test for POJO WS Authorization using PicketLink
+ * @author Anil Saldhana
+ * @since Oct 3, 2010
+ */
+public class POJOWSAuthorizationTestCase
+{
+ private static String username = "UserA";
+ private static String password = "PassA";
+
+ @SuppressWarnings("rawtypes")
+ @Test
+ public void testWSInteraction() throws Exception
+ {
+ // Step 1: Get a SAML2 Assertion Token from the STS
+ WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort",
+ "http://localhost:8080/picketlink-sts/PicketLinkSTS",
+ new SecurityInfo(username, password));
+ Element assertion = null;
+ try {
+ System.out.println("Invoking token service to get SAML assertion for " + username);
+ assertion = client.issueToken(SAMLUtil.SAML2_TOKEN_TYPE);
+ System.out.println("SAML assertion for " + username + " successfully obtained!");
+ } catch (WSTrustException wse) {
+ System.out.println("Unable to issue assertion: " + wse.getMessage());
+ wse.printStackTrace();
+ System.exit(1);
+ }
+
+ // Step 2: Stuff the Assertion on the SOAP message context and add the SAML2Handler to client side handlers
+ URL wsdl = new URL("http://localhost:8080/pojo-test/POJOBeanService?wsdl");
+ QName serviceName = new QName("http://ws.trust.test.picketlink.org/", "POJOBeanService");
+ Service service = Service.create(wsdl, serviceName);
+ WSTest port = service.getPort(new QName("http://ws.trust.test.picketlink.org/", "POJOBeanPort"), WSTest.class);
+ BindingProvider bp = (BindingProvider)port;
+ bp.getRequestContext().put(SAML2Constants.SAML2_ASSERTION_PROPERTY, assertion);
+ List<Handler> handlers = bp.getBinding().getHandlerChain();
+ handlers.add(new SAML2Handler());
+ bp.getBinding().setHandlerChain(handlers);
+
+ //Step 3: Access the WS. Exceptions will be thrown anyway.
+ port.echo("Test");
+ }
+}
\ No newline at end of file
Added: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/POJOBean.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/POJOBean.java (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/POJOBean.java 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,50 @@
+/*
+ * 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.trust.ws;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * POJO that is exposed as WS
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file="authorize-handlers.xml")
+public class POJOBean
+{
+ @WebMethod
+ public void echo(String echo)
+ {
+ System.out.println(echo);
+ }
+
+ @WebMethod
+ public void echoUnchecked(String echo)
+ {
+ System.out.println(echo);
+ }
+}
\ No newline at end of file
Modified: integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/TestBean.java
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/TestBean.java 2011-04-12 00:55:10 UTC (rev 872)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/java/org/picketlink/test/trust/ws/TestBean.java 2011-04-12 00:56:51 UTC (rev 873)
@@ -29,6 +29,7 @@
import javax.xml.ws.WebServiceContext;
/**
+ * Just a Simple EJB3 bean exposed as WS
* @author Anil.Saldhana(a)redhat.com
* @since Apr 5, 2011
*/
Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/authorize-handlers.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/authorize-handlers.xml (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/authorize-handlers.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+
+
+ <handler>
+ <handler-name>WSAuthorizationHandler</handler-name>
+ <handler-class>org.picketlink.trust.jbossws.handler.WSAuthorizationHandler</handler-class>
+ </handler>
+
+ <handler>
+ <handler-name>WSAuthenticationHandler</handler-name>
+ <handler-class>org.picketlink.trust.jbossws.handler.WSAuthenticationHandler</handler-class>
+ </handler>
+
+ <handler>
+ <handler-name>SAML2Handler</handler-name>
+ <handler-class>org.picketlink.trust.jbossws.handler.SAML2Handler</handler-class>
+ </handler>
+
+
+ </handler-chain>
+
+
+</handler-chains>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/log4j.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/log4j.xml (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/log4j.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,83 @@
+<?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="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-web.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-web.xml (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-web.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,3 @@
+<jboss-web>
+ <security-domain>sts</security-domain>
+</jboss-web>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-wsse.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-wsse.xml (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/jboss-wsse.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,26 @@
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <port name="POJOBeanPort">
+ <operation name="{http://ws.trust.test.picketlink.org/}echoUnchecked">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.trust.test.picketlink.org/}echo">
+ <config>
+ <authorize>
+ <role>JBossAdmin</role>
+ </authorize>
+ </config>
+ </operation>
+ </port>
+
+
+
+</jboss-ws-security>
\ No newline at end of file
Added: integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/web.xml
===================================================================
--- integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/web.xml (rev 0)
+++ integration-tests/trunk/picketlink-trust-tests/src/test/resources/webapp/WEB-INF/web.xml 2011-04-12 00:56:51 UTC (rev 873)
@@ -0,0 +1,15 @@
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" 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">
+
+ <servlet>
+ <display-name>POJO Web Service</display-name>
+ <servlet-name>POJOBeanService</servlet-name>
+ <servlet-class>org.picketlink.test.trust.ws.POJOBean</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>POJOBeanService</servlet-name>
+ <url-pattern>/POJOBeanService</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
13 years, 6 months
Picketlink SVN: r872 - in trust/trunk/jbossws: src and 14 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-11 20:55:10 -0400 (Mon, 11 Apr 2011)
New Revision: 872
Added:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthorizationHandler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/util/
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/util/JBossWSSERoleExtractor.java
trust/trunk/jbossws/src/test/
trust/trunk/jbossws/src/test/java/
trust/trunk/jbossws/src/test/java/org/
trust/trunk/jbossws/src/test/java/org/picketlink/
trust/trunk/jbossws/src/test/java/org/picketlink/test/
trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/
trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/
trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/xml/
trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/xml/JBossWSSEFileParseTestCase.java
trust/trunk/jbossws/src/test/resources/
trust/trunk/jbossws/src/test/resources/jbossws/
trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/
trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-ops.xml
trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-role.xml
trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-roles.xml
trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-unchecked.xml
Modified:
trust/trunk/jbossws/.classpath
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SecurityActions.java
Log:
PLFED-167: handlers for auth/authz for POJO WS
Modified: trust/trunk/jbossws/.classpath
===================================================================
--- trust/trunk/jbossws/.classpath 2011-04-12 00:53:50 UTC (rev 871)
+++ trust/trunk/jbossws/.classpath 2011-04-12 00:55:10 UTC (rev 872)
@@ -1,39 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.1/ant-1.7.1.jar" sourcepath="M2_REPO/org/apache/ant/ant/1.7.1/ant-1.7.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar" sourcepath="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/gnu-getopt/getopt/1.0.13/getopt-1.0.13.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jaxbintros/jboss-jaxb-intros/1.0.2.GA/jboss-jaxb-intros-1.0.2.GA.jar" sourcepath="M2_REPO/jboss/jaxbintros/jboss-jaxb-intros/1.0.2.GA/jboss-jaxb-intros-1.0.2.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/spec/javax/xml/ws/jboss-jaxws-api_2.2_spec/1.0.0.Final/jboss-jaxws-api_2.2_spec-1.0.0.Final.jar" sourcepath="M2_REPO/org/jboss/spec/javax/xml/ws/jboss-jaxws-api_2.2_spec/1.0.0.Final/jboss-jaxws-api_2.2_spec-1.0.0.Final-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketbox/jboss-security-spi/3.0.0.Final/jboss-security-spi-3.0.0.Final.jar" sourcepath="M2_REPO/org/picketbox/jboss-security-spi/3.0.0.Final/jboss-security-spi-3.0.0.Final-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketbox/jbosssx/3.0.0.Final/jbosssx-3.0.0.Final.jar" sourcepath="M2_REPO/org/picketbox/jbosssx/3.0.0.Final/jbosssx-3.0.0.Final-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/ws/jbossws-common/1.4.1.GA/jbossws-common-1.4.1.GA.jar" sourcepath="M2_REPO/org/jboss/ws/jbossws-common/1.4.1.GA/jbossws-common-1.4.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/ws/jbossws-spi/1.4.1.GA/jbossws-spi-1.4.1.GA.jar" sourcepath="M2_REPO/org/jboss/ws/jbossws-spi/1.4.1.GA/jbossws-spi-1.4.1.GA-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/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-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/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/openid4java/openid4java-nodeps/0.9.5/openid4java-nodeps-0.9.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-bindings/2.0.0-SNAPSHOT/picketlink-bindings-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-bindings/2.0.0-SNAPSHOT/picketlink-bindings-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-bindings-jboss/2.0.0-SNAPSHOT/picketlink-bindings-jboss-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-bindings-jboss/2.0.0-SNAPSHOT/picketlink-bindings-jboss-2.0.0-SNAPSHOT-sources.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/org/picketlink/picketlink-fed-api/2.0.0-SNAPSHOT/picketlink-fed-api-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-api/2.0.0-SNAPSHOT/picketlink-fed-api-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed-core/2.0.0-SNAPSHOT/picketlink-fed-core-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-core/2.0.0-SNAPSHOT/picketlink-fed-core-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed-model/2.0.0-SNAPSHOT/picketlink-fed-model-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-model/2.0.0-SNAPSHOT/picketlink-fed-model-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-web/2.0.0-SNAPSHOT/picketlink-web-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-web/2.0.0-SNAPSHOT/picketlink-web-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-xmlsec-model/2.0.0-SNAPSHOT/picketlink-xmlsec-model-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-xmlsec-model/2.0.0-SNAPSHOT/picketlink-xmlsec-model-2.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.3/xmlsec-1.4.3.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-</classpath>
\ No newline at end of file
+ <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.1/ant-1.7.1.jar" sourcepath="M2_REPO/org/apache/ant/ant/1.7.1/ant-1.7.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar" sourcepath="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/gnu-getopt/getopt/1.0.13/getopt-1.0.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jaxbintros/jboss-jaxb-intros/1.0.2.GA/jboss-jaxb-intros-1.0.2.GA.jar" sourcepath="M2_REPO/jboss/jaxbintros/jboss-jaxb-intros/1.0.2.GA/jboss-jaxb-intros-1.0.2.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/spec/javax/xml/ws/jboss-jaxws-api_2.2_spec/1.0.0.Final/jboss-jaxws-api_2.2_spec-1.0.0.Final.jar" sourcepath="M2_REPO/org/jboss/spec/javax/xml/ws/jboss-jaxws-api_2.2_spec/1.0.0.Final/jboss-jaxws-api_2.2_spec-1.0.0.Final-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketbox/jboss-security-spi/3.0.0.Final/jboss-security-spi-3.0.0.Final.jar" sourcepath="M2_REPO/org/picketbox/jboss-security-spi/3.0.0.Final/jboss-security-spi-3.0.0.Final-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketbox/jbosssx/3.0.0.Final/jbosssx-3.0.0.Final.jar" sourcepath="M2_REPO/org/picketbox/jbosssx/3.0.0.Final/jbosssx-3.0.0.Final-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/ws/jbossws-common/1.4.1.GA/jbossws-common-1.4.1.GA.jar" sourcepath="M2_REPO/org/jboss/ws/jbossws-common/1.4.1.GA/jbossws-common-1.4.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/ws/jbossws-spi/1.4.1.GA/jbossws-spi-1.4.1.GA.jar" sourcepath="M2_REPO/org/jboss/ws/jbossws-spi/1.4.1.GA/jbossws-spi-1.4.1.GA-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/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-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/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/openid4java/openid4java-nodeps/0.9.5/openid4java-nodeps-0.9.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-bindings/2.0.0-SNAPSHOT/picketlink-bindings-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-bindings/2.0.0-SNAPSHOT/picketlink-bindings-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-bindings-jboss/2.0.0-SNAPSHOT/picketlink-bindings-jboss-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-bindings-jboss/2.0.0-SNAPSHOT/picketlink-bindings-jboss-2.0.0-SNAPSHOT-sources.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/org/picketlink/picketlink-fed-api/2.0.0-SNAPSHOT/picketlink-fed-api-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-api/2.0.0-SNAPSHOT/picketlink-fed-api-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed-core/2.0.0-SNAPSHOT/picketlink-fed-core-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-core/2.0.0-SNAPSHOT/picketlink-fed-core-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed-model/2.0.0-SNAPSHOT/picketlink-fed-model-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed-model/2.0.0-SNAPSHOT/picketlink-fed-model-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-web/2.0.0-SNAPSHOT/picketlink-web-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-web/2.0.0-SNAPSHOT/picketlink-web-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-xmlsec-model/2.0.0-SNAPSHOT/picketlink-xmlsec-model-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-xmlsec-model/2.0.0-SNAPSHOT/picketlink-xmlsec-model-2.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.3/xmlsec-1.4.3.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java (rev 0)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,196 @@
+/*
+ * 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.trust.jbossws.handler;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.AuthorizationManager;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.picketlink.identity.federation.core.exceptions.ProcessingException;
+import org.picketlink.identity.federation.core.wstrust.SamlCredential;
+import org.picketlink.trust.jbossws.Constants;
+import org.picketlink.trust.jbossws.Util;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Abstract base class for the PicketLink Trust Handlers
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+@SuppressWarnings("rawtypes")
+public abstract class AbstractPicketLinkTrustHandler extends GenericSOAPHandler
+{
+ protected Logger log = Logger.getLogger(this.getClass());
+ protected boolean trace = log.isTraceEnabled();
+
+ protected static Set<QName> headers;
+
+ protected static final String SEC_MGR_LOOKUP = "java:comp/env/security/securityMgr";
+ protected static final String AUTHZ_MGR_LOOKUP = "java:comp/env/security/authorizationMgr";
+
+ protected SecurityAdaptorFactory secAdapterfactory;
+
+ static
+ {
+ HashSet<QName> set = new HashSet<QName>();
+ set.add(Constants.WSSE_HEADER_QNAME);
+ headers = Collections.unmodifiableSet(set);
+ }
+
+ public Set<QName> getHeaders()
+ {
+ //return a collection with just the wsse:Security header to pass the MustUnderstand check on it
+ return headers;
+ }
+
+ /**
+ * Get the JBoss Authentication Manager {@link AuthenticationManager} from JNDI
+ * @return
+ * @throws NamingException
+ */
+ protected AuthenticationManager getAuthenticationManager()
+ {
+ if( secAdapterfactory == null)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+ return (AuthenticationManager) lookupJNDI(SEC_MGR_LOOKUP);
+ }
+
+ /**
+ * Get the JBoss Authorization Manager {@link AuthorizationManager} from JNDI
+ * @return
+ * @throws NamingException
+ */
+ protected AuthorizationManager getAuthorizationManager()
+ {
+ if( secAdapterfactory == null)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+ return (AuthorizationManager)lookupJNDI(AUTHZ_MGR_LOOKUP);
+ }
+
+ /**
+ * Given a {@link Document}, create the WSSE element
+ * @param document
+ * @return
+ */
+ protected Element getSecurityHeaderElement(Document document)
+ {
+ Element element = document.createElementNS(Constants.WSSE_NS, Constants.WSSE_HEADER);
+ Util.addNamespace(element, Constants.WSSE_PREFIX, Constants.WSSE_NS);
+ Util.addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
+ Util.addNamespace(element, Constants.XML_ENCRYPTION_PREFIX, Constants.XML_SIGNATURE_NS);
+ return element;
+ }
+
+ /**
+ * Given the NameID {@link Element}, return the user name
+ * @param nameID
+ * @return
+ */
+ protected String getUsername(final Element nameID)
+ {
+ String username = nameID.getNodeValue();
+ if (username == null) {
+ final NodeList childNodes = nameID.getChildNodes();
+ final int size = childNodes.getLength();
+ for (int i = 0; i < size; i++) {
+ final Node childNode = childNodes.item(i);
+ if (childNode.getNodeType() == Node.TEXT_NODE) {
+ username = childNode.getNodeValue();
+ }
+ }
+ }
+ return username;
+ }
+
+ /**
+ * Get the SAML Assertion from the subject
+ * @return
+ */
+ protected Element getAssertionFromSubject()
+ {
+ Element assertion = null;
+ Subject subject = SecurityActions.getAuthenticatedSubject();
+
+ if(subject == null)
+ {
+ log.error("null subject, cannot extract SAML token required for WS-TRUST");
+ return assertion;
+ }
+
+ Set<Object> creds = subject.getPublicCredentials();
+ if( creds != null )
+ {
+ for( Object cred: creds)
+ {
+ if( cred instanceof SamlCredential)
+ {
+ SamlCredential samlCredential = (SamlCredential) cred;
+ try
+ {
+ assertion = samlCredential.getAssertionAsElement();
+ }
+ catch (ProcessingException e)
+ {
+ log.error("failed to process SAML credential", e);
+ }
+ break;
+ }
+ }
+ }
+ return assertion;
+ }
+
+ private Object lookupJNDI( String str)
+ {
+ try
+ {
+ Context context = new InitialContext();
+ return context.lookup(str);
+ }
+ catch (NamingException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
\ No newline at end of file
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-04-12 00:53:50 UTC (rev 871)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -21,10 +21,6 @@
*/
package org.picketlink.trust.jbossws.handler;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
@@ -37,8 +33,6 @@
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.apache.log4j.Logger;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
import org.picketlink.trust.jbossws.Constants;
import org.picketlink.trust.jbossws.Util;
@@ -76,14 +70,8 @@
* @author Anil.Saldhana(a)redhat.com
* @since Apr 5, 2011
*/
-@SuppressWarnings("rawtypes")
-public class BinaryTokenHandler extends GenericSOAPHandler
+public class BinaryTokenHandler extends AbstractPicketLinkTrustHandler
{
- protected static Logger log = Logger.getLogger(BinaryTokenHandler.class);
- protected boolean trace = log.isTraceEnabled();
-
- private static Set<QName> headers;
-
/**
* The HTTP header name that this token looks for. Either this or the httpCookieName should be set.
*/
@@ -121,13 +109,6 @@
private boolean cleanToken = Boolean.parseBoolean(SecurityActions.getSystemProperty("binary.http.cleanToken", "false"));
private SOAPFactory factory = null;
-
- static
- {
- HashSet<QName> set = new HashSet<QName>();
- set.add(Constants.WSSE_HEADER_QNAME);
- headers = Collections.unmodifiableSet(set);
- }
/**
* <p> Set the EncodingType value.</p>
@@ -173,12 +154,6 @@
this.valueTypePrefix = binaryValuePrefix;
}
- public Set<QName> getHeaders()
- {
- //return a collection with just the wsse:Security header to pass the MustUnderstand check on it
- return headers;
- }
-
/**
* <p>
* Set the Http Header Name
@@ -226,7 +201,12 @@
@Override
protected boolean handleOutbound(MessageContext msgContext)
- {
+ {
+ if(trace)
+ {
+ log.trace("Handling Outbound Message");
+ }
+
if( httpHeaderName == null && httpCookieName == null )
throw new RuntimeException("Either httpHeaderName or httpCookieName should be set" );
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-04-12 00:53:50 UTC (rev 871)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -21,30 +21,20 @@
*/
package org.picketlink.trust.jbossws.handler;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
import javax.security.auth.Subject;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.logging.Logger;
import org.jboss.security.SecurityContext;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
import org.picketlink.identity.federation.bindings.jboss.subject.PicketLinkPrincipal;
-import org.picketlink.identity.federation.core.exceptions.ProcessingException;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import org.picketlink.identity.federation.core.wstrust.SamlCredential;
-import org.picketlink.trust.jbossws.Constants;
import org.picketlink.trust.jbossws.SAML2Constants;
import org.picketlink.trust.jbossws.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* A SAMLv2 WS handler.
@@ -54,32 +44,17 @@
* @author Anil Saldhana
* @version $Revision: 1 $
*/
-@SuppressWarnings("rawtypes")
-public class SAML2Handler extends GenericSOAPHandler
-{
-
- protected Logger log = Logger.getLogger(this.getClass());
-
- private static Set<QName> headers;
-
- static
- {
- HashSet<QName> set = new HashSet<QName>();
- set.add(Constants.WSSE_HEADER_QNAME);
- headers = Collections.unmodifiableSet(set);
- }
-
- public Set<QName> getHeaders()
- {
- //return a collection with just the wsse:Security header to pass the MustUnderstand check on it
- return headers;
- }
-
+public class SAML2Handler extends AbstractPicketLinkTrustHandler
+{
/**
* Retrieves the SAML assertion from the SOAP payload and lets invocation go to JAAS for validation.
*/
protected boolean handleInbound(MessageContext msgContext)
- {
+ {
+ if(trace)
+ {
+ log.trace("Handling Inbound Message");
+ }
String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
SOAPMessageContext ctx = (SOAPMessageContext) msgContext;
SOAPMessage soapMessage = ctx.getMessage();
@@ -104,6 +79,10 @@
SecurityContext sc = SecurityActions.createSecurityContext(new PicketLinkPrincipal(username), credential, s);
SecurityActions.setSecurityContext(sc);
}
+ else
+ {
+ log.warn("We did not find any assertion");
+ }
return true;
}
@@ -113,7 +92,11 @@
* This assertion is then included in the SOAP payload.
*/
protected boolean handleOutbound(MessageContext msgContext)
- {
+ {
+ if(trace)
+ {
+ log.trace("Handling Outbound Message");
+ }
SOAPMessageContext ctx = (SOAPMessageContext) msgContext;
SOAPMessage soapMessage = ctx.getMessage();
@@ -155,63 +138,5 @@
}
return true;
- }
-
- private Element getSecurityHeaderElement(Document document)
- {
- Element element = document.createElementNS(Constants.WSSE_NS, Constants.WSSE_HEADER);
- Util.addNamespace(element, Constants.WSSE_PREFIX, Constants.WSSE_NS);
- Util.addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
- Util.addNamespace(element, Constants.XML_ENCRYPTION_PREFIX, Constants.XML_SIGNATURE_NS);
- return element;
- }
-
- private String getUsername(final Element nameID) {
- String username = nameID.getNodeValue();
- if (username == null) {
- final NodeList childNodes = nameID.getChildNodes();
- final int size = childNodes.getLength();
- for (int i = 0; i < size; i++) {
- final Node childNode = childNodes.item(i);
- if (childNode.getNodeType() == Node.TEXT_NODE) {
- username = childNode.getNodeValue();
- }
- }
- }
- return username;
- }
-
- private Element getAssertionFromSubject()
- {
- Element assertion = null;
- Subject subject = SecurityActions.getAuthenticatedSubject();
-
- if(subject == null)
- {
- log.error("null subject, cannot extract SAML token required for WS-TRUST");
- return assertion;
- }
-
- Set<Object> creds = subject.getPublicCredentials();
- if( creds != null )
- {
- for( Object cred: creds)
- {
- if( cred instanceof SamlCredential)
- {
- SamlCredential samlCredential = (SamlCredential) cred;
- try
- {
- assertion = samlCredential.getAssertionAsElement();
- }
- catch (ProcessingException e)
- {
- log.error("failed to process SAML credential", e);
- }
- break;
- }
- }
- }
- return assertion;
- }
+ }
}
\ No newline at end of file
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SecurityActions.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SecurityActions.java 2011-04-12 00:53:50 UTC (rev 871)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SecurityActions.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -105,4 +105,26 @@
}
});
}
+
+ static ClassLoader getClassLoader( final Class<?> clazz)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return clazz.getClassLoader();
+ }
+ });
+ }
+
+ static ClassLoader getContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
}
\ No newline at end of file
Added: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java (rev 0)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,72 @@
+/*
+ * 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.trust.jbossws.handler;
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.security.AuthenticationManager;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+
+/**
+ * Perform Authentication for POJO Web Services
+ *
+ * Based on the Authorize Operation on the JBossWS Native stack
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+public class WSAuthenticationHandler extends AbstractPicketLinkTrustHandler
+{
+ @Override
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ if(trace)
+ {
+ log.trace("Handling Inbound Message");
+ }
+ AuthenticationManager authenticationManager = getAuthenticationManager();
+ SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
+
+ Subject subject = new Subject();
+
+ if (authenticationManager.isValid(principal, credential, subject) == false)
+ {
+ String msg = "Authentication failed, principal=" + principal;
+ log.error(msg);
+ SecurityException e = new SecurityException(msg);
+ throw new RuntimeException(e);
+ }
+ if(trace)
+ {
+ log.trace("Successfully Authenticated:Principal="+principal + "::subject="+subject);
+ }
+ securityAdaptor.pushSubjectContext(subject, principal, credential);
+
+ return true;
+ }
+}
\ No newline at end of file
Added: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthorizationHandler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthorizationHandler.java (rev 0)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthorizationHandler.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,123 @@
+/*
+ * 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.trust.jbossws.handler;
+
+import java.io.InputStream;
+import java.security.Principal;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.servlet.ServletContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.security.AuthorizationManager;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.picketlink.trust.jbossws.util.JBossWSSERoleExtractor;
+
+/**
+ * An authorization handler for the POJO Web services
+ * Based on the Authorize Operation on the JBossWS Native stack
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+public class WSAuthorizationHandler extends AbstractPicketLinkTrustHandler
+{
+ @Override
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ if(trace)
+ {
+ log.trace("Handling Inbound Message");
+ }
+ ServletContext context = (ServletContext) msgContext.get(MessageContext.SERVLET_CONTEXT);
+ //Read the jboss-wsse.xml file
+ InputStream is = getWSSE(context);
+ if( is == null )
+ throw new RuntimeException( "unable to load jboss-wsse.xml");
+
+ QName portName = (QName) msgContext.get(MessageContext.WSDL_PORT);
+ QName opName = (QName) msgContext.get(MessageContext.WSDL_OPERATION);
+ List<String> roles = JBossWSSERoleExtractor.getRoles(is, portName.getLocalPart(), opName.toString());
+ if( !roles.contains("unchecked"))
+ {
+ AuthorizationManager authorizationManager = getAuthorizationManager();
+
+ SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
+ Principal principal = securityAdaptor.getPrincipal();
+ Subject subject = SecurityActions.getAuthenticatedSubject();
+
+ Set<Principal> expectedRoles = rolesSet(roles);
+ if(!authorizationManager.doesUserHaveRole(principal, expectedRoles ))
+ {
+ StringBuilder builder = new StringBuilder("Authorization Failed:Principal=");
+ builder.append(principal).append(":Expected Roles=").append(expectedRoles);
+ builder.append("::Actual Roles=").append(authorizationManager.getSubjectRoles(subject,null));
+ log.error(builder.toString() );
+
+ throw new RuntimeException("Authorization Failed");
+ }
+ }
+ return true;
+ }
+
+ protected Set<Principal> rolesSet(List<String> roles)
+ {
+ Set<Principal> principals = new HashSet<Principal>();
+ for( String role: roles)
+ {
+ principals.add(new SimplePrincipal(role));
+ }
+ return principals;
+ }
+
+ protected InputStream getWSSE(ServletContext context)
+ {
+ if( context == null )
+ throw new RuntimeException("Servlet Context is null");
+
+ InputStream is = context.getResourceAsStream("/WEB-INF/jboss-wsse.xml");
+ /*InputStream is = null;
+ ClassLoader cl = SecurityActions.getClassLoader(getClass());
+ is = load(cl);
+ if( is == null)
+ {
+ cl = SecurityActions.getContextClassLoader();
+ is = load(cl);
+ }*/
+ return is;
+ }
+
+ protected InputStream load( ClassLoader cl)
+ {
+ InputStream is = null;
+ is = cl.getResourceAsStream("WEB-INF/jboss-wsse.xml");
+ if( is == null)
+ is = cl.getResourceAsStream("/WEB-INF/jboss-wsse.xml");
+ return is;
+ }
+}
\ No newline at end of file
Added: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/util/JBossWSSERoleExtractor.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/util/JBossWSSERoleExtractor.java (rev 0)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/util/JBossWSSERoleExtractor.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,176 @@
+/*
+ * 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.trust.jbossws.util;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.picketlink.identity.federation.core.exceptions.ProcessingException;
+import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Given a jboss-wsse.xml file, extract the roles
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+public class JBossWSSERoleExtractor
+{
+ /**
+ * <p>
+ * Given the jboss-wsse.xml inputstream, return the configured roles
+ * </p>
+ * <p>
+ * Note that the <unchecked/> setting will yield a role of unchecked.
+ * So special handling needs to be done by the caller.
+ * </p>
+ * @param is
+ * @param portName optionally pass in a portName
+ * @return a {@link List} of role names
+ */
+ public static List<String> getRoles(InputStream is, String portName, String operationName)
+ {
+ List<String> roles = new ArrayList<String>();
+ try
+ {
+ Document doc = DocumentUtil.getDocument(is);
+ NodeList nl = doc.getElementsByTagName("port");
+ if( nl != null )
+ {
+ int len = nl.getLength();
+ if( len > 0)
+ {
+ Node portNode = getNamedNode(nl, portName);
+ if( portNode != null)
+ {
+ roles.addAll( getRoles(portNode, operationName));
+ return roles;
+ }
+ }
+ return getDefaultRoles(doc.getDocumentElement());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return roles;
+ }
+
+ private static Node getNamedNode( NodeList nl, String portName)
+ {
+ int len = nl.getLength();
+ for( int i = 0; i < len; i++)
+ {
+ Node n = nl.item(i);
+ if( n.getNodeType() == Node.ELEMENT_NODE)
+ {
+ Node name = n.getAttributes().getNamedItem("name");
+ if( portName.equals(name.getNodeValue()))
+ return n;
+ }
+ }
+ return null;
+ }
+
+ private static List<String> getRoles(Node node, String operationName) throws ProcessingException
+ {
+ List<String> roles = new ArrayList<String>();
+
+ Element elem = (Element) node;
+ //First check for operations
+ NodeList ops = elem.getElementsByTagName("operation");
+ if(ops.getLength() > 0 )
+ {
+ Node opNode = getNamedNode( ops, operationName);
+ if( opNode != null)
+ return getDefaultRoles((Element) opNode);
+ return roles;
+ }
+ NodeList nl = elem.getElementsByTagName("authorize");
+ if( nl != null )
+ {
+ int len = nl.getLength();
+
+ if( len > 1 )
+ throw new ProcessingException( "More than one authorize element");
+ Node authorize = nl.item(0);
+ roles.addAll(getRolesFromAuthorize((Element) authorize));
+ }
+ return roles;
+ }
+
+ private static List<String> getDefaultRoles(Element root) throws ProcessingException
+ {
+ List<String> roles = new ArrayList<String>();
+ NodeList children = root.getChildNodes();
+ if( children != null )
+ {
+ int len = children.getLength();
+ //Go down tree and if you hit port, return
+ for( int i = 0 ; i <len ; i++ )
+ {
+ Node n = children.item(i);
+ if(n.getNodeType() == Node.ELEMENT_NODE)
+ {
+ Element newNode = (Element) n;
+ if( newNode.getNodeName().equals("port"))
+ return roles;
+ else if( newNode.getNodeName().equals("authorize"))
+ return getRolesFromAuthorize(newNode);
+ else
+ roles = getDefaultRoles(newNode);
+ }
+ }
+ }
+ return roles;
+ }
+
+ private static List<String> getRolesFromAuthorize( Element authorize)
+ {
+ List<String> roles = new ArrayList<String>();
+ NodeList children = authorize.getChildNodes();
+
+ int len = children.getLength();
+ for( int i = 0 ; i < len; i++ )
+ {
+ Node child = children.item(i);
+ if( child instanceof Element)
+ {
+ String nodeName = child.getNodeName();
+ if( "unchecked".equals( nodeName) )
+ {
+ roles.add(nodeName);
+ }
+ else if("role".equals(nodeName))
+ {
+ roles.add(child.getChildNodes().item(0).getNodeValue());
+ }
+ }
+ }
+ return roles;
+ }
+}
\ No newline at end of file
Added: trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/xml/JBossWSSEFileParseTestCase.java
===================================================================
--- trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/xml/JBossWSSEFileParseTestCase.java (rev 0)
+++ trust/trunk/jbossws/src/test/java/org/picketlink/test/trust/jbossws/xml/JBossWSSEFileParseTestCase.java 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,125 @@
+/*
+ * 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.trust.jbossws.xml;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.junit.Test;
+import org.picketlink.trust.jbossws.util.JBossWSSERoleExtractor;
+
+/**
+ * Unit test the parsing of the jboss-wsse.xml for the roles
+ *
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+public class JBossWSSEFileParseTestCase
+{
+ @Test
+ public void testUnchecked() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-unchecked.xml");
+ assertNotNull(is);
+
+ List<String> roles = JBossWSSERoleExtractor.getRoles(is, null, null);
+ assertNotNull(roles);
+ assertEquals( 1, roles.size());
+ assertEquals( "unchecked", roles.get(0));
+ }
+
+ @Test
+ public void testRoles() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-roles.xml");
+ assertNotNull(is);
+
+ List<String> roles = JBossWSSERoleExtractor.getRoles(is, null, null);
+ assertNotNull(roles);
+ assertEquals( 2, roles.size());
+ assertTrue( roles.contains("friend"));
+ assertTrue( roles.contains("family"));
+ }
+
+ @Test
+ public void testRolesForPort() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-role.xml");
+ assertNotNull(is);
+
+ List<String> roles = JBossWSSERoleExtractor.getRoles(is, "TestPort", null);
+ assertNotNull(roles);
+ assertEquals( 1, roles.size());
+ assertTrue( roles.contains("Trader"));
+
+ is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-role.xml");
+ assertNotNull(is);
+ roles = JBossWSSERoleExtractor.getRoles(is, "MaxiPort", null);
+ assertNotNull(roles);
+ assertEquals( 3, roles.size());
+ assertTrue( roles.contains("Trader"));
+ assertTrue( roles.contains("friend"));
+ assertTrue( roles.contains("family"));
+
+ is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-role.xml");
+ assertNotNull(is);
+ roles = JBossWSSERoleExtractor.getRoles(is, "NonExistingPort", null);
+ assertNotNull(roles);
+ assertEquals( 1, roles.size());
+ assertTrue( roles.contains("Trader"));
+ }
+
+ @Test
+ public void testRolesForPortOps() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-ops.xml");
+ assertNotNull(is);
+
+ List<String> roles = JBossWSSERoleExtractor.getRoles(is, "POJOBeanPort", "{http://ws.trust.test.picketlink.org/}echoUnchecked");
+ assertNotNull(roles);
+ assertEquals( 1, roles.size());
+ assertTrue( roles.contains("unchecked"));
+
+ is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-ops.xml");
+ assertNotNull(is);
+ roles = JBossWSSERoleExtractor.getRoles(is, "POJOBeanPort", "{http://ws.trust.test.picketlink.org/}echo");
+ assertNotNull(roles);
+ assertEquals( 1, roles.size());
+ assertTrue( roles.contains("JBossAdmin"));
+
+ is = tcl.getResourceAsStream("jbossws/jboss-wsse/jboss-wsse-port-ops.xml");
+ assertNotNull(is);
+ roles = JBossWSSERoleExtractor.getRoles(is, "NonExistingPort", null);
+ assertNotNull(roles);
+ assertEquals( 2, roles.size());
+ assertTrue( roles.contains("friend"));
+ assertTrue( roles.contains("family"));
+ }
+}
\ No newline at end of file
Added: trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-ops.xml
===================================================================
--- trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-ops.xml (rev 0)
+++ trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-ops.xml 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,30 @@
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <authorize>
+ <role>friend</role>
+ <role>family</role>
+ </authorize>
+ </config>
+
+ <port name="POJOBeanPort">
+ <operation name="{http://ws.trust.test.picketlink.org/}echoUnchecked">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.trust.test.picketlink.org/}echo">
+ <config>
+ <authorize>
+ <role>JBossAdmin</role>
+ </authorize>
+ </config>
+ </operation>
+ </port>
+</jboss-ws-security>
\ No newline at end of file
Added: trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-role.xml
===================================================================
--- trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-role.xml (rev 0)
+++ trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-port-role.xml 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,29 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+ </port>
+
+ <port name="MaxiPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ <role>friend</role>
+ <role>family</role>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Added: trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-roles.xml
===================================================================
--- trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-roles.xml (rev 0)
+++ trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-roles.xml 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,10 @@
+<jboss-ws-security>
+
+ <config>
+ <authorize>
+ <role>friend</role>
+ <role>family</role>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Added: trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-unchecked.xml
===================================================================
--- trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-unchecked.xml (rev 0)
+++ trust/trunk/jbossws/src/test/resources/jbossws/jboss-wsse/jboss-wsse-unchecked.xml 2011-04-12 00:55:10 UTC (rev 872)
@@ -0,0 +1,9 @@
+<jboss-ws-security>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
13 years, 6 months
Picketlink SVN: r871 - trust/trunk/jbossws.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-11 20:53:50 -0400 (Mon, 11 Apr 2011)
New Revision: 871
Modified:
trust/trunk/jbossws/pom.xml
Log:
add junit
Modified: trust/trunk/jbossws/pom.xml
===================================================================
--- trust/trunk/jbossws/pom.xml 2011-04-11 14:23:40 UTC (rev 870)
+++ trust/trunk/jbossws/pom.xml 2011-04-12 00:53:50 UTC (rev 871)
@@ -84,6 +84,14 @@
<artifactId>jboss-logging-spi</artifactId>
<version>2.1.0.GA</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+
+
</dependencies>
<reporting>
13 years, 6 months
Picketlink SVN: r870 - federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-11 10:23:40 -0400 (Mon, 11 Apr 2011)
New Revision: 870
Added:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/PicketLinkAuthenticator.java
Log:
PLFED-169: a tomcat authenticator that delegates to the realm
Added: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/PicketLinkAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/PicketLinkAuthenticator.java (rev 0)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/PicketLinkAuthenticator.java 2011-04-11 14:23:40 UTC (rev 870)
@@ -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.identity.federation.bindings.tomcat;
+
+import java.io.IOException;
+import java.security.Principal;
+
+import org.apache.catalina.Realm;
+import org.apache.catalina.authenticator.AuthenticatorBase;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.log4j.Logger;
+
+/**
+ * An authenticator that delegates actual authentication to a realm, and in turn to a security
+ * manager, by presenting a "conventional" identity. The security manager must accept the
+ * conventional identity and generate the real identity for the authenticated principal.
+ *
+ * @author <a href="mailto:ovidiu@novaordis.com">Ovidiu Feodorov</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 11, 2011
+ */
+public class PicketLinkAuthenticator extends AuthenticatorBase
+{
+ protected static Logger log = Logger.getLogger(PicketLinkAuthenticator.class);
+
+ protected boolean trace = log.isTraceEnabled();
+
+ /**
+ * The {@link Realm} requires an user name
+ */
+ protected String userName = "custom-authenticator-user";
+
+ /**
+ * The {@link Realm} requires a password
+ */
+ protected String password = "custom-authenticator-password";
+
+ /**
+ * This is the auth method used in the register method
+ */
+ protected String authMethod = "SECURITY_DOMAIN";
+
+ public PicketLinkAuthenticator()
+ {
+ if (trace)
+ {
+ log.trace("PicketLinkAuthenticator Created");
+ }
+ }
+
+ /**
+ * Set the user name via WEB-INF/context.xml (JBoss AS)
+ * @param defaultUserName
+ */
+ public void setUserName(String defaultUserName)
+ {
+ this.userName = defaultUserName;
+ }
+
+ /**
+ * Set the password via WEB-INF/context.xml (JBoss AS)
+ * @param defaultPassword
+ */
+ public void setPassword(String defaultPassword)
+ {
+ this.password = defaultPassword;
+ }
+
+ /**
+ * Set the auth method via WEB-INF/context.xml (JBoss AS)
+ * @param authMethod
+ */
+ public void setAuthMethod(String authMethod)
+ {
+ this.authMethod = authMethod;
+ }
+
+ @Override
+ protected boolean authenticate(Request request, Response response, LoginConfig loginConfig) throws IOException
+ {
+ Realm realm = context.getRealm();
+
+ Principal principal = realm.authenticate(this.userName, this.password);
+
+ if (principal != null)
+ {
+ register(request, response, principal, this.authMethod, null, null);
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
13 years, 6 months