Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 257421116D for ; Tue, 2 Sep 2014 14:50:28 +0000 (UTC) Received: (qmail 70214 invoked by uid 500); 2 Sep 2014 14:50:27 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 70148 invoked by uid 500); 2 Sep 2014 14:50:27 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 70137 invoked by uid 99); 2 Sep 2014 14:50:27 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2014 14:50:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8B8859AF756; Tue, 2 Sep 2014 14:50:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Message-Id: <942be4f1af7c433398bb0c53ac314fd4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Add support for specifying a Kerberos CallbackHandler + isUsernameInServiceForm boolean Date: Tue, 2 Sep 2014 14:50:27 +0000 (UTC) Repository: cxf-fediz Updated Branches: refs/heads/1.1.x-fixes 5dedd1823 -> 89b8f99ea Add support for specifying a Kerberos CallbackHandler + isUsernameInServiceForm boolean Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/89b8f99e Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/89b8f99e Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/89b8f99e Branch: refs/heads/1.1.x-fixes Commit: 89b8f99ea95455d04d82507e2823d7da19e40bf2 Parents: 5dedd18 Author: Colm O hEigeartaigh Authored: Tue Sep 2 15:48:57 2014 +0100 Committer: Colm O hEigeartaigh Committed: Tue Sep 2 15:50:20 2014 +0100 ---------------------------------------------------------------------- .../service/idp/STSAuthenticationProvider.java | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/89b8f99e/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java ---------------------------------------------------------------------- diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java index c77126b..d189cf5 100644 --- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java +++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.security.auth.callback.CallbackHandler; import javax.security.auth.login.LoginException; import javax.xml.namespace.QName; @@ -93,6 +94,10 @@ public class STSAuthenticationProvider implements AuthenticationProvider { private KerberosTokenValidator kerberosTokenValidator; + private CallbackHandler kerberosCallbackHandler; + + private boolean kerberosUsernameServiceNameForm; + @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { @@ -146,6 +151,12 @@ public class STSAuthenticationProvider implements AuthenticationProvider { kerberosTokenValidator.getContextName()); sts.getProperties().put(SecurityConstants.KERBEROS_SPN, kerberosTokenValidator.getServiceName()); + sts.getProperties().put(SecurityConstants.CALLBACK_HANDLER, + kerberosCallbackHandler); + if (kerberosUsernameServiceNameForm) { + sts.getProperties().put(SecurityConstants.KERBEROS_IS_USERNAME_IN_SERVICENAME_FORM, + "true"); + } } else { sts.getProperties().put(SecurityConstants.USERNAME, authentication.getName()); sts.getProperties().put(SecurityConstants.PASSWORD, (String)authentication.getCredentials()); @@ -411,6 +422,22 @@ public class STSAuthenticationProvider implements AuthenticationProvider { this.kerberosTokenValidator = kerberosTokenValidator; } + public CallbackHandler getKerberosCallbackHandler() { + return kerberosCallbackHandler; + } + + public void setKerberosCallbackHandler(CallbackHandler kerberosCallbackHandler) { + this.kerberosCallbackHandler = kerberosCallbackHandler; + } + + public boolean isKerberosUsernameServiceNameForm() { + return kerberosUsernameServiceNameForm; + } + + public void setKerberosUsernameServiceNameForm(boolean kerberosUsernameServiceNameForm) { + this.kerberosUsernameServiceNameForm = kerberosUsernameServiceNameForm; + } + //May be uncommented for debugging // private void setTimeout(Client client, Long timeout) { // HTTPConduit conduit = (HTTPConduit) client.getConduit();