Author: coheigea
Date: Fri Feb 15 14:35:00 2013
New Revision: 1446599
URL: http://svn.apache.org/r1446599
Log:
Merged revisions 1446598 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1446598 | coheigea | 2013-02-15 14:28:28 +0000 (Fri, 15 Feb 2013) | 2 lines
[CXF-4831] - Support renewing SAML Tokens by default in the
DefaultSecurityTokenServiceProvider
........
Modified:
cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/provider/DefaultSecurityTokenServiceProvider.java
Modified:
cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/provider/DefaultSecurityTokenServiceProvider.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/provider/DefaultSecurityTokenServiceProvider.java?rev=1446599&r1=1446598&r2=1446599&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/provider/DefaultSecurityTokenServiceProvider.java
(original)
+++
cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/provider/DefaultSecurityTokenServiceProvider.java
Fri Feb 15 14:35:00 2013
@@ -28,10 +28,13 @@ import org.apache.cxf.sts.STSPropertiesM
import org.apache.cxf.sts.claims.ClaimsManager;
import org.apache.cxf.sts.operation.AbstractOperation;
import org.apache.cxf.sts.operation.TokenIssueOperation;
+import org.apache.cxf.sts.operation.TokenRenewOperation;
import org.apache.cxf.sts.operation.TokenValidateOperation;
import org.apache.cxf.sts.service.ServiceMBean;
import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
import org.apache.cxf.sts.token.provider.TokenProvider;
+import org.apache.cxf.sts.token.renewer.SAMLTokenRenewer;
+import org.apache.cxf.sts.token.renewer.TokenRenewer;
import org.apache.cxf.sts.token.validator.SAMLTokenValidator;
import org.apache.cxf.sts.token.validator.TokenValidator;
import org.apache.cxf.sts.token.validator.UsernameTokenValidator;
@@ -42,7 +45,8 @@ import org.apache.cxf.ws.security.tokens
/**
* A "default" SecurityTokenServiceProvider implementation that defines the
Issue and Validate
* Operations of the STS and adds support for issuing and validating SAML
Assertions, and
- * validating UsernameTokens and X.509 Tokens.
+ * validating UsernameTokens and X.509 Tokens. It also defines the Renew
Operation for SAML
+ * tokens.
*/
public class DefaultSecurityTokenServiceProvider extends
SecurityTokenServiceProvider {
@@ -89,6 +93,9 @@ public class DefaultSecurityTokenService
if (getValidateOperation() == null) {
setValidateOperation(createTokenValidateOperation());
}
+ if (getRenewOperation() == null) {
+ setRenewOperation(createTokenRenewOperation());
+ }
return super.invoke(request);
}
@@ -106,6 +113,17 @@ public class DefaultSecurityTokenService
return validateOperation;
}
+ private TokenRenewOperation createTokenRenewOperation() {
+ TokenRenewOperation renewOperation = new TokenRenewOperation();
+ populateAbstractOperation(renewOperation);
+
+ List<TokenRenewer> tokenRenewers = new ArrayList<TokenRenewer>();
+ tokenRenewers.add(new SAMLTokenRenewer());
+ renewOperation.setTokenRenewers(tokenRenewers);
+
+ return renewOperation;
+ }
+
private void populateAbstractOperation(AbstractOperation
abstractOperation) {
List<TokenProvider> tokenProviders = new ArrayList<TokenProvider>();
tokenProviders.add(new SAMLTokenProvider());