ij> -- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- ----- Negative test for SECURE users. This tries to authenticate against an LDAP ----- server on a machine which is not accessible/doesn't exist. ----- ----- 'ldapSchemeDB' - LDAP authentication (on NT thru LDAP) ----- let's create the db and configure it. ----- we will authenticate using a default system user that we have configured. ----- ----- 'ldapSchemeDB' database authentication/authorization config ----- connect 'ldapSchemeDB;create=true;user=system;password=manager'; ij(CONNECTION1)> autocommit off; ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)'; ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.provider'', ''LDAP'')'; Statement executed. ij(CONNECTION1)> -- there is no such machine as noSuchMachine and so the authentication will fail execute p1 using 'values(''derby.authentication.server'', ''noSuchMachine:389'')'; Statement executed. ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')'; Statement executed. ij(CONNECTION1)> -- this is the default search filter execute p1 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')'; Statement executed. ij(CONNECTION1)> commit; ij(CONNECTION1)> autocommit on; ij(CONNECTION1)> -- ----- Shutdown the system for database properties to take effect ----- disconnect all; ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true'; ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'ldapSchemeDB' shutdown. ij> disconnect all; ij> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap'; ERROR 08004: Connection authentication failure occurred. Reason: userid or password invalid. ij> show connections; No connections available. ij> disconnect all; ij> -- Derby system shutdown - check user - should succeed connect ';user=system;password=manager;shutdown=true'; ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: Derby system shutdown. ij>