Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 9680acf2e -> a9da42b02
Some changes to the STSTokenOutInterceptor to make it easier to subclass Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7fdc3403 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7fdc3403 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7fdc3403 Branch: refs/heads/3.1.x-fixes Commit: 7fdc34030bdcfaa4226c28ea8ce83f34563a5b6d Parents: 9680acf Author: Colm O hEigeartaigh <[email protected]> Authored: Thu Nov 19 14:27:39 2015 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Thu Nov 19 17:53:19 2015 +0000 ---------------------------------------------------------------------- .../policy/interceptors/STSTokenOutInterceptor.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/7fdc3403/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSTokenOutInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSTokenOutInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSTokenOutInterceptor.java index 14b8b5f..f0683e0 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSTokenOutInterceptor.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSTokenOutInterceptor.java @@ -51,7 +51,11 @@ public class STSTokenOutInterceptor extends AbstractPhaseInterceptor<Message> { private TokenRequestParams tokenParams; public STSTokenOutInterceptor(AuthParams authParams, String stsWsdlLocation, Bus bus) { - super(Phase.PREPARE_SEND); + this(Phase.PREPARE_SEND, authParams, stsWsdlLocation, bus); + } + + public STSTokenOutInterceptor(String phase, AuthParams authParams, String stsWsdlLocation, Bus bus) { + super(phase); this.stsClient = configureBasicSTSClient(authParams, stsWsdlLocation, bus); this.tokenParams = new TokenRequestParams(); } @@ -79,6 +83,12 @@ public class STSTokenOutInterceptor extends AbstractPhaseInterceptor<Message> { if (tok == null) { LOG.warning("Security token was not retrieved from STS"); } + processToken(message, tok); + } + + // An extension point to allow custom processing of the token + protected void processToken(Message message, SecurityToken tok) { + } public STSClient getSTSClient() {
