[英]Spring security LDAP Authentication without specifying authentication details in the configuration file
我們在應用程序中使用Spring Security LDAP身份驗證進行身份驗證。 對於ldap身份驗證,我們在applicationContext-security.xml中配置用戶標識和密碼。 我想知道是否可以通過LDAP進行身份驗證,而無需在configuration(applicationContext-security.xml)文件中指定用於訪問LDAP服務器的User參數。
提前致謝
Jasypt支持加密.properties
文件,並在Spring訪問它時透明地對其解密。
因此,您可以嘗試在.properties
文件中指定身份驗證詳細信息,然后使用Jasypt對此.properties
文件進行加密。 使用<context:property-placeholder>
將身份驗證詳細信息從.properties
文件注入到applicationContext-security.xml
如果LDAP允許匿名訪問,則不能在contextSource
的配置中指定userDn
和password
。 在這種情況下,Spring Security將使用匿名進行讀寫操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.