Advertisement
Guest User

Untitled

a guest
Oct 7th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. @Configuration
  2. @EnableWebSecurity(debug = true)
  3. public class SecurityConfig extends WebSecurityConfigurerAdapter {
  4.  
  5. @Override
  6. public void configure(final AuthenticationManagerBuilder auth) throws Exception {
  7. auth
  8. .ldapAuthentication()
  9. .userSearchBase("")
  10. .userSearchFilter("(uid={0})")
  11. .groupSearchBase("ou=Groups")
  12. .groupSearchFilter("(uniqueMember={0})")
  13. .userDetailsContextMapper(new InetOrgPersonContextMapper())
  14. .contextSource(contextSource())
  15. .passwordCompare()
  16. .passwordAttribute("telephoneNumber")
  17. ;
  18. }
  19.  
  20. @Bean
  21. public DefaultSpringSecurityContextSource contextSource() {
  22. return new DefaultSpringSecurityContextSource(
  23. Arrays.asList("ldap://localhost:" + LDAP_PORT + "/"), "dc=jbcpcalendar,dc=com");
  24. }
  25.  
  26. }
  27.  
  28. spring:
  29. ldap:
  30. embedded:
  31. ldif: classpath:/ldif/calendar.ldif
  32. baseDn: dc=jbcpcalendar,dc=com
  33. port: ${LDAP_PORT:33389}
  34. # credential:
  35. # username: user
  36. # password: secret
  37.  
  38. subprojects {
  39.  
  40. dependencies {
  41.  
  42. compile "org.apereo.cas:cas-server-support-ldap:${project.'cas.version'}"
  43.  
  44. // LDAP:
  45. // Not sure if I need and/or want this starter:
  46. compile("org.springframework.boot:spring-boot-starter-data-ldap:${project.'springboot.version'}")
  47.  
  48. compile("org.springframework.ldap:spring-ldap-core:2.3.1.RELEASE")
  49. compile("org.springframework.security:spring-security-ldap:4.2.3.RELEASE")
  50. // Due to a artifact resolution issue with Gradle,
  51. // spring-tx must be pulled in or Gradle will fetch an older one that doesn’t work.
  52. compile("org.springframework:spring-tx")
  53. compile("com.unboundid:unboundid-ldapsdk")
  54.  
  55. // Security:
  56. compile("org.springframework.boot:spring-boot-starter-security")
  57. }
  58.  
  59. 06:16:37.706 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
  60. 06:16:37.706 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating root project 'chapter10.00-cas-server'.
  61. 06:16:37.706 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-data-ldap:1.5.3.RELEASE] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  62.  
  63. compile "org.apereo.cas:cas-server-support-ldap:${project.'cas.version'}"
  64.  
  65. compile("org.springframework.boot:spring-boot-starter-web")
  66. compile("org.codehaus.groovy:groovy")
  67.  
  68. // LDAP:
  69. // Not sure if I need and/or want this starter:
  70. compile("org.springframework.boot:spring-boot-starter-data-ldap")
  71.  
  72. compile("org.springframework.ldap:spring-ldap-core:2.3.1.RELEASE")
  73. compile("org.springframework.security:spring-security-ldap:4.2.3.RELEASE")
  74. // Due to a artifact resolution issue with Gradle,
  75. // spring-tx must be pulled in or Gradle will fetch an older one that doesn’t work.
  76. compile("org.springframework:spring-tx")
  77. compile("com.unboundid:unboundid-ldapsdk")
  78.  
  79.  
  80. // Security:
  81. compile("org.springframework.boot:spring-boot-starter-security")
  82.  
  83. 06:24:57.567 [QUIET] [system.out]
  84. 06:24:57.644 [QUIET] [system.out] __ ____ _ ____ __
  85. 06:24:57.645 [QUIET] [system.out] / / / ___| / / ___|
  86. 06:24:57.645 [QUIET] [system.out] | | | | / _ ___ | |
  87. 06:24:57.645 [QUIET] [system.out] | | | |___ / ___ ___) | | |
  88. 06:24:57.645 [QUIET] [system.out] | | ____| /_/ _ |____/ | |
  89. 06:24:57.645 [QUIET] [system.out] _ /_/
  90. 06:24:57.645 [QUIET] [system.out]
  91. 06:24:57.645 [QUIET] [system.out] CAS Version: 5.1.2
  92. 06:24:57.645 [QUIET] [system.out] CAS Commit Id: fae163b426ba91cc78a18e3805b2f2fac9c03b2e
  93. 06:24:57.645 [QUIET] [system.out] CAS Build Date/Time: 2017-09-20T12:19:37Z
  94. 06:24:57.645 [QUIET] [system.out] Spring Boot Version: 1.5.3.RELEASE
  95. 06:24:57.645 [QUIET] [system.out] ------------------------------------------------------------
  96. 06:24:57.645 [QUIET] [system.out] System Date/Time: 2017-09-20T06:24:57.372
  97. 06:24:57.645 [QUIET] [system.out] System Temp Directory: /var/folders/vm/nx7j7v8x4db1f4xsztj_rsmm0000gn/T/
  98. 06:24:57.646 [QUIET] [system.out] ------------------------------------------------------------
  99. 06:24:57.646 [QUIET] [system.out] Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
  100. 06:24:57.646 [QUIET] [system.out] Java Vendor: Oracle Corporation
  101. 06:24:57.646 [QUIET] [system.out] Java Version: 1.8.0_144
  102. 06:24:57.646 [QUIET] [system.out] JCE Installed: no
  103. 06:24:57.646 [QUIET] [system.out] ------------------------------------------------------------
  104. 06:24:57.646 [QUIET] [system.out] OS Architecture: x86_64
  105. 06:24:57.646 [QUIET] [system.out] OS Name: Mac OS X
  106. 06:24:57.646 [QUIET] [system.out] OS Version: 10.12.6
  107. 06:24:57.646 [QUIET] [system.out] ------------------------------------------------------------
  108. 06:24:57.646 [QUIET] [system.out] Apache Tomcat Version: Apache Tomcat/8.5.20
  109. 06:24:57.646 [QUIET] [system.out] ------------------------------------------------------------
  110. 06:24:57.646 [QUIET] [system.out]
  111. 06:24:57.646 [QUIET] [system.out]
  112. 06:24:57.833 [QUIET] [system.out] 2017-09-20 06:24:57.833 INFO 17183 --- [ main] .CasCoreBootstrapStandaloneConfiguration : Configuration files found at [/etc/cas/config] are [[/etc/cas/config/application.yml, /etc/cas/config/cas.properties]]
  113. 06:24:57.852 [QUIET] [system.out] 2017-09-20 06:24:57.852 INFO 17183 --- [ main] .CasCoreBootstrapStandaloneConfiguration : Found and loaded [14] setting(s) from [/etc/cas/config]
  114. 06:24:57.852 [QUIET] [system.out] 2017-09-20 06:24:57.852 INFO 17183 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: PropertiesPropertySource {name='standaloneCasConfigService'}
  115. 06:25:00.680 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
  116. 06:25:00.681 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
  117. 06:25:00.681 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
  118. 06:25:00.681 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
  119. 06:25:00.681 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
  120. 06:25:00.681 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
  121. 06:25:00.682 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
  122. 06:25:01.171 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
  123. 06:25:01.171 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] **Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java'' finished with exit value 1 (state: FAILED)**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement