cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Add support for specifying a Kerberos CallbackHandler + isUsernameInServiceForm boolean
Date Tue, 02 Sep 2014 14:49:19 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 8991f44ed -> e37619325


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/e3761932
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/e3761932
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/e3761932

Branch: refs/heads/master
Commit: e37619325cdb5f1a6e5f24606c8ba97786b80215
Parents: 8991f44
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Sep 2 15:48:57 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Sep 2 15:48:57 2014 +0100

----------------------------------------------------------------------
 .../service/idp/STSAuthenticationProvider.java  | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e3761932/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 d604281..ef102c8 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,11 +27,11 @@ 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;
 
 import org.w3c.dom.Element;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 //import org.apache.cxf.endpoint.Client;
@@ -101,6 +101,10 @@ public class STSAuthenticationProvider implements AuthenticationProvider
{
     
     private KerberosTokenValidator kerberosTokenValidator;
     
+    private CallbackHandler kerberosCallbackHandler;
+    
+    private boolean kerberosUsernameServiceNameForm;
+    
     
     @Override
     public Authentication authenticate(Authentication authentication) throws AuthenticationException
{
@@ -150,6 +154,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());
@@ -427,6 +437,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();


Mime
View raw message