[teiid-commits] teiid SVN: r3698 - in branches/7.6.x: client/src/main/resources/org/teiid/jdbc and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Nov 23 13:30:27 EST 2011


Author: rareddy
Date: 2011-11-23 13:30:27 -0500 (Wed, 23 Nov 2011)
New Revision: 3698

Modified:
   branches/7.6.x/client/src/main/java/org/teiid/gss/MakeGSS.java
   branches/7.6.x/client/src/main/resources/org/teiid/jdbc/i18n.properties
   branches/7.6.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
Log:
TEIID-1687, TEIID-1610: making the ODBC connection not use pass-through; added some error messages for jdbc configuration part if they are missing

Modified: branches/7.6.x/client/src/main/java/org/teiid/gss/MakeGSS.java
===================================================================
--- branches/7.6.x/client/src/main/java/org/teiid/gss/MakeGSS.java	2011-11-23 17:30:26 UTC (rev 3697)
+++ branches/7.6.x/client/src/main/java/org/teiid/gss/MakeGSS.java	2011-11-23 18:30:27 UTC (rev 3698)
@@ -67,8 +67,42 @@
 
         Object result = null;
 
-        String jaasApplicationName = props.getProperty(TeiidURL.CONNECTION.JAAS_NAME, "teiid"); //$NON-NLS-1$
-        String kerberosPrincipalName =  props.getProperty(TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME, "teiid"); //$NON-NLS-1$
+        StringBuilder errors = new StringBuilder();
+        String jaasApplicationName = props.getProperty(TeiidURL.CONNECTION.JAAS_NAME);
+        String nl = System.getProperty("line.separator");//$NON-NLS-1$
+        if (jaasApplicationName == null) {
+        	errors.append(JDBCPlugin.Util.getString("client_prop_missing", TeiidURL.CONNECTION.JAAS_NAME)); //$NON-NLS-1$
+        	errors.append(nl);
+        }
+        
+        String kerberosPrincipalName =  props.getProperty(TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME);
+        if (kerberosPrincipalName == null) {
+        	errors.append(JDBCPlugin.Util.getString("client_prop_missing", TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME)); //$NON-NLS-1$
+        	errors.append(nl);
+        }
+        
+        String realm = System.getProperty("java.security.krb5.realm"); //$NON-NLS-1$
+        if (realm == null) {
+        	errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.krb5.realm")); //$NON-NLS-1$ //$NON-NLS-2$
+        	errors.append(nl);
+        }
+        
+        String kdc = System.getProperty("java.security.krb5.kdc"); //$NON-NLS-1$
+        if (kdc == null) {
+        	errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.krb5.kdc")); //$NON-NLS-1$ //$NON-NLS-2$
+        	errors.append(nl);
+        }  
+        
+        String config = System.getProperty("java.security.auth.login.config"); //$NON-NLS-1$
+        if (config == null) {
+        	errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.auth.login.config")); //$NON-NLS-1$ //$NON-NLS-2$
+        	errors.append(nl);
+        }         
+        
+        if (errors.length() > 0) {
+        	throw  new LogonException(errors.toString()); 
+        }
+        
         String user = props.getProperty(TeiidURL.CONNECTION.USER_NAME);
         String password = props.getProperty(TeiidURL.CONNECTION.PASSWORD);
         

Modified: branches/7.6.x/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- branches/7.6.x/client/src/main/resources/org/teiid/jdbc/i18n.properties	2011-11-23 17:30:26 UTC (rev 3697)
+++ branches/7.6.x/client/src/main/resources/org/teiid/jdbc/i18n.properties	2011-11-23 18:30:27 UTC (rev 3698)
@@ -155,3 +155,5 @@
 no_krb_ticket=No cached kerberos ticket found and/or no password supplied
 gss_auth_failed=GSS Authentication failed
 setup_failed=Protocol error.  Session setup failed.
+client_prop_missing=Client URL connection property missing "{0}". Please add the property to connection URL.
+system_prop_missing=System property "{0}" missing, please add using -D option on the VM startup script.
\ No newline at end of file

Modified: branches/7.6.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/7.6.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2011-11-23 17:30:26 UTC (rev 3697)
+++ branches/7.6.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2011-11-23 18:30:27 UTC (rev 3698)
@@ -201,7 +201,6 @@
 			info.put("user", user); //$NON-NLS-1$
 			
 			String password = null; 
-			String passthroughAuthentication = ""; //$NON-NLS-1$
 			if (authType.equals(AuthenticationType.CLEARTEXT)) {
 				password = data.readString();
 			}
@@ -210,7 +209,6 @@
             	LogonResult result = this.logon.neogitiateGssLogin(this.props, serviceToken, false);
             	serviceToken = (byte[])result.getProperty(ILogon.KRB5TOKEN);
             	if (Boolean.TRUE.equals(result.getProperty(ILogon.KRB5_ESTABLISHED))) {
-                	passthroughAuthentication = ";PassthroughAuthentication=true;authenticationType=KRB5"; //$NON-NLS-1$
                 	info.put(ILogon.KRB5TOKEN, serviceToken);
             	}
             	else {
@@ -220,7 +218,7 @@
 			}
 			
 			// this is local connection
-			String url = "jdbc:teiid:"+databaseName+";ApplicationName=ODBC"+passthroughAuthentication; //$NON-NLS-1$ //$NON-NLS-2$
+			String url = "jdbc:teiid:"+databaseName+";ApplicationName=ODBC"; //$NON-NLS-1$ //$NON-NLS-2$
 
 			if (password != null) {
 				info.put("password", password); //$NON-NLS-1$



More information about the teiid-commits mailing list