Search in sources :

Example 1 with EncryptedPassword

use of org.orcid.jaxb.model.message.EncryptedPassword in project ORCID-Source by ORCID.

the class OrcidProfileManagerImpl method updatePasswordInformation.

@Override
@Transactional
public void updatePasswordInformation(OrcidProfile updatedOrcidProfile) {
    String orcid = updatedOrcidProfile.getOrcidIdentifier().getPath();
    String hashedPassword = hash(updatedOrcidProfile.getPassword());
    profileDao.updateEncryptedPassword(orcid, hashedPassword);
    OrcidProfile cachedProfile = orcidProfileCacheManager.retrieve(orcid);
    if (cachedProfile != null) {
        profileDao.flush();
        SecurityDetails securityDetails = initSecurityDetails(cachedProfile);
        securityDetails.setEncryptedPassword(new EncryptedPassword(hashedPassword));
        cachedProfile.setPassword(hashedPassword);
        orcidProfileCacheManager.put(cachedProfile);
    }
    updateSecurityQuestionInformation(updatedOrcidProfile);
}
Also used : OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) SecurityDetails(org.orcid.jaxb.model.message.SecurityDetails) EncryptedPassword(org.orcid.jaxb.model.message.EncryptedPassword) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

EncryptedPassword (org.orcid.jaxb.model.message.EncryptedPassword)1 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)1 SecurityDetails (org.orcid.jaxb.model.message.SecurityDetails)1 Transactional (org.springframework.transaction.annotation.Transactional)1