1,構造一個干凈的域,域名為domain002
2,構造該域里面的用戶
weblogic The default administration user DefaultAuthenticator
user0001 weblogic DefaultAuthenticator
user0002 user0002 DefaultAuthenticator
3,建立一個組,weblogicAdmin,同時在AD中也建立一個這樣的組
注意,在AD中的users而不是Builtin里面建組,因為兩者的DN是不一樣的。
4,將所有Weblogic中的user0001用戶都加入到改組。
5,測試AD的可連接性,下載一個LDAP Browser。
6,在Weblogic Console中的Security->Realm的Authentication配置一個新的LDAP Provider,類型為:Configure a new Active Directory Authenticator...
7,配置參數:
i) 轉到Active Directory那一Tab,看到HOST了吧?
HOST為你的AD的IP或者主機名,AD默認端口是389
ii) Principal為CN=user0001,CN=Users,DC=dlsvr,DC=com
其中,DC=dlsvr,DC=com為我的服務器的RootDN(例如DC=ibm,DC=com)
很討厭AD的一個地方是它采用與其他LDAP不一樣的命名方法,他用CN=User而不是OU=....,所以我前面的步驟才需要建立一個welogicAdmin的組。
iii)Credential為AD中user0001的密碼。
注意:ii)和iii)是用于連接AD用的,構造一個LDAPConnection需要用戶名密碼的,懂不懂:)
轉到user tab
iv) User Name Attribute:user0001
v) User Base DN:CN=Users,DC=dlsvr,DC=com
轉到group tab
vi) Group Base DN:CN=weblogicAdmin,CN=Users,DC=dlsvr,DC=com
vii) weblogicAdmin
保存
關鍵的步驟到了:
Security->Realms->myrealm->Providers->Authentication
有沒有看到Re-order the Configured Authentication Providers
對,就是這里需要調整一下順序。
把ActiveDirectoryAuthenticator調整到最上面(優先級最高)
然后設置ActiveDirectoryAuthenticator的General頁里面的Control Flag為Required。
接著DefaultAuthenticator里面的設成是OPTIONAL。
于是,AD取代了以前的DefaultAuthenticator了,如果兩個都Requried,那么也你要接受雙重認證,汗......一般不需要這樣。
注意:boot.properties里面的默認的Weblogic啟動賬號同樣受AD影響,你如果在AD里面禁止了Weblogic這個賬號,我保證你WLS啟動不了