Thank you for your reply Tom. In regards to the hostname, do you mean I
should check the ldap URL? If so what I did is use the ldp.exe on windows
and instantiated a connection to the active directory using the same url
that im using and it worked fine. For the port, basically I'm using port
389 and in both the inbound and outbound rules there is a rule that allows
communication on that port. I attached most of the errors that I'm getting,
and I would really appreciate if you could have a look and give me some
advise on what to do ?
On Wednesday, January 17, 2018 at 4:10:51 PM UTC+2, oneill wrote:
>
> The connection reset is a networking issue.
> I would confirm the hostname and port that you are using and I would
> confirm that your VM should be able to hit the port and isn't being blocked
> by a firewall.
>
> Thanks,
>
> Tom
>
> -----Original Message-----
> From: [email protected] <javascript:> [mailto:[email protected]
> <javascript:>] On Behalf Of W.Katerji
> Sent: Tuesday, January 16, 2018 3:23 PM
> To: CAS Community <[email protected] <javascript:>>
> Subject: [cas-user] Ldap Authentication with Active Directory
>
> Hello
>
> I'm a first time CAS user, and working on it as part of my final year
> project at university. I'm working on a windows server 2016 virtual
> machine. I've been stuck in the setting up of LDAP Authentication on an
> active directory in CAS version 5.
> The exact steps I followed were the following: I downloaded the template
> folder from github, created a keystore file and added it in the specified
> location (C:\etc\cas\). I then ran "build.cmd run" on windows cmd from
> within the template folder and was able to open the CAS pageand log in
> using casuser and Mellon. I set up active directory on the virtual machine,
> and am now ready to set up the LDAP authentication. I know I need to edit
> the cas.properties folder and add the attributes related to LDAP, however
> I'm not quite sure which attributes I need to use exactly and how to fill
> in their values. I tried different sets of attribues after reading multiple
> posts here on the forum, however none seemed to work, and the latest set of
> attributes I added were as follows (also note that I added the ldap
> dependency to the pom.xml file):
>
> cas.authn.accept.users:
> cas.authn.ldap[0].order: 0
> cas.authn.ldap[0].name: Active Directory
> cas.authn.ldap[0].type: AUTHENTICATED
> cas.authn.ldap[0].ldapUrl: ldap://Virtual Machine IP
> Address:389
> cas.authn.ldap[0].userFilter: sAMAccountName={user}
> cas.authn.ldap[0].baseDn:
> ou=Users,dc=-----,dc=-----,dc=-----,dc=-----,dc=com
> cas.authn.ldap[0].dnFormat:
> cn=%s,ou=Users,dc=-----,dc=-----,dc=-----,dc=-----,dc=com
> cas.authn.ldap[0].connectTimeout=3000
> cas.authn.ldap[0].useStartTLS=false
> cas.authn.ldap[0].minPoolSize=3
> cas.authn.ldap[0].maxPoolSize=10
> cas.authn.ldap[0].validateOnCheckout=false
> cas.authn.ldap[0].validatePeriodically=true
> cas.authn.ldap[0].validatePeriod=300
> cas.authn.ldap[0].blockWaitTime=3000
> cas.authn.ldap[0].prunePeriod=300
> cas.authn.ldap[0].idleTime=600
> cas.authn.ldap[0].bindDn=---
> cas.authn.ldap[0].bindCredential=---
> cas.authn.ldap[0].userFilter=(sAMAccountName={user})
>
> The error I'm currently getting is related to the LDAP connection to the
> active directory, more exactly I'm getting a connection reset error. I am
> not sure how to go forward from here and I'm not quite sure if these are
> the attributes needed exactly. Any help would be appreciated.
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> You received this message because you are subscribed to the Google Groups
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/ca277ff4-ad44-4554-a8c4-0abbba019950%40apereo.org.
>
>
>
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/8165e5cb-bb62-4cd5-a817-590f8fa6d26c%40apereo.org.
org.ldaptive.provider.ConnectionException: javax.naming.CommunicationException:
-- [Root exception is java.net.SocketException: Connection reset]
Caused by: javax.naming.CommunicationException: --
Caused by: java.net.SocketException: Connection reset
2018-01-17 15:47:44,890 ERROR [org.ldaptive.pool.BlockingConnectionPool] -
<[org.ldaptive.pool.BlockingConnectionPool@1752223660::name=null,
poolConfig=[org.ldaptive.pool.PoolConfig@1163216403::minPoolSize=3,
maxPoolSize=10, validateOnCheckIn=false, validateOnCheckOut=true,
validatePeriodically=true, validatePeriod=PT5M, validateTimeout=PT5S],
activator=null, passivator=null,
validator=[org.ldaptive.pool.SearchValidator@1675999402::searchRequest=[org.ldaptive.SearchRequest@-1134336385::baseDn=,
searchFilter=[org.ldaptive.SearchFilter@1642584434::filter=(objectClass=*),
parameters={}], returnAttributes=[1.1], searchScope=OBJECT, timeLimit=PT0S,
sizeLimit=1, derefAliases=null, typesOnly=false, binaryAttributes=null,
sortBehavior=UNORDERED, searchEntryHandlers=null,
searchReferenceHandlers=[org.ldaptive.referral.SearchReferralHandler$SearchReferenceHandler@2c9306d3],
controls=null,
referralHandler=org.ldaptive.referral.SearchReferralHandler@6314df3c,
intermediateResponseHandlers=null]]
pruneStrategy=[org.ldaptive.pool.IdlePruneStrategy@1468393491::prunePeriod=PT2H,
idleTime=PT10M], connectOnCreate=true,
connectionFactory=[org.ldaptive.DefaultConnectionFactory@280541440::provider=org.ldaptive.provider.jndi.JndiProvider@6d294ddc,
config=[org.ldaptive.ConnectionConfig@671187578::ldapUrl=ldap://--,
connectTimeout=PT5S, responseTimeout=PT5S,
sslConfig=[org.ldaptive.ssl.SslConfig@1354510873::credentialConfig=null,
trustManagers=null, hostnameVerifier=null, hostnameVerifierConfig=null,
enabledCipherSuites=null, enabledProtocols=null,
handshakeCompletedListeners=null], useSSL=true, useStartTLS=false,
connectionInitializer=null,
connectionStrategy=org.ldaptive.DefaultConnectionStrategy@599f1b7]],
initialized=false, availableCount=0, activeCount=0] unable to connect to the
ldap>
org.ldaptive.provider.ConnectionException: javax.naming.CommunicationException:
-- [Root exception is java.net.SocketException: Connection reset]
2018-01-17 15:47:44,921 WARN [org.apereo.cas.web.CasWebApplicationContext] -
<Exception encountered during context initialization - cancelling refresh
attempt: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'casReportsConfiguration': Unsatisfied dependency
expressed through field 'authenticationSystemSupport'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'defaultAuthenticationSystemSupport' defined in class
path resource
[org/apereo/cas/config/CasCoreAuthenticationSupportConfiguration.class]:
Unsatisfied dependency expressed through method
'defaultAuthenticationSystemSupport' parameter 1; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'authenticationTransactionManager' defined in class
path resource [org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]:
Unsatisfied dependency expressed through method
'authenticationTransactionManager' parameter 0; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'casAuthenticationManager' defined in class path
resource [org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]:
Unsatisfied dependency expressed through method 'casAuthenticationManager'
parameter 2; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'authenticationEventExecutionPlan' defined in class path resource
[org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.apereo.cas.authentication.AuthenticationEventExecutionPlan]: Factory
method 'authenticationEventExecutionPlan' threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'ldapAuthenticationHandlers' defined in class path resource
[org/apereo/cas/config/LdapAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[java.util.Collection]: Factory method 'ldapAuthenticationHandlers' threw
exception; nested exception is java.lang.IllegalStateException: Could not
initialize pool size>
2018-01-17 15:47:44,921 WARN
[com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter] -
<Problem stopping reporter>
org.springframework.beans.factory.BeanCreationNotAllowedException: Error
creating bean with name 'casMetricsConfiguration': Singleton bean creation not
allowed while singletons of this factory are in destruction
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'casReportsConfiguration': Unsatisfied dependency
expressed through field 'authenticationSystemSupport'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'defaultAuthenticationSystemSupport' defined in class
path resource
[org/apereo/cas/config/CasCoreAuthenticationSupportConfiguration.class]:
Unsatisfied dependency expressed through method
'defaultAuthenticationSystemSupport' parameter 1; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'authenticationTransactionManager' defined in class
path resource [org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]:
Unsatisfied dependency expressed through method
'authenticationTransactionManager' parameter 0; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'casAuthenticationManager' defined in class path
resource [org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]:
Unsatisfied dependency expressed through method 'casAuthenticationManager'
parameter 2; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'authenticationEventExecutionPlan' defined in class path resource
[org/apereo/cas/config/CasCoreAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.apereo.cas.authentication.AuthenticationEventExecutionPlan]: Factory
method 'authenticationEventExecutionPlan' threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'ldapAuthenticationHandlers' defined in class path resource
[org/apereo/cas/config/LdapAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[java.util.Collection]: Factory method 'ldapAuthenticationHandlers' threw
exception; nested exception is java.lang.IllegalStateException: Could not
initialize pool size
Caused by: org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.apereo.cas.authentication.AuthenticationEventExecutionPlan]:
Factory method 'authenticationEventExecutionPlan' threw exception; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ldapAuthenticationHandlers' defined in class path
resource [org/apereo/cas/config/LdapAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[java.util.Collection]: Factory method 'ldapAuthenticationHandlers' threw
exception; nested exception is java.lang.IllegalStateException: Could not
initialize pool size
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 89 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ldapAuthenticationHandlers' defined in class path
resource [org/apereo/cas/config/LdapAuthenticationConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[java.util.Collection]: Factory method 'ldapAuthenticationHandlers' threw
exception; nested exception is java.lang.IllegalStateException: Could not
initialize pool size