Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/ValidateTokenAction.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/ValidateTokenAction.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/ValidateTokenAction.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/ValidateTokenAction.java Mon Feb 3 13:05:08 2014 @@ -21,7 +21,6 @@ package org.apache.cxf.fediz.service.idp import java.io.IOException; import org.w3c.dom.Element; - import org.apache.cxf.fediz.core.FederationConstants; import org.apache.cxf.fediz.core.FederationProcessor; import org.apache.cxf.fediz.core.FederationProcessorImpl; @@ -43,7 +42,7 @@ import org.apache.cxf.fediz.service.idp. import org.apache.cxf.fediz.service.idp.domain.TrustedIdp; import org.apache.cxf.fediz.service.idp.util.WebUtils; import org.apache.cxf.ws.security.tokenstore.SecurityToken; -import org.apache.ws.security.util.UUIDGenerator; +import org.apache.xml.security.stax.impl.util.IDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.webflow.execution.RequestContext; @@ -109,7 +108,7 @@ public class ValidateTokenAction { // Create new Security token with new id. // Parameters for freshness computation are copied from original IDP_TOKEN - String id = "_" + UUIDGenerator.getUUID(); + String id = IDGenerator.generateID("_"); SecurityToken idpToken = new SecurityToken(id, wfResp.getTokenCreated(), wfResp.getTokenExpires());
Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java Mon Feb 3 13:05:08 2014 @@ -22,8 +22,8 @@ package org.apache.cxf.fediz.service.idp import java.net.URI; import java.util.List; +import javax.ws.rs.BadRequestException; import javax.ws.rs.NotFoundException; -import javax.ws.rs.ValidationException; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -94,7 +94,7 @@ public class ApplicationServiceImpl impl @Override public Response updateApplication(UriInfo ui, String realm, Application application) { if (!realm.equals(application.getRealm().toString())) { - throw new ValidationException(Status.BAD_REQUEST); + throw new BadRequestException(); } if (application.getRequestedClaims() != null && application.getRequestedClaims().size() > 0) { LOG.warn("Application resource contains sub resource 'claims'"); Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ClaimServiceImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ClaimServiceImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ClaimServiceImpl.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/ClaimServiceImpl.java Mon Feb 3 13:05:08 2014 @@ -22,10 +22,9 @@ package org.apache.cxf.fediz.service.idp import java.net.URI; import java.util.List; +import javax.ws.rs.BadRequestException; import javax.ws.rs.NotFoundException; -import javax.ws.rs.ValidationException; import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -87,7 +86,7 @@ public class ClaimServiceImpl implements @Override public Response updateClaim(UriInfo ui, String claimType, Claim claim) { if (!claimType.equals(claim.getClaimType().toString())) { - throw new ValidationException(Status.BAD_REQUEST); + throw new BadRequestException(); } claimDAO.updateClaim(claimType, claim); Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java Mon Feb 3 13:05:08 2014 @@ -23,8 +23,8 @@ import java.net.URI; import java.util.Arrays; import java.util.List; +import javax.ws.rs.BadRequestException; import javax.ws.rs.NotFoundException; -import javax.ws.rs.ValidationException; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -103,7 +103,7 @@ public class IdpServiceImpl implements I @Override public Response updateIdp(UriInfo ui, String realm, Idp idp) { if (!realm.equals(idp.getRealm().toString())) { - throw new ValidationException(Status.BAD_REQUEST); + throw new BadRequestException(); } if (idp.getApplications() != null && idp.getApplications().size() > 0) { LOG.warn("IDP resource contains sub resource 'applications'"); Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/RestServiceExceptionMapper.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/RestServiceExceptionMapper.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/RestServiceExceptionMapper.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/RestServiceExceptionMapper.java Mon Feb 3 13:05:08 2014 @@ -22,7 +22,6 @@ import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; -import org.apache.cxf.jaxrs.client.ResponseExceptionMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataIntegrityViolationException; @@ -31,7 +30,7 @@ import org.springframework.dao.EmptyResu import org.springframework.security.access.AccessDeniedException; @Provider -public class RestServiceExceptionMapper implements ExceptionMapper<Exception>, ResponseExceptionMapper<Exception> { +public class RestServiceExceptionMapper implements ExceptionMapper<Exception> { private static final String BASIC_REALM_UNAUTHORIZED = "Basic realm=\"Apache Fediz authentication\""; @@ -66,10 +65,4 @@ public class RestServiceExceptionMapper return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } - @Override - public Exception fromResponse(final Response r) { - throw new UnsupportedOperationException( - "Call of fromResponse() method is not expected"); - } - } Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java Mon Feb 3 13:05:08 2014 @@ -22,9 +22,8 @@ package org.apache.cxf.fediz.service.idp import java.net.URI; import java.util.List; -import javax.ws.rs.ValidationException; +import javax.ws.rs.BadRequestException; import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -49,7 +48,7 @@ public class TrustedIdpServiceImpl imple @Override public Response updateTrustedIDP(UriInfo ui, String realm, TrustedIdp trustedIdp) { if (!realm.equals(trustedIdp.getRealm().toString())) { - throw new ValidationException(Status.BAD_REQUEST); + throw new BadRequestException(); } trustedIdpDAO.updateTrustedIDP(realm, trustedIdp); Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java Mon Feb 3 13:05:08 2014 @@ -26,7 +26,7 @@ import java.util.Map; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.apache.ws.security.WSConstants; +import org.apache.wss4j.dom.WSConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.transaction.annotation.Transactional; Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java (original) +++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java Mon Feb 3 13:05:08 2014 @@ -24,7 +24,6 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; - import java.security.cert.X509Certificate; import javax.xml.parsers.DocumentBuilderFactory; @@ -32,17 +31,14 @@ import javax.xml.stream.XMLOutputFactory import javax.xml.stream.XMLStreamWriter; import org.w3c.dom.Document; - import org.apache.cxf.fediz.core.util.CertsUtils; import org.apache.cxf.fediz.core.util.DOMUtils; import org.apache.cxf.fediz.core.util.SignatureUtils; import org.apache.cxf.fediz.service.idp.domain.Claim; import org.apache.cxf.fediz.service.idp.domain.Idp; - -import org.apache.ws.security.components.crypto.Crypto; -import org.apache.ws.security.util.Base64; -import org.apache.ws.security.util.UUIDGenerator; - +import org.apache.wss4j.common.crypto.Crypto; +import org.apache.xml.security.stax.impl.util.IDGenerator; +import org.apache.xml.security.utils.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,7 +71,7 @@ public class MetadataWriter { writer.writeStartDocument(); - String referenceID = "_" + UUIDGenerator.getUUID(); + String referenceID = IDGenerator.generateID("_"); writer.writeStartElement("", "EntityDescriptor", SAML2_METADATA_NS); writer.writeAttribute("ID", referenceID); Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java (original) +++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPATest.java Mon Feb 3 13:05:08 2014 @@ -30,12 +30,10 @@ import org.apache.cxf.fediz.service.idp. import org.apache.cxf.fediz.service.idp.domain.Idp; import org.apache.cxf.fediz.service.idp.domain.TrustedIdp; import org.apache.cxf.fediz.service.idp.service.IdpDAO; -import org.apache.ws.security.WSConstants; - +import org.apache.wss4j.dom.WSConstants; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.EmptyResultDataAccessException; Modified: cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java (original) +++ cxf/fediz/trunk/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java Mon Feb 3 13:05:08 2014 @@ -20,14 +20,11 @@ package org.apache.cxf.fediz.service.idp.util; import org.w3c.dom.Document; - import org.apache.cxf.fediz.service.idp.domain.Idp; import org.apache.cxf.fediz.service.idp.service.ConfigService; -import org.apache.ws.security.util.DOM2Writer; - +import org.apache.wss4j.common.util.DOM2Writer; import org.junit.BeforeClass; import org.junit.Test; - import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.util.Assert; Modified: cxf/fediz/trunk/services/sts/pom.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/pom.xml?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/pom.xml (original) +++ cxf/fediz/trunk/services/sts/pom.xml Mon Feb 3 13:05:08 2014 @@ -139,7 +139,6 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> - <version>1.0-alpha-2</version> <executions> <execution> <goals> @@ -151,6 +150,10 @@ <name>logback.configurationFile</name> <value>${project.baseUri}/src/test/resources/logback.xml</value> </property> + <property> + <name>catalina.base</name> + <value>target</value> + </property> </properties> </configuration> </execution> @@ -175,7 +178,7 @@ </configuration> </execution> </executions> - </plugin> + </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> @@ -197,6 +200,7 @@ <wantClientAuth>true</wantClientAuth> </connector> </connectors> + <stopPort>${jetty.port}</stopPort> <stopKey>STOP</stopKey> <systemProperties> Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java (original) +++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java Mon Feb 3 13:05:08 2014 @@ -24,7 +24,7 @@ import java.util.List; import org.apache.cxf.sts.request.ReceivedToken; import org.apache.cxf.sts.token.delegation.TokenDelegationParameters; import org.apache.cxf.sts.token.delegation.TokenDelegationResponse; -import org.apache.ws.security.saml.ext.AssertionWrapper; +import org.apache.wss4j.common.saml.SamlAssertionWrapper; /** * The SAML TokenDelegationHandler implementation. It disallows ActAs or OnBehalfOf for @@ -44,7 +44,7 @@ public class FedizSAMLDelegationHandler return super.isDelegationAllowed(tokenParameters); } @Override - protected List<String> getAudienceRestrictions(AssertionWrapper assertion) { + protected List<String> getAudienceRestrictions(SamlAssertionWrapper assertion) { return Collections.emptyList(); } Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/PasswordCallbackHandler.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/PasswordCallbackHandler.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/PasswordCallbackHandler.java (original) +++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/PasswordCallbackHandler.java Mon Feb 3 13:05:08 2014 @@ -23,14 +23,15 @@ import java.io.IOException; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.UnsupportedCallbackException; -import org.apache.ws.security.WSPasswordCallback; + +import org.apache.wss4j.common.ext.WSPasswordCallback; public class PasswordCallbackHandler implements CallbackHandler { public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof WSPasswordCallback) { // CXF - WSPasswordCallback pc = (WSPasswordCallback) callbacks[i]; + WSPasswordCallback pc = (org.apache.wss4j.common.ext.WSPasswordCallback) callbacks[i]; if ("realma".equals(pc.getIdentifier())) { pc.setPassword("realma"); break; Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java (original) +++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java Mon Feb 3 13:05:08 2014 @@ -24,7 +24,8 @@ import java.util.Map; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.UnsupportedCallbackException; -import org.apache.ws.security.WSPasswordCallback; + +import org.apache.wss4j.common.ext.WSPasswordCallback; public class UsernamePasswordCallbackHandler implements CallbackHandler { Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java (original) +++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java Mon Feb 3 13:05:08 2014 @@ -24,7 +24,7 @@ import java.util.logging.Logger; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.sts.IdentityMapper; -import org.apache.ws.security.CustomTokenPrincipal; +import org.apache.wss4j.common.principal.CustomTokenPrincipal; /** * A test implementation of IdentityMapper. Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java (original) +++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java Mon Feb 3 13:05:08 2014 @@ -24,8 +24,8 @@ import java.security.cert.X509Certificat import javax.security.auth.x500.X500Principal; import org.apache.cxf.sts.token.realm.SAMLRealmCodec; -import org.apache.ws.security.saml.SAMLKeyInfo; -import org.apache.ws.security.saml.ext.AssertionWrapper; +import org.apache.wss4j.common.saml.SAMLKeyInfo; +import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +34,7 @@ public class SamlRealmCodec implements S private static final Logger LOG = LoggerFactory.getLogger(SamlRealmCodec.class); @Override - public String getRealmFromToken(AssertionWrapper assertion) { + public String getRealmFromToken(SamlAssertionWrapper assertion) { SAMLKeyInfo ki = assertion.getSignatureKeyInfo(); X509Certificate[] certs = ki.getCerts(); X500Principal subject = certs[0].getSubjectX500Principal(); Modified: cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml (original) +++ cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml Mon Feb 3 13:05:08 2014 @@ -19,7 +19,13 @@ <import resource="classpath:META-INF/cxf/cxf.xml" /> - <bean id="loggerListener" class="org.apache.cxf.sts.event.LoggerListener" /> + + <bean id="loggerListener" class="org.apache.cxf.sts.event.map.EventMapper"> + <constructor-arg> + <bean class="org.apache.cxf.sts.event.map.MapEventLogger" /> + </constructor-arg> + </bean> + <!-- Per default the resource <file.xml> is imported. Modified: cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl (original) +++ cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl Mon Feb 3 13:05:08 2014 @@ -11,7 +11,7 @@ <wsdl:import namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" location="ws-trust-1.4.wsdl"/> - <wsdl:binding name="UT_Binding" type="wstrust:STS"> + <wsdl:binding name="UT_Binding" type="tns:STS"> <wsp:PolicyReference URI="#UT_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -85,7 +85,7 @@ </wsdl:operation> </wsdl:binding> - <wsdl:binding name="UTEncrypted_Binding" type="wstrust:STS"> + <wsdl:binding name="UTEncrypted_Binding" type="tns:STS"> <wsp:PolicyReference URI="#UTEncrypted_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -159,7 +159,7 @@ </wsdl:operation> </wsdl:binding> - <wsdl:binding name="X509_Binding" type="wstrust:STS"> + <wsdl:binding name="X509_Binding" type="tns:STS"> <wsp:PolicyReference URI="#X509_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -233,7 +233,7 @@ </wsdl:operation> </wsdl:binding> - <wsdl:binding name="Transport_Binding" type="wstrust:STS"> + <wsdl:binding name="Transport_Binding" type="tns:STS"> <wsp:PolicyReference URI="#Transport_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -306,7 +306,7 @@ </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:binding name="TransportUT_Binding" type="wstrust:STS"> + <wsdl:binding name="TransportUT_Binding" type="tns:STS"> <wsp:PolicyReference URI="#TransportUT_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -379,7 +379,7 @@ </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:binding name="TransportKerberos_Binding" type="wstrust:STS"> + <wsdl:binding name="TransportKerberos_Binding" type="tns:STS"> <wsp:PolicyReference URI="#TransportKerberos_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -452,7 +452,7 @@ </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:binding name="TransportSaml_Binding" type="wstrust:STS"> + <wsdl:binding name="TransportSaml_Binding" type="tns:STS"> <wsp:PolicyReference URI="#TransportSaml_policy" /> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> @@ -817,7 +817,7 @@ <sp:Lax /> </wsp:Policy> </sp:Layout> - <!--<sp:IncludeTimestamp />--> + <sp:IncludeTimestamp /> </wsp:Policy> </sp:TransportBinding> <sp:SignedSupportingTokens Modified: cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java (original) +++ cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java Mon Feb 3 13:05:08 2014 @@ -34,6 +34,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLStreamException; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -42,7 +43,7 @@ import org.xml.sax.SAXException; import org.apache.cxf.Bus; import org.apache.cxf.configuration.jsse.TLSClientParameters; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamWriter; import org.apache.cxf.sts.QNameConstants; import org.apache.cxf.transport.http.HTTPConduit; @@ -53,8 +54,8 @@ import org.apache.cxf.ws.security.sts.pr import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.cxf.ws.security.trust.STSClient; import org.apache.cxf.ws.security.trust.STSUtils; -import org.apache.ws.security.WSConstants; -import org.apache.ws.security.saml.ext.AssertionWrapper; +import org.apache.wss4j.common.saml.SamlAssertionWrapper; +import org.apache.wss4j.dom.WSConstants; import org.junit.Assert; import org.opensaml.saml2.core.Attribute; @@ -80,7 +81,7 @@ public abstract class AbstractSTSTest { protected Element createUserToken(String username, String password) - throws JAXBException, SAXException, IOException, ParserConfigurationException { + throws JAXBException, SAXException, IOException, ParserConfigurationException, XMLStreamException { JAXBElement<UsernameTokenType> supportingToken = createUsernameToken(username, password); final JAXBContext jaxbContext = JAXBContext.newInstance(UsernameTokenType.class); @@ -88,7 +89,7 @@ public abstract class AbstractSTSTest { jaxbContext.createMarshaller().marshal(supportingToken, writer); writer.flush(); InputStream is = new ByteArrayInputStream(writer.toString().getBytes()); - Document doc = DOMUtils.readXml(is); + Document doc = StaxUtils.read(is); return doc.getDocumentElement(); } @@ -289,14 +290,14 @@ public abstract class AbstractSTSTest { } protected void validateSubject(Properties testProps, - AssertionWrapper assertion) { + SamlAssertionWrapper assertion) { String expectedSamlUser = testProps.getProperty("samluser"); String samlUser = assertion.getSaml2().getSubject().getNameID().getValue(); Assert.assertEquals("Expected SAML subject '" + expectedSamlUser + "' [" + samlUser + "]", expectedSamlUser.toUpperCase(), samlUser.toUpperCase()); } - protected void validateIssuer(AssertionWrapper assertion, String realm) { + protected void validateIssuer(SamlAssertionWrapper assertion, String realm) { String issuer = assertion.getSaml2().getIssuer().getValue(); Assert.assertTrue("SAML Token issuer should be " + realm + " instead of [" + issuer + "]", issuer.toUpperCase().contains(realm.toUpperCase())); Modified: cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java?rev=1563869&r1=1563868&r2=1563869&view=diff ============================================================================== --- cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java (original) +++ cxf/fediz/trunk/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java Mon Feb 3 13:05:08 2014 @@ -30,7 +30,7 @@ import org.apache.cxf.bus.spring.SpringB import org.apache.cxf.configuration.jsse.TLSClientParameters; import org.apache.cxf.fediz.sts.AbstractSTSTest; import org.apache.cxf.ws.security.tokenstore.SecurityToken; -import org.apache.ws.security.saml.ext.AssertionWrapper; +import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.junit.Assert; import org.junit.BeforeClass; import org.opensaml.saml2.core.Attribute; @@ -94,7 +94,7 @@ public class ITCrossRealmTest extends Ab Assert.assertTrue(SAML2_TOKEN_TYPE.equals(idpToken.getTokenType())); Assert.assertTrue(idpToken.getToken() != null); - AssertionWrapper assertion = new AssertionWrapper(idpToken.getToken()); + SamlAssertionWrapper assertion = new SamlAssertionWrapper(idpToken.getToken()); validateIssuer(assertion, "STS Realm A"); @@ -122,7 +122,7 @@ public class ITCrossRealmTest extends Ab Assert.assertTrue(SAML2_TOKEN_TYPE.equals(rpToken.getTokenType())); Assert.assertTrue(rpToken.getToken() != null); - assertion = new AssertionWrapper(rpToken.getToken()); + assertion = new SamlAssertionWrapper(rpToken.getToken()); this.validateSubject(testProps, assertion); validateIssuer(assertion, "STS Realm B"); @@ -177,7 +177,7 @@ public class ITCrossRealmTest extends Ab Assert.assertTrue(SAML2_TOKEN_TYPE.equals(idpToken.getTokenType())); Assert.assertTrue(idpToken.getToken() != null); - AssertionWrapper assertion = new AssertionWrapper(idpToken.getToken()); + SamlAssertionWrapper assertion = new SamlAssertionWrapper(idpToken.getToken()); validateIssuer(assertion, "STS Realm A"); @@ -205,7 +205,7 @@ public class ITCrossRealmTest extends Ab Assert.assertTrue(SAML2_TOKEN_TYPE.equals(rpToken.getTokenType())); Assert.assertTrue(rpToken.getToken() != null); - assertion = new AssertionWrapper(rpToken.getToken()); + assertion = new SamlAssertionWrapper(rpToken.getToken()); this.validateSubject(testProps, assertion); validateIssuer(assertion, "STS Realm B");
