密码迁移到hybris后如何更改编码 [英] how change encoding after password migration to hybris

查看:63
本文介绍了密码迁移到hybris后如何更改编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在迁移用sha1编码的客户密码.我编写了一个自定义编码器,成功迁移了.迁移后,我希望客户更改密码时,也将编码更改为hybris默认编码,但仍使用自定义编码器.我该如何处理?

I am migrating customer password which encoded with sha1. I write a custom encoder and successfully I can migrate. After migrating, I want that when customer changes their password, also changes the encoding to hybris default encoding, but still use the custom encoder. How can I handle this?

推荐答案

您可以扩展 DefaultCustomerAccountService changePassword 方法来设置新的编码.UserModel已经具有PasswordEncoding属性.当 changePassword 方法在某处调用时,请检查用户模型编码并使用新的编码调用setPassword方法.该方法已经为用户模型设置了新的编码.

You can extend DefaultCustomerAccountService changePassword method for setting new encoding. UserModel already has PasswordEncoding attribute. When changePassword method call by somewhere, check usermodel encoding and call setPassword method with new encoding. This method already set new encoding to usermodel.

如果您打算使用自定义编码,则可以使用PasswordEncoder接口开发自己的编码.

If you are planning to use custom encoding you can develop your own with PasswordEncoder interface.

这篇关于密码迁移到hybris后如何更改编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆