You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "baozi-2019 (via GitHub)" <gi...@apache.org> on 2023/04/26 08:30:46 UTC

[GitHub] [dubbo] baozi-2019 commented on issue #12167: spring security结合dubbo使用会报错

baozi-2019 commented on issue #12167:
URL: https://github.com/apache/dubbo/issues/12167#issuecomment-1523000618

   > > PasswordAuthenticationToken
   > 
   > spring security Authentication 对象在反序列化的时候,有时会出现一些错误,主要错误体现在,在反序列化时,构造参数不能为空等条件,介于此,dubbo 内部加入了默认对象的一些反序列化器,可以查看ObjectMapperCodec这个类。如果是自定义认证对象,可以通过ObjectMapperCodecCustomer扩展反序列化方式,具体反序列化器实现参考 UsernamePasswordAuthenticationTokenDeserializer
   
   我修改了增加了mixin,但是MyObjectMapperCustomer这个类dubbo怎么加载
   ```java
   public class MyObjectMapperCustomer implements ObjectMapperCodecCustomer {
       @Override
       public void customize(ObjectMapperCodec objectMapperCodec) {
           objectMapperCodec.configureMapper(objectMapper -> {
               objectMapper.addMixIn(PasswordAuthenticationToken.class, PasswordAuthenticationTokenMixin.class);
           });
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org