我正在使用Oracle WebLogic服务器来托管我们的应用程序。我们要求在应用程序级别管理用户订阅 - 识别密码更改,更新过期密码,帐户等
我们使用WebLogic 11g和Microsoft Active Directory作为身份提供者。在浏览了Oracle文档后,我意识到使用OPSS可以更好地实现这一点,因为我们正在使用Oracle解决方案。但是,我仍然无法找到使用Java,OPSS和Active Directory实现此目的的方法。
任何帮助表示赞赏。
答案 0 :(得分:1)
要使用基于OPSS(Oracle平台安全服务)的实现,您需要在应用程序服务器(WebLogic)和Identity Store(Active Directory)之间建立SSL。
下面将详细介绍我所做的实施 - 删除了一些具体信息以简化它。
JpsContext jpsContext = null;
IdentityStoreService isService = null;
LdapIdentityStore idstoreService = null;
jpsContext = JpsContextFactory.getContextFactory().getContext();
isService = jpsContext.getServiceInstance(IdentityStoreService.class);
idstoreService = (LdapIdentityStore)
jpsContext.getServiceInstance(IdentityStoreService.class);
idStore = idstoreService.getIdmStore();
String userName = “testUser”;
User user = null;
searchFilter = idStore.getSimpleSearchFilter(UserProfile.USER_NAME, SimpleSearchFilter.TYPE_EQUAL, null);
searchFilter.setValue(userName + searchFilter.getWildCardChar());
params = new SearchParameters();
params.setFilter(searchFilter);
SearchResponse resp = idStore.searchUsers(params);
// Load the searched user details
while (resp.hasNext()) {
user = (User)resp.next();
if (user.getName().equalsIgnoreCase(userName)) {
// User Found
break;
}
}
UserProfile userProfile = user.getUserProfile();
之后,您可以对提取的用户执行更改,例如密码更改,重置等。
希望这有助于将来的人。