Author: coheigea
Date: Tue Jun 12 11:28:20 2012
New Revision: 1349264
URL: http://svn.apache.org/viewvc?rev=1349264&view=rev
Log:
Strip the SecurityToken Identifier of a "#" prefix if it exists
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java?rev=1349264&r1=1349263&r2=1349264&view=diff
==============================================================================
---
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
(original)
+++
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
Tue Jun 12 11:28:20 2012
@@ -141,10 +141,16 @@ 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);
+ }
}
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);
+ }
if (created != null) {
this.created = new Date(created.getTime());
}
@@ -158,6 +164,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);
if (created != null) {
this.created = new Date(created.getTime());
@@ -171,6 +180,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);
@@ -259,6 +271,9 @@ public class SecurityToken implements Se
*/
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);
+ }
}
/**