Author: coheigea Date: Tue Jun 12 13:33:07 2012 New Revision: 1349334 URL: http://svn.apache.org/viewvc?rev=1349334&view=rev Log: Merged revisions 1349320 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........ r1349320 | coheigea | 2012-06-12 14:26:00 +0100 (Tue, 12 Jun 2012) | 15 lines Merged revisions 1349264 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1349264 | coheigea | 2012-06-12 12:28:20 +0100 (Tue, 12 Jun 2012) | 2 lines Strip the SecurityToken Identifier of a "#" prefix if it exists ........ Conflicts: rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java ........ Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java?rev=1349334&r1=1349333&r2=1349334&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java (original) +++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java Tue Jun 12 13:33:07 2012 @@ -160,11 +160,17 @@ public class SecurityToken implements Se public SecurityToken(String id) { this.id = id; + if (this.id != null && this.id.length() > 0 && this.id.charAt(0) == '#') { + this.id = this.id.substring(1); + } createDefaultExpires(); } public SecurityToken(String id, Date created, Date expires) { this.id = id; + if (this.id != null && this.id.length() > 0 && this.id.charAt(0) == '#') { + this.id = this.id.substring(1); + } this.created = created; this.expires = expires; if (expires == null) { @@ -177,6 +183,9 @@ public class SecurityToken implements Se Date created, Date expires) { this.id = id; + if (this.id != null && this.id.length() > 0 && this.id.charAt(0) == '#') { + this.id = this.id.substring(1); + } this.token = cloneElement(tokenElem); this.created = created; this.expires = expires; @@ -189,6 +198,9 @@ public class SecurityToken implements Se Element tokenElem, Element lifetimeElem) { this.id = id; + if (this.id != null && this.id.length() > 0 && this.id.charAt(0) == '#') { + this.id = this.id.substring(1); + } this.token = cloneElement(tokenElem); if (lifetimeElem != null) { processLifeTime(lifetimeElem); @@ -309,7 +321,14 @@ public class SecurityToken implements Se public void setPreviousToken(Element previousToken) { this.previousToken = cloneElement(previousToken); } - + + public void setId(String id) { + this.id = id; + if (this.id != null && this.id.length() > 0 && this.id.charAt(0) == '#') { + this.id = this.id.substring(1); + } + } + /** * @return Returns the secret. */
