This repository was archived by the owner on Jul 6, 2022. It is now read-only.
File tree 4 files changed +27
-7
lines changed
src/main/java/com/ericsson/eiffel/remrem/config
4 files changed +27
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.3.2
2
+ - Implemented base64 encryption functionality for LDAP manager password
3
+
1
4
## 0.3.1
2
5
- Implemented ldap authentication functionality
3
6
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ apply plugin: 'spring-boot'
22
22
23
23
jar {
24
24
baseName = ' remrem-shared'
25
- version = ' 0.3.1 '
25
+ version = ' 0.3.2 '
26
26
}
27
27
ext {
28
28
springSecurityVersion = " 1.4.1.RELEASE"
@@ -47,6 +47,9 @@ repositories {
47
47
dependencies {
48
48
compile' com.google.code.gson:gson:2.6.2'
49
49
compile(" org.springframework.boot:spring-boot-starter-security:$springSecurityVersion " )
50
+ compile(" org.springframework.security:spring-security-ldap:4.1.3.RELEASE" )
51
+ compile ' commons-codec:commons-codec:1.10'
52
+
50
53
compile ' javax.servlet:javax.servlet-api:3.0.1'
51
54
testCompile ' junit:junit:4.12'
52
55
}
Original file line number Diff line number Diff line change
1
+ package com .ericsson .eiffel .remrem .config ;
2
+
3
+ import org .apache .commons .codec .binary .Base64 ;
4
+ import org .apache .commons .codec .binary .StringUtils ;
5
+
6
+ public class Base64Decryption {
7
+
8
+ // To decrypt Base64 encode ldap manager password
9
+ protected String decode (String password ) {
10
+ return StringUtils .newStringUtf8 (Base64 .decodeBase64 (password ));
11
+ }
12
+
13
+ }
Original file line number Diff line number Diff line change 1
1
package com .ericsson .eiffel .remrem .config ;
2
2
3
- import org .slf4j .Logger ;
4
- import org .slf4j .LoggerFactory ;
5
3
import org .springframework .beans .factory .annotation .Value ;
6
4
import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
7
5
import org .springframework .context .annotation .Configuration ;
@@ -23,19 +21,22 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
23
21
@ Value ("${activedirectory.ldapUrl}" )
24
22
private String ldapUrl ;
25
23
26
- @ Value ("${activedirectory.ldapPassword }" )
27
- private String ldapPassword ;
24
+ @ Value ("${activedirectory.managerPassword }" )
25
+ private String managerPassword ;
28
26
29
27
@ Value ("${activedirectory.managerDn}" )
30
28
private String managerDn ;
31
29
32
30
@ Value ("${activedirectory.userSearchFilter}" )
33
31
private String userSearchFilter ;
32
+
33
+ @ Value ("${activedirectory.rootDn}" )
34
+ private String rootDn ;
34
35
35
36
@ Override
36
37
protected void configure (AuthenticationManagerBuilder auth ) throws Exception {
37
- auth .ldapAuthentication ().userSearchFilter (userSearchFilter ).contextSource ().managerDn (managerDn )
38
- .managerPassword (ldapPassword ).url (ldapUrl );
38
+ auth .ldapAuthentication ().userSearchFilter (userSearchFilter ).contextSource ().managerDn (managerDn ). root ( rootDn )
39
+ .managerPassword (new Base64Decryption (). decode ( managerPassword ) ).url (ldapUrl );
39
40
}
40
41
41
42
@ Override
You can’t perform that action at this time.
0 commit comments