歡迎您光臨本站 註冊首頁

關於sun one directory server 密碼的取值問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於sun one directory server 密碼的取值問題

我用想做一個用戶認證的程序 ,在網頁裡面輸入 用戶名密碼 ,取和ldap裡面 用戶名做認證 ,如果用戶名密碼爭取則登陸成功,比如 我在網頁裡面
輸入 zhangsan 密碼 123  在ldap裡面 uid =zhangsan  我可以取到並且可以做比較 ,但是取密碼出現錯誤
我的取屬性的代碼

public String getAttribute(
Attributes attrs, String attrName)  
throws NamingException {
Attribute attr = attrs.get(attrName);
if (attr == null) { return ""; }
else {

        return (String)(attr.get());  
}
attrName=uid的時候 沒問題 可以取到uid的值 zhangsan
可是 arrtName=userpassword的時候 出現  [B cannot be cast to java.lang.String
請大家賜教 謝謝了 另外 我在sunone裡面設置的的密碼是 明碼保存的,不存在加密的問題
《解決方案》

怎麼沒有人回復啊 各位大俠救命
《解決方案》

最好同樣問題你提到 java 版
《解決方案》

不推薦使用密碼比對,最好還是使用ldap本身的bind機制來進行認證
《解決方案》

回復 #4 klompe 的帖子

謝謝了!
《解決方案》

好像回過類似的貼子,關於ldap的存儲方面的問題,都沒有力氣說了

[火星人 ] 關於sun one directory server 密碼的取值問題已經有313次圍觀

http://coctec.com/docs/service/show-post-37238.html