[英]JCIFS authenticate with hashed password
I'm using spring-security LDAP to authenticate a user in my application. 我正在使用spring-security LDAP验证我的应用程序中的用户。 I want to access a samba share with the authenticated user's credentials.
我想使用经过身份验证的用户凭据访问samba共享。 I use the JCIFS library: http://jcifs.samba.org/ .
我使用JCIFS库: http ://jcifs.samba.org/。
Getting the UserDetails from SecurityContextHolder.getContext().getAuthentication().getPrincipal();
从
SecurityContextHolder.getContext().getAuthentication().getPrincipal();
gives me only the hashed (SHAA) password of the user. 仅给我用户的哈希(SHAA)密码。 Is it possible to use this hash to authenticate JCIFS instead of the plain text password?
是否可以使用此哈希而不是纯文本密码来认证JCIFS?
I couldn't get it working with hashed password, but for my usecase, spring security provides configuration to keep the plain password: 我无法使用哈希密码,但是在我的用例中,spring security提供了配置以保留普通密码:
<authentication-manager erase-credentials="false">
With this configured, you can get the password by: 进行此配置后,您可以通过以下方式获取密码:
(String) SecurityContextHolder.getContext().getAuthentication().getCredentials();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.