How to get the certificate into the X509 filter (Spring Security)?

前端 未结 2 455
無奈伤痛
無奈伤痛 2021-01-22 12:21

I need to extract more information than just the CN of the certificate. Currently, I only get the standard UserDetails loadUserByUsername(String arg) where arg is the CN of the

2条回答
  •  一整个雨季
    2021-01-22 12:49

    No you can't get it that way. You need to grab it from the HttpServletRequest:

    X509Certificate[] certs = (X509Certificate[])HttpServletRequest.getAttribute("javax.servlet.request.X509Certificate");
    

提交回复
热议问题