簡體   English   中英

JCIFS使用哈希密碼進行身份驗證

[英]JCIFS authenticate with hashed password

我正在使用spring-security LDAP驗證我的應用程序中的用戶。 我想使用經過身份驗證的用戶憑據訪問samba共享。 我使用JCIFS庫: http ://jcifs.samba.org/。

SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 僅給我用戶的哈希(SHAA)密碼。 是否可以使用此哈希而不是純文本密碼來認證JCIFS?

我無法使用哈希密碼,但是在我的用例中,spring security提供了配置以保留普通密碼:

<authentication-manager erase-credentials="false">

進行此配置后,您可以通過以下方式獲取密碼:

(String) SecurityContextHolder.getContext().getAuthentication().getCredentials();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM