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/04/12 13:07:30 UTC
svn commit: r1325203 -
/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
Author: coheigea
Date: Thu Apr 12 11:07:30 2012
New Revision: 1325203
URL: http://svn.apache.org/viewvc?rev=1325203&view=rev
Log:
[CXF-4158] - Minor update
Modified:
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java?rev=1325203&r1=1325202&r2=1325203&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java Thu Apr 12 11:07:30 2012
@@ -180,7 +180,6 @@ public class SAMLTokenRenewer implements
AssertionWrapper assertion = new AssertionWrapper((Element)tokenToRenew.getToken());
byte[] oldSignature = assertion.getSignatureValue();
- // Remove the previous token (now expired) from the cache
int hash = Arrays.hashCode(oldSignature);
SecurityToken cachedToken = tokenStore.getToken(Integer.toString(hash));
if (cachedToken == null) {
@@ -192,6 +191,7 @@ public class SAMLTokenRenewer implements
validateAssertion(assertion, tokenToRenew, cachedToken, tokenParameters);
String oldId = createNewId(assertion);
+ // Remove the previous token (now expired) from the cache
tokenStore.remove(oldId);
tokenStore.remove(Integer.toString(hash));
@@ -297,10 +297,6 @@ public class SAMLTokenRenewer implements
String isAllowRenewal = (String)props.get(STSConstants.TOKEN_RENEWING_ALLOW);
String isAllowRenewalAfterExpiry =
(String)props.get(STSConstants.TOKEN_RENEWING_ALLOW_AFTER_EXPIRY);
- if (isAllowRenewal == null || isAllowRenewalAfterExpiry == null) {
- LOG.log(Level.WARNING, "One of isAllowRenewal or isAllowRenewalAfterExpiry not set");
- throw new STSException("Error with cached token", STSException.REQUEST_FAILED);
- }
if (isAllowRenewal == null || !Boolean.valueOf(isAllowRenewal)) {
LOG.log(Level.WARNING, "The token is not allowed to be renewed");