You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2012/03/14 16:01:38 UTC
svn commit: r1300579 - in /cxf/trunk:
rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/
rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/
services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation...
Author: coheigea
Date: Wed Mar 14 15:01:37 2012
New Revision: 1300579
URL: http://svn.apache.org/viewvc?rev=1300579&view=rev
Log:
[CXF-4157] - Support batch processing via RequestSecurityTokenCollection.
- Removed old RequestCollectionOperation from the STS Provider
- Issue/Renew/Validate/Cancel operations now support processing collections
Removed:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RequestCollectionOperation.java
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceImpl.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/CancelOperation.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/IssueOperation.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RenewOperation.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/ValidateOperation.java
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRenewOperation.java
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java
cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java
cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java Wed Mar 14 15:01:37 2012
@@ -69,6 +69,19 @@ public interface SecurityTokenService {
RequestSecurityTokenType request
);
+ @WebResult(name = "RequestSecurityTokenResponseCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
+ partName = "responseCollection")
+ @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchIssue",
+ output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchIssue")
+ @WebMethod(operationName = "Issue")
+ RequestSecurityTokenResponseCollectionType issue(
+ @WebParam(partName = "requestCollection",
+ name = "RequestSecurityTokenCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
+ RequestSecurityTokenCollectionType requestCollection
+ );
+
@WebResult(name = "RequestSecurityTokenResponse",
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
partName = "response")
@@ -93,6 +106,18 @@ public interface SecurityTokenService {
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
RequestSecurityTokenType request
);
+
+ @WebResult(name = "RequestSecurityTokenResponseCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
+ partName = "responseCollection")
+ @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchCancel",
+ output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchCancel")
+ @WebMethod(operationName = "Cancel")
+ RequestSecurityTokenResponseCollectionType cancel(
+ @WebParam(partName = "requestCollection", name = "RequestSecurityTokenCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
+ RequestSecurityTokenCollectionType requestCollection
+ );
@WebResult(name = "RequestSecurityTokenResponse",
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
@@ -105,14 +130,15 @@ public interface SecurityTokenService {
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
RequestSecurityTokenType request
);
-
+
@WebResult(name = "RequestSecurityTokenResponseCollection",
- targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
partName = "responseCollection")
- @WebMethod(operationName = "RequestCollection")
- RequestSecurityTokenResponseCollectionType requestCollection(
- @WebParam(partName = "requestCollection",
- name = "RequestSecurityTokenCollection",
+ @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchValidate",
+ output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchValidate")
+ @WebMethod(operationName = "Validate")
+ RequestSecurityTokenResponseCollectionType validate(
+ @WebParam(partName = "requestCollection", name = "RequestSecurityTokenCollection",
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
RequestSecurityTokenCollectionType requestCollection
);
@@ -129,4 +155,17 @@ public interface SecurityTokenService {
targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
RequestSecurityTokenType request
);
+
+ @WebResult(name = "RequestSecurityTokenResponseCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
+ partName = "responseCollection")
+ @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchRenew",
+ output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/BatchRenew")
+ @WebMethod(operationName = "Renew")
+ RequestSecurityTokenResponseCollectionType renew(
+ @WebParam(partName = "requestCollection",
+ name = "RequestSecurityTokenCollection",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
+ RequestSecurityTokenCollectionType requestCollection
+ );
}
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceImpl.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceImpl.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceImpl.java Wed Mar 14 15:01:37 2012
@@ -36,7 +36,6 @@ import org.apache.cxf.ws.security.sts.pr
import org.apache.cxf.ws.security.sts.provider.operation.IssueSingleOperation;
import org.apache.cxf.ws.security.sts.provider.operation.KeyExchangeTokenOperation;
import org.apache.cxf.ws.security.sts.provider.operation.RenewOperation;
-import org.apache.cxf.ws.security.sts.provider.operation.RequestCollectionOperation;
import org.apache.cxf.ws.security.sts.provider.operation.ValidateOperation;
@@ -47,7 +46,6 @@ public class SecurityTokenServiceImpl im
private IssueSingleOperation issueSingleOperation;
private KeyExchangeTokenOperation keyExchangeTokenOperation;
private RenewOperation renewOperation;
- private RequestCollectionOperation requestCollectionOperation;
private ValidateOperation validateOperation;
@Resource
@@ -74,11 +72,6 @@ public class SecurityTokenServiceImpl im
this.renewOperation = renewOperation;
}
- public void setRequestCollectionOperation(
- RequestCollectionOperation requestCollectionOperation) {
- this.requestCollectionOperation = requestCollectionOperation;
- }
-
public void setValidateOperation(ValidateOperation validateOperation) {
this.validateOperation = validateOperation;
}
@@ -90,14 +83,14 @@ public class SecurityTokenServiceImpl im
}
return validateOperation.validate(request, context);
}
-
-
- public RequestSecurityTokenResponseCollectionType requestCollection(
- RequestSecurityTokenCollectionType requestCollection) {
- if (requestCollectionOperation == null) {
- throwUnsupportedOperation("RequestCollection");
+
+ public RequestSecurityTokenResponseCollectionType validate(
+ RequestSecurityTokenCollectionType requestCollection
+ ) {
+ if (validateOperation == null) {
+ throwUnsupportedOperation("Validate");
}
- return requestCollectionOperation.requestCollection(requestCollection, context);
+ return validateOperation.validate(requestCollection, context);
}
public RequestSecurityTokenResponseType keyExchangeToken(
@@ -116,6 +109,15 @@ public class SecurityTokenServiceImpl im
return issueOperation.issue(request, context);
}
+ public RequestSecurityTokenResponseCollectionType issue(
+ RequestSecurityTokenCollectionType requestCollection
+ ) {
+ if (issueOperation == null) {
+ throwUnsupportedOperation("Issue");
+ }
+ return issueOperation.issue(requestCollection, context);
+ }
+
public RequestSecurityTokenResponseType issueSingle(
RequestSecurityTokenType request) {
if (issueSingleOperation == null) {
@@ -131,6 +133,15 @@ public class SecurityTokenServiceImpl im
}
return cancelOperation.cancel(request, context);
}
+
+ public RequestSecurityTokenResponseCollectionType cancel(
+ RequestSecurityTokenCollectionType requestCollection
+ ) {
+ if (cancelOperation == null) {
+ throwUnsupportedOperation("Cancel");
+ }
+ return cancelOperation.cancel(requestCollection, context);
+ }
public RequestSecurityTokenResponseType renew(
RequestSecurityTokenType request) {
@@ -140,6 +151,15 @@ public class SecurityTokenServiceImpl im
return renewOperation.renew(request, context);
}
+ public RequestSecurityTokenResponseCollectionType renew(
+ RequestSecurityTokenCollectionType requestCollection
+ ) {
+ if (renewOperation == null) {
+ throwUnsupportedOperation("Renew");
+ }
+ return renewOperation.renew(requestCollection, context);
+ }
+
private void throwUnsupportedOperation(String string) {
try {
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java Wed Mar 14 15:01:37 2012
@@ -54,7 +54,6 @@ import org.apache.cxf.ws.security.sts.pr
import org.apache.cxf.ws.security.sts.provider.operation.IssueSingleOperation;
import org.apache.cxf.ws.security.sts.provider.operation.KeyExchangeTokenOperation;
import org.apache.cxf.ws.security.sts.provider.operation.RenewOperation;
-import org.apache.cxf.ws.security.sts.provider.operation.RequestCollectionOperation;
import org.apache.cxf.ws.security.sts.provider.operation.ValidateOperation;
@ServiceMode(value = Service.Mode.PAYLOAD)
@@ -64,14 +63,20 @@ public class SecurityTokenServiceProvide
private static final String WSTRUST_REQUESTTYPE_ELEMENTNAME = "RequestType";
private static final String WSTRUST_REQUESTTYPE_ISSUE = WSTRUST_13_NAMESPACE
+ "/Issue";
+ private static final String WSTRUST_REQUESTTYPE_BATCH_ISSUE = WSTRUST_13_NAMESPACE
+ + "/BatchIssue";
private static final String WSTRUST_REQUESTTYPE_CANCEL = WSTRUST_13_NAMESPACE
+ "/Cancel";
+ private static final String WSTRUST_REQUESTTYPE_BATCH_CANCEL = WSTRUST_13_NAMESPACE
+ + "/BatchCancel";
private static final String WSTRUST_REQUESTTYPE_RENEW = WSTRUST_13_NAMESPACE
+ "/Renew";
+ private static final String WSTRUST_REQUESTTYPE_BATCH_RENEW = WSTRUST_13_NAMESPACE
+ + "/BatchRenew";
private static final String WSTRUST_REQUESTTYPE_VALIDATE = WSTRUST_13_NAMESPACE
+ "/Validate";
- private static final String WSTRUST_REQUESTTYPE_REQUESTCOLLECTION = WSTRUST_13_NAMESPACE
- + "/RequestCollection";
+ private static final String WSTRUST_REQUESTTYPE_BATCH_VALIDATE = WSTRUST_13_NAMESPACE
+ + "/BatchValidate";
private static final String WSTRUST_REQUESTTYPE_KEYEXCHANGETOKEN = WSTRUST_13_NAMESPACE
+ "/KeyExchangeToken";
@@ -83,30 +88,45 @@ public class SecurityTokenServiceProvide
WebServiceContext.class);
OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_ISSUE, m);
+ m = IssueOperation.class.getDeclaredMethod("issue",
+ RequestSecurityTokenCollectionType.class,
+ WebServiceContext.class);
+ OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_BATCH_ISSUE, m);
+
m = CancelOperation.class.getDeclaredMethod("cancel",
RequestSecurityTokenType.class,
WebServiceContext.class);
OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_CANCEL, m);
+ m = CancelOperation.class.getDeclaredMethod("cancel",
+ RequestSecurityTokenCollectionType.class,
+ WebServiceContext.class);
+ OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_BATCH_CANCEL, m);
+
m = RenewOperation.class.getDeclaredMethod("renew",
RequestSecurityTokenType.class,
WebServiceContext.class);
OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_RENEW, m);
+ m = RenewOperation.class.getDeclaredMethod("renew",
+ RequestSecurityTokenCollectionType.class,
+ WebServiceContext.class);
+ OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_BATCH_RENEW, m);
+
m = ValidateOperation.class.getDeclaredMethod("validate",
RequestSecurityTokenType.class,
WebServiceContext.class);
OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_VALIDATE, m);
+ m = ValidateOperation.class.getDeclaredMethod("validate",
+ RequestSecurityTokenCollectionType.class,
+ WebServiceContext.class);
+ OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_BATCH_VALIDATE, m);
+
m = KeyExchangeTokenOperation.class.getDeclaredMethod("keyExchangeToken",
RequestSecurityTokenType.class,
WebServiceContext.class);
OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_KEYEXCHANGETOKEN, m);
-
- m = RequestCollectionOperation.class.getDeclaredMethod("requestCollection",
- RequestSecurityTokenCollectionType.class,
- WebServiceContext.class);
- OPERATION_METHODS.put(WSTRUST_REQUESTTYPE_REQUESTCOLLECTION, m);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -122,7 +142,6 @@ public class SecurityTokenServiceProvide
private IssueSingleOperation issueSingleOperation;
private KeyExchangeTokenOperation keyExchangeTokenOperation;
private RenewOperation renewOperation;
- private RequestCollectionOperation requestCollectionOperation;
private ValidateOperation validateOperation;
private Map<String, Object> operationMap = new HashMap<String, Object>();
@@ -180,13 +199,6 @@ public class SecurityTokenServiceProvide
operationMap.put(WSTRUST_REQUESTTYPE_RENEW, renewOperation);
}
- public void setRequestCollectionOperation(
- RequestCollectionOperation requestCollectionOperation) {
- this.requestCollectionOperation = requestCollectionOperation;
- operationMap.put(WSTRUST_REQUESTTYPE_REQUESTCOLLECTION,
- requestCollectionOperation);
- }
-
public void setValidateOperation(ValidateOperation validateOperation) {
this.validateOperation = validateOperation;
operationMap.put(WSTRUST_REQUESTTYPE_VALIDATE, validateOperation);
@@ -201,8 +213,31 @@ public class SecurityTokenServiceProvide
Object operationImpl = null;
Method method = null;
if (obj instanceof RequestSecurityTokenCollectionType) {
- operationImpl = operationMap.get(WSTRUST_REQUESTTYPE_REQUESTCOLLECTION);
- method = OPERATION_METHODS.get(WSTRUST_REQUESTTYPE_REQUESTCOLLECTION);
+ RequestSecurityTokenCollectionType rstCollection = (RequestSecurityTokenCollectionType)obj;
+ List<RequestSecurityTokenType> typeList = rstCollection.getRequestSecurityToken();
+ String requestType = null;
+ for (RequestSecurityTokenType rst : typeList) {
+ List<?> objectList = rst.getAny();
+ for (Object o : objectList) {
+ if (o instanceof JAXBElement) {
+ QName qname = ((JAXBElement<?>) o).getName();
+ if (qname.equals(new QName(WSTRUST_13_NAMESPACE,
+ WSTRUST_REQUESTTYPE_ELEMENTNAME))) {
+ String val = ((JAXBElement<?>) o).getValue().toString();
+ // All batch requests must have the same RequestType
+ if (requestType != null && !requestType.equals(val)) {
+ operationImpl = null;
+ method = null;
+ break;
+ } else {
+ requestType = val;
+ }
+ operationImpl = operationMap.get(val);
+ method = OPERATION_METHODS.get(val);
+ }
+ }
+ }
+ }
} else {
RequestSecurityTokenType rst = (RequestSecurityTokenType)obj;
List<?> objectList = rst.getAny();
@@ -213,7 +248,7 @@ public class SecurityTokenServiceProvide
WSTRUST_REQUESTTYPE_ELEMENTNAME))) {
String val = ((JAXBElement<?>) o).getValue().toString();
operationImpl = operationMap.get(val);
- method = OPERATION_METHODS.get(val);
+ method = OPERATION_METHODS.get(val);
break;
}
}
@@ -304,10 +339,6 @@ public class SecurityTokenServiceProvide
return renewOperation;
}
- public RequestCollectionOperation getRequestCollectionOperation() {
- return requestCollectionOperation;
- }
-
public ValidateOperation getValidateOperation() {
return validateOperation;
}
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/CancelOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/CancelOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/CancelOperation.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/CancelOperation.java Wed Mar 14 15:01:37 2012
@@ -21,6 +21,8 @@ package org.apache.cxf.ws.security.sts.p
import javax.xml.ws.WebServiceContext;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -28,5 +30,8 @@ public interface CancelOperation {
RequestSecurityTokenResponseType cancel(RequestSecurityTokenType request,
WebServiceContext context);
+
+ RequestSecurityTokenResponseCollectionType cancel(RequestSecurityTokenCollectionType request,
+ WebServiceContext context);
}
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/IssueOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/IssueOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/IssueOperation.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/IssueOperation.java Wed Mar 14 15:01:37 2012
@@ -21,6 +21,7 @@ package org.apache.cxf.ws.security.sts.p
import javax.xml.ws.WebServiceContext;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -29,5 +30,9 @@ public interface IssueOperation {
RequestSecurityTokenResponseCollectionType issue(
RequestSecurityTokenType request,
WebServiceContext context);
+
+ RequestSecurityTokenResponseCollectionType issue(
+ RequestSecurityTokenCollectionType requestCollection,
+ WebServiceContext context);
}
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RenewOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RenewOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RenewOperation.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/RenewOperation.java Wed Mar 14 15:01:37 2012
@@ -21,6 +21,8 @@ package org.apache.cxf.ws.security.sts.p
import javax.xml.ws.WebServiceContext;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -29,4 +31,6 @@ public interface RenewOperation {
RequestSecurityTokenResponseType renew(RequestSecurityTokenType request,
WebServiceContext context);
+ RequestSecurityTokenResponseCollectionType renew(RequestSecurityTokenCollectionType request,
+ WebServiceContext context);
}
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/ValidateOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/ValidateOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/ValidateOperation.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/operation/ValidateOperation.java Wed Mar 14 15:01:37 2012
@@ -21,6 +21,8 @@ package org.apache.cxf.ws.security.sts.p
import javax.xml.ws.WebServiceContext;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -28,5 +30,8 @@ public interface ValidateOperation {
RequestSecurityTokenResponseType validate(RequestSecurityTokenType request,
WebServiceContext context);
+
+ RequestSecurityTokenResponseCollectionType validate(RequestSecurityTokenCollectionType request,
+ WebServiceContext context);
}
Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java Wed Mar 14 15:01:37 2012
@@ -38,6 +38,8 @@ import org.apache.cxf.sts.token.cancelle
import org.apache.cxf.sts.token.canceller.TokenCancellerParameters;
import org.apache.cxf.sts.token.canceller.TokenCancellerResponse;
import org.apache.cxf.ws.security.sts.provider.STSException;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
import org.apache.cxf.ws.security.sts.provider.model.RequestedTokenCancelledType;
@@ -61,6 +63,18 @@ public class TokenCancelOperation extend
return tokencancellers;
}
+ public RequestSecurityTokenResponseCollectionType cancel(
+ RequestSecurityTokenCollectionType requestCollection, WebServiceContext context
+ ) {
+ RequestSecurityTokenResponseCollectionType responseCollection =
+ QNameConstants.WS_TRUST_FACTORY.createRequestSecurityTokenResponseCollectionType();
+ for (RequestSecurityTokenType request : requestCollection.getRequestSecurityToken()) {
+ RequestSecurityTokenResponseType response = cancel(request, context);
+ responseCollection.getRequestSecurityTokenResponse().add(response);
+ }
+ return responseCollection;
+ }
+
public RequestSecurityTokenResponseType cancel(
RequestSecurityTokenType request, WebServiceContext context
) {
Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java Wed Mar 14 15:01:37 2012
@@ -44,6 +44,7 @@ import org.apache.cxf.ws.security.sts.pr
import org.apache.cxf.ws.security.sts.provider.model.BinarySecretType;
import org.apache.cxf.ws.security.sts.provider.model.EntropyType;
import org.apache.cxf.ws.security.sts.provider.model.LifetimeType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -72,6 +73,19 @@ public class TokenIssueOperation extends
responseCollection.getRequestSecurityTokenResponse().add(response);
return responseCollection;
}
+
+ public RequestSecurityTokenResponseCollectionType issue(
+ RequestSecurityTokenCollectionType requestCollection,
+ WebServiceContext context
+ ) {
+ RequestSecurityTokenResponseCollectionType responseCollection =
+ QNameConstants.WS_TRUST_FACTORY.createRequestSecurityTokenResponseCollectionType();
+ for (RequestSecurityTokenType request : requestCollection.getRequestSecurityToken()) {
+ RequestSecurityTokenResponseType response = issueSingle(request, context);
+ responseCollection.getRequestSecurityTokenResponse().add(response);
+ }
+ return responseCollection;
+ }
public RequestSecurityTokenResponseType issueSingle(
RequestSecurityTokenType request,
Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRenewOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRenewOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRenewOperation.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRenewOperation.java Wed Mar 14 15:01:37 2012
@@ -39,6 +39,8 @@ import org.apache.cxf.sts.token.renewer.
import org.apache.cxf.sts.token.renewer.TokenRenewerResponse;
import org.apache.cxf.ws.security.sts.provider.STSException;
import org.apache.cxf.ws.security.sts.provider.model.LifetimeType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
import org.apache.cxf.ws.security.sts.provider.model.RequestedReferenceType;
@@ -63,6 +65,18 @@ public class TokenRenewOperation extends
return tokenRenewers;
}
+ public RequestSecurityTokenResponseCollectionType renew(
+ RequestSecurityTokenCollectionType requestCollection, WebServiceContext context
+ ) {
+ RequestSecurityTokenResponseCollectionType responseCollection =
+ QNameConstants.WS_TRUST_FACTORY.createRequestSecurityTokenResponseCollectionType();
+ for (RequestSecurityTokenType request : requestCollection.getRequestSecurityToken()) {
+ RequestSecurityTokenResponseType response = renew(request, context);
+ responseCollection.getRequestSecurityTokenResponse().add(response);
+ }
+ return responseCollection;
+ }
+
public RequestSecurityTokenResponseType renew(
RequestSecurityTokenType request, WebServiceContext context
) {
Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java Wed Mar 14 15:01:37 2012
@@ -41,6 +41,8 @@ import org.apache.cxf.sts.token.provider
import org.apache.cxf.sts.token.validator.TokenValidatorResponse;
import org.apache.cxf.ws.security.sts.provider.STSException;
import org.apache.cxf.ws.security.sts.provider.model.LifetimeType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
import org.apache.cxf.ws.security.sts.provider.model.RequestedReferenceType;
@@ -57,6 +59,18 @@ public class TokenValidateOperation exte
private static final Logger LOG = LogUtils.getL7dLogger(TokenValidateOperation.class);
+ public RequestSecurityTokenResponseCollectionType validate(
+ RequestSecurityTokenCollectionType requestCollection, WebServiceContext context
+ ) {
+ RequestSecurityTokenResponseCollectionType responseCollection =
+ QNameConstants.WS_TRUST_FACTORY.createRequestSecurityTokenResponseCollectionType();
+ for (RequestSecurityTokenType request : requestCollection.getRequestSecurityToken()) {
+ RequestSecurityTokenResponseType response = validate(request, context);
+ responseCollection.getRequestSecurityTokenResponse().add(response);
+ }
+ return responseCollection;
+ }
+
public RequestSecurityTokenResponseType validate(
RequestSecurityTokenType request,
WebServiceContext context
Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java (original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java Wed Mar 14 15:01:37 2012
@@ -53,6 +53,7 @@ import org.apache.cxf.sts.token.provider
import org.apache.cxf.ws.security.sts.provider.STSException;
import org.apache.cxf.ws.security.sts.provider.model.BinarySecretType;
import org.apache.cxf.ws.security.sts.provider.model.EntropyType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -238,6 +239,108 @@ public class IssueSamlUnitTest extends o
}
/**
+ * Test to successfully issue multiple Saml tokens. It request a SAML 1.1 and SAML 2 token.
+ */
+ @org.junit.Test
+ public void testIssueMultipleSamlTokens() throws Exception {
+ TokenIssueOperation issueOperation = new TokenIssueOperation();
+
+ // Add Token Provider
+ List<TokenProvider> providerList = new ArrayList<TokenProvider>();
+ providerList.add(new SAMLTokenProvider());
+ issueOperation.setTokenProviders(providerList);
+
+ // Add Service
+ ServiceMBean service = new StaticService();
+ service.setEndpoints(Collections.singletonList("http://dummy-service.com/dummy"));
+ issueOperation.setServices(Collections.singletonList(service));
+
+ // Add STSProperties object
+ STSPropertiesMBean stsProperties = new StaticSTSProperties();
+ Crypto crypto = CryptoFactory.getInstance(getEncryptionProperties());
+ stsProperties.setEncryptionCrypto(crypto);
+ stsProperties.setSignatureCrypto(crypto);
+ stsProperties.setEncryptionUsername("myservicekey");
+ stsProperties.setSignatureUsername("mystskey");
+ stsProperties.setCallbackHandler(new PasswordCallbackHandler());
+ stsProperties.setIssuer("STS");
+ issueOperation.setStsProperties(stsProperties);
+
+ // Mock up a request
+ RequestSecurityTokenCollectionType requestCollection =
+ new RequestSecurityTokenCollectionType();
+ // SAML 1.1 request
+ RequestSecurityTokenType request = new RequestSecurityTokenType();
+ JAXBElement<String> tokenType =
+ new JAXBElement<String>(
+ QNameConstants.TOKEN_TYPE, String.class, WSConstants.WSS_SAML_TOKEN_TYPE
+ );
+ request.getAny().add(tokenType);
+ request.getAny().add(createAppliesToElement("http://dummy-service.com/dummy"));
+ requestCollection.getRequestSecurityToken().add(request);
+
+ // SAML 2 request
+ request = new RequestSecurityTokenType();
+ JAXBElement<String> tokenType2 =
+ new JAXBElement<String>(
+ QNameConstants.TOKEN_TYPE, String.class, WSConstants.WSS_SAML2_TOKEN_TYPE
+ );
+ request.getAny().add(tokenType2);
+ request.getAny().add(createAppliesToElement("http://dummy-service.com/dummy"));
+ requestCollection.getRequestSecurityToken().add(request);
+
+ // Mock up message context
+ MessageImpl msg = new MessageImpl();
+ WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
+ msgCtx.put(
+ SecurityContext.class.getName(),
+ createSecurityContext(new CustomTokenPrincipal("alice"))
+ );
+ WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
+
+ // Issue a token
+ RequestSecurityTokenResponseCollectionType response =
+ issueOperation.issue(requestCollection, webServiceContext);
+ List<RequestSecurityTokenResponseType> securityTokenResponse =
+ response.getRequestSecurityTokenResponse();
+ assertEquals(securityTokenResponse.size(), 2);
+
+ // Test the generated tokens.
+ Element assertion = null;
+ for (Object tokenObject : securityTokenResponse.get(0).getAny()) {
+ if (tokenObject instanceof JAXBElement<?>
+ && REQUESTED_SECURITY_TOKEN.equals(((JAXBElement<?>)tokenObject).getName())) {
+ RequestedSecurityTokenType rstType =
+ (RequestedSecurityTokenType)((JAXBElement<?>)tokenObject).getValue();
+ assertion = (Element)rstType.getAny();
+ break;
+ }
+ }
+
+ assertNotNull(assertion);
+ String tokenString = DOM2Writer.nodeToString(assertion);
+ assertTrue(tokenString.contains("AttributeStatement"));
+ assertTrue(tokenString.contains("alice"));
+ assertTrue(tokenString.contains(SAML1Constants.CONF_BEARER));
+
+ for (Object tokenObject : securityTokenResponse.get(1).getAny()) {
+ if (tokenObject instanceof JAXBElement<?>
+ && REQUESTED_SECURITY_TOKEN.equals(((JAXBElement<?>)tokenObject).getName())) {
+ RequestedSecurityTokenType rstType =
+ (RequestedSecurityTokenType)((JAXBElement<?>)tokenObject).getValue();
+ assertion = (Element)rstType.getAny();
+ break;
+ }
+ }
+
+ assertNotNull(assertion);
+ tokenString = DOM2Writer.nodeToString(assertion);
+ assertTrue(tokenString.contains("AttributeStatement"));
+ assertTrue(tokenString.contains("alice"));
+ assertTrue(tokenString.contains(SAML2Constants.CONF_BEARER));
+ }
+
+ /**
* Test to successfully issue an encrypted Saml 2 token.
*/
@org.junit.Test
Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java (original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java Wed Mar 14 15:01:37 2012
@@ -41,6 +41,7 @@ import org.apache.cxf.sts.service.Static
import org.apache.cxf.sts.token.provider.TokenProvider;
import org.apache.cxf.ws.security.sts.provider.STSException;
import org.apache.cxf.ws.security.sts.provider.model.LifetimeType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
@@ -97,6 +98,57 @@ public class IssueUnitTest extends org.j
}
/**
+ * Test to successfully issue multiple (dummy) tokens.
+ */
+ @org.junit.Test
+ public void testIssueMultipleTokens() throws Exception {
+ TokenIssueOperation issueOperation = new TokenIssueOperation();
+
+ // Add Token Provider
+ List<TokenProvider> providerList = new ArrayList<TokenProvider>();
+ providerList.add(new DummyTokenProvider());
+ issueOperation.setTokenProviders(providerList);
+
+ // Add Service
+ ServiceMBean service = new StaticService();
+ service.setEndpoints(Collections.singletonList("http://dummy-service.com/dummy"));
+ issueOperation.setServices(Collections.singletonList(service));
+
+ // Add STSProperties object
+ STSPropertiesMBean stsProperties = new StaticSTSProperties();
+ issueOperation.setStsProperties(stsProperties);
+
+ // Mock up a request
+ RequestSecurityTokenCollectionType requestCollection =
+ new RequestSecurityTokenCollectionType();
+ RequestSecurityTokenType request = new RequestSecurityTokenType();
+ JAXBElement<String> tokenType =
+ new JAXBElement<String>(
+ QNameConstants.TOKEN_TYPE, String.class, DummyTokenProvider.TOKEN_TYPE
+ );
+ request.getAny().add(tokenType);
+ request.getAny().add(createAppliesToElement("http://dummy-service.com/dummy"));
+ requestCollection.getRequestSecurityToken().add(request);
+
+ request = new RequestSecurityTokenType();
+ request.getAny().add(tokenType);
+ request.getAny().add(createAppliesToElement("http://dummy-service.com/dummy"));
+ requestCollection.getRequestSecurityToken().add(request);
+
+ // Mock up message context
+ MessageImpl msg = new MessageImpl();
+ WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
+ WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
+
+ // Issue a token
+ RequestSecurityTokenResponseCollectionType response =
+ issueOperation.issue(requestCollection, webServiceContext);
+ List<RequestSecurityTokenResponseType> securityTokenResponse =
+ response.getRequestSecurityTokenResponse();
+ assertEquals(securityTokenResponse.size(), 2);
+ }
+
+ /**
* Test to issue a token of an unknown or missing TokenType value.
*/
@org.junit.Test
Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java (original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java Wed Mar 14 15:01:37 2012
@@ -33,6 +33,8 @@ import org.apache.cxf.sts.STSPropertiesM
import org.apache.cxf.sts.StaticSTSProperties;
import org.apache.cxf.sts.token.validator.TokenValidator;
import org.apache.cxf.ws.security.sts.provider.STSException;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenCollectionType;
+import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseCollectionType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenResponseType;
import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType;
import org.apache.cxf.ws.security.sts.provider.model.StatusType;
@@ -91,6 +93,63 @@ public class ValidateUnitTest extends or
assertTrue(validateResponse(response));
}
+
+ /**
+ * Test to successfully validate multiple (dummy) tokens.
+ */
+ @org.junit.Test
+ public void testValidateMultipleTokens() throws Exception {
+ TokenValidateOperation validateOperation = new TokenValidateOperation();
+
+ // Add Token Validator
+ List<TokenValidator> validatorList = new ArrayList<TokenValidator>();
+ validatorList.add(new DummyTokenValidator());
+ validateOperation.setTokenValidators(validatorList);
+
+ // Add STSProperties object
+ STSPropertiesMBean stsProperties = new StaticSTSProperties();
+ validateOperation.setStsProperties(stsProperties);
+
+ // Mock up a request
+ RequestSecurityTokenCollectionType requestCollection =
+ new RequestSecurityTokenCollectionType();
+ RequestSecurityTokenType request = new RequestSecurityTokenType();
+ JAXBElement<String> tokenType =
+ new JAXBElement<String>(
+ QNameConstants.TOKEN_TYPE, String.class, STSConstants.STATUS
+ );
+ request.getAny().add(tokenType);
+ ValidateTargetType validateTarget = new ValidateTargetType();
+ JAXBElement<BinarySecurityTokenType> token = createToken();
+ validateTarget.setAny(token);
+ JAXBElement<ValidateTargetType> validateTargetType =
+ new JAXBElement<ValidateTargetType>(
+ QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
+ );
+ request.getAny().add(validateTargetType);
+ requestCollection.getRequestSecurityToken().add(request);
+
+ request = new RequestSecurityTokenType();
+ request.getAny().add(tokenType);
+ validateTarget.setAny(token);
+ request.getAny().add(validateTargetType);
+ requestCollection.getRequestSecurityToken().add(request);
+
+ // Mock up message context
+ MessageImpl msg = new MessageImpl();
+ WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
+ WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
+
+ // Validate a token
+ RequestSecurityTokenResponseCollectionType response =
+ validateOperation.validate(requestCollection, webServiceContext);
+ List<RequestSecurityTokenResponseType> securityTokenResponse =
+ response.getRequestSecurityTokenResponse();
+ assertEquals(securityTokenResponse.size(), 2);
+ assertTrue(validateResponse(securityTokenResponse.get(0)));
+ assertTrue(validateResponse(securityTokenResponse.get(1)));
+ }
+
/**
* Test that calls Validate without a ValidateTarget
*/
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties?rev=1300579&r1=1300578&r2=1300579&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties Wed Mar 14 15:01:37 2012
@@ -57,7 +57,7 @@ java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
# Limit the message that are printed on the console to WARNING and above.
-java.util.logging.ConsoleHandler.level = SEVERE
+java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter