Revision 121:866143653894
src/main/java/my/com/upass/maybank/MinimalMaybankFacadeImpl.java | ||
---|---|---|
1 | 1 |
package my.com.upass.maybank; |
2 | 2 |
|
3 |
import java.util.HashMap; |
|
3 | 4 |
import java.util.Iterator; |
4 | 5 |
import java.util.LinkedList; |
5 | 6 |
import java.util.List; |
... | ... | |
18 | 19 |
import my.com.upass.pojo.MinimalUserBean; |
19 | 20 |
import my.com.upass.pojo.UserAppAccess; |
20 | 21 |
import my.com.upass.services.AppAccessMgtService; |
22 |
import my.com.upass.spring.ldap.MaybankLdapConstant; |
|
21 | 23 |
|
22 | 24 |
import org.apache.log4j.Logger; |
23 | 25 |
import org.hibernate.Session; |
... | ... | |
38 | 40 |
String appAccessId, String hashedSecretKey, |
39 | 41 |
String username, String hashedPassword) { |
40 | 42 |
|
41 |
return minUpcV2.verifyStaticPassword_withAppChecked( |
|
42 |
appAccessId, hashedSecretKey, username, hashedPassword); |
|
43 |
try { |
|
44 |
if(!minUpcV2.getMaybankLdapDAO().authenticate(username, hashedPassword)){ |
|
45 |
return MinimalConstants.ERR_INVALID_CREDENTIAL; |
|
46 |
} |
|
47 |
} catch (UPassException e) { |
|
48 |
LOGGER.warn("Authenticate LDAP error", e); |
|
49 |
return MinimalConstants.ERR_INVALID_CREDENTIAL; |
|
50 |
} |
|
51 |
|
|
52 |
return MinimalConstants.ERR_SUCCESS; |
|
53 |
|
|
54 |
|
|
55 |
//TODO: skip upass |
|
56 |
// return minUpcV2.verifyStaticPassword_withAppChecked( |
|
57 |
// appAccessId, hashedSecretKey, username, hashedPassword); |
|
43 | 58 |
} |
44 | 59 |
|
45 | 60 |
public int newUser( |
... | ... | |
62 | 77 |
String appAccessId, String hashedSecretKey, |
63 | 78 |
String username, String oldHashedPassword, String newHashedPassword) { |
64 | 79 |
|
65 |
return minUpcV2.changeStaticPassword_withAppChecked( |
|
66 |
appAccessId, hashedSecretKey, username, newHashedPassword, oldHashedPassword); |
|
80 |
Map attrMap = new HashMap(); |
|
81 |
attrMap.put(MaybankLdapConstant.ATTR_PASSWORD, newHashedPassword); |
|
82 |
try { |
|
83 |
minUpcV2.getMaybankLdapDAO().updateUser(username, attrMap); |
|
84 |
} catch (UPassException e) { |
|
85 |
LOGGER.warn("Change password LDAP error", e); |
|
86 |
return MinimalConstants.ERR_LDAP; |
|
87 |
} |
|
88 |
|
|
89 |
return MinimalConstants.ERR_SUCCESS; |
|
90 |
|
|
91 |
//TODO:skip upass |
|
92 |
// return minUpcV2.changeStaticPassword_withAppChecked( |
|
93 |
// appAccessId, hashedSecretKey, username, newHashedPassword, oldHashedPassword); |
|
67 | 94 |
} |
68 | 95 |
|
69 | 96 |
public int resetPassword( |
70 | 97 |
String appAccessId, String hashedSecretKey, |
71 | 98 |
String username, String newHashedPassword) { |
72 | 99 |
|
73 |
return minUpcV2.resetPassword_withAppChecked( |
|
74 |
appAccessId, hashedSecretKey, username, newHashedPassword); |
|
100 |
Map attrMap = new HashMap(); |
|
101 |
attrMap.put(MaybankLdapConstant.ATTR_PASSWORD, newHashedPassword); |
|
102 |
try { |
|
103 |
minUpcV2.getMaybankLdapDAO().updateUser(username, attrMap); |
|
104 |
} catch (UPassException e) { |
|
105 |
LOGGER.warn("Change password LDAP error", e); |
|
106 |
return MinimalConstants.ERR_LDAP; |
|
107 |
} |
|
108 |
|
|
109 |
return MinimalConstants.ERR_SUCCESS; |
|
110 |
|
|
111 |
//TODO:skip upass |
|
112 |
// return minUpcV2.resetPassword_withAppChecked( |
|
113 |
// appAccessId, hashedSecretKey, username, newHashedPassword); |
|
75 | 114 |
} |
76 | 115 |
|
77 | 116 |
public int changePan1( |
Also available in: Unified diff