Skip to content

Commit

Permalink
Added SAMLIssuer property
Browse files Browse the repository at this point in the history
Added SAMLIssuer property to Wss4jSecurityInterceptor.

Issue: SWS-856
  • Loading branch information
Arjen Poutsma committed Apr 25, 2014
1 parent 1a5416d commit 195a625
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.ws.security.handler.WSHandlerConstants;
import org.apache.ws.security.handler.WSHandlerResult;
import org.apache.ws.security.message.token.Timestamp;
import org.apache.ws.security.saml.SAMLIssuer;
import org.apache.ws.security.util.WSSecurityUtil;
import org.apache.ws.security.validate.Credential;
import org.apache.ws.security.validate.SignatureTrustValidator;
Expand Down Expand Up @@ -88,6 +89,8 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl

public static final String SECUREMENT_USER_PROPERTY_NAME = "Wss4jSecurityInterceptor.securementUser";

private static final String SAML_ISSUER_PROPERTY_NAME = "Wss4jSecurityInterceptor.samlIssuer";

private int securementAction;

private String securementActions;
Expand Down Expand Up @@ -119,6 +122,8 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
private int securementTimeToLive = 300;

private int futureTimeToLive = 60;

private SAMLIssuer samlIssuer;

private WSSConfig wssConfig;

Expand Down Expand Up @@ -489,6 +494,14 @@ public void setFutureTimeToLive(int futureTimeToLive) {
this.futureTimeToLive = futureTimeToLive;
}

/**
* Sets the SAML issuer.
*/
public void setSamlIssuer(SAMLIssuer samlIssuer) {
handler.setOption(WSHandlerConstants.SAML_PROP_REF_ID, SAML_ISSUER_PROPERTY_NAME);
this.samlIssuer = samlIssuer;
}

@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(validationActions != null || securementActions != null,
Expand Down Expand Up @@ -566,6 +579,8 @@ protected RequestData initializeRequestData(MessageContext messageContext) {

messageContext.setProperty(WSHandlerConstants.TTL_TIMESTAMP, Integer.toString(securementTimeToLive));

messageContext.setProperty(SAML_ISSUER_PROPERTY_NAME, samlIssuer);

return requestData;
}

Expand Down

0 comments on commit 195a625

Please sign in to comment.