STSClient produces wrong element order for TokenType
@@ -802,6 +802,10 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
sendKeyType = false;
}
+ if (sptt == null) {
+ addTokenType(writer);
+ }
+
addRequestType(requestType, writer);
if (enableAppliesTo) {
addAppliesTo(writer, appliesTo);
@@ -809,18 +813,20 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
addClaims(writer);
+ if (isSecureConv || enableLifetime) {
+ addLifetime(writer);
+ }
+
+ // Write out renewal semantics
+ writeRenewalSemantics(writer);
+
Element onBehalfOfToken = getOnBehalfOfToken();
if (onBehalfOfToken != null) {
writer.writeStartElement("wst", "OnBehalfOf", namespace);
StaxUtils.copy(onBehalfOfToken, writer);
writer.writeEndElement();
}
- if (sptt == null) {
- addTokenType(writer);
- }
- if (isSecureConv || enableLifetime) {
- addLifetime(writer);
- }
+
if (keyTypeTemplate == null) {
keyTypeTemplate = writeKeyType(writer, keyType);
}
@@ -858,9 +864,6 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
writer.writeEndElement();
}
- // Write out renewal semantics
- writeRenewalSemantics(writer);
-
Element customElement = getCustomContent();
if (customElement != null) {
StaxUtils.copy(customElement, writer);
@@ -1070,14 +1073,15 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
tokenType = STSUtils.getTokenTypeSCT(namespace);
}
+ if (sptt == null) {
+ addTokenType(writer);
+ }
+
addRequestType("/Renew", writer);
if (enableAppliesTo) {
addAppliesTo(writer, tok.getIssuerAddress());
}
- if (sptt == null) {
- addTokenType(writer);
- }
if (isSecureConv || enableLifetime) {
addLifetime(writer);
}
@@ -1146,14 +1150,15 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
writer.writeStartElement("wst", "RequestSecurityToken", namespace);
writer.writeNamespace("wst", namespace);
- writer.writeStartElement("wst", "RequestType", namespace);
- writer.writeCharacters(namespace + "/Validate");
- writer.writeEndElement();
writer.writeStartElement("wst", "TokenType", namespace);
writer.writeCharacters(tokentype);
writer.writeEndElement();
+ writer.writeStartElement("wst", "RequestType", namespace);
+ writer.writeCharacters(namespace + "/Validate");
+ writer.writeEndElement();
+
if (tokentype.endsWith("/RSTR/Status")) {
addClaims(writer);
