1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.kuali.student.lum.kim; |
20 | |
|
21 | |
import java.security.GeneralSecurityException; |
22 | |
|
23 | |
import javax.jws.WebService; |
24 | |
|
25 | |
import org.kuali.rice.core.api.CoreApiServiceLocator; |
26 | |
import org.kuali.rice.core.api.encryption.EncryptionService; |
27 | |
import org.kuali.rice.kim.api.KimApiConstants; |
28 | |
import org.kuali.rice.kim.api.identity.IdentityService; |
29 | |
import org.kuali.rice.kim.api.identity.principal.Principal; |
30 | |
import org.kuali.rice.kim.impl.identity.IdentityServiceImpl; |
31 | |
import org.kuali.rice.krad.service.impl.DocumentServiceImpl; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
@WebService(endpointInterface = KimIdentityServiceConstants.INTERFACE_CLASS, serviceName = KimApiConstants.ServiceNames.IDENTITY_SERVICE_SOAP, portName = KimIdentityServiceConstants.WEB_SERVICE_PORT, targetNamespace = KimIdentityServiceConstants.MODULE_TARGET_NAMESPACE) |
44 | 0 | public class StudentIdentityServiceImpl extends IdentityServiceImpl implements IdentityService { |
45 | 0 | private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DocumentServiceImpl.class); |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
@Override |
51 | |
public Principal getPrincipalByPrincipalNameAndPassword(String principalName, String password) { |
52 | |
try { |
53 | 0 | String finalPassword = CoreApiServiceLocator.getEncryptionService().hash(password)+ EncryptionService.HASH_POST_PREFIX; |
54 | 0 | return super.getPrincipalByPrincipalNameAndPassword(principalName, finalPassword); |
55 | 0 | } catch (GeneralSecurityException e) { |
56 | 0 | String message = "Caught Exception attempting to encrypt password (with length " + password.length() + ") for principalName: " + principalName; |
57 | 0 | LOG.error(message, e); |
58 | 0 | throw new RuntimeException(e); |
59 | |
} |
60 | |
} |
61 | |
|
62 | |
} |