
Note: The jar file used here is available in your OIM libraries.
Just go to OIM Server and run find -f command to find all the libraries which i am using in lab. Take the libraries out and place to your eclipse IDE.
package com.example.api.ktport;
import java.util.Hashtable;
import javax.security.auth.login.LoginException;
import oracle.iam.platform.OIMClient;
public class Test {
static OIMClient oimclient;
public Test(String url,String userName,String password)
{
System.out.println("Create the client");
String ctxFactory="weblogic.jndi.WLInitialContextFactory";
Hashtable<String,String> env=new Hashtable<String,String>();
env.put(oimclient.JAVA_NAMING_FACTORY_INITIAL, ctxFactory);
env.put(oimclient.JAVA_NAMING_PROVIDER_URL, url);
System.setProperty("java.security.auth.login.config","D:/authwl.conf");
System.setProperty("APPSERVER_TYPE", "wls");
oimclient=new OIMClient(env);
try {
oimclient.login(userName, password.toCharArray());
System.out.println("Login successful to OIM");
} catch (LoginException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args)
{
String userName="OIM username here";
String password="OIM Password here";
String url="t3://example.com:14000";
Test t=new Test(url,userName,password);
oimclient.logout();
System.out.println("Loggout successfully");
}
}
package com.example.api.utility;
import java.io.*;
import java.util.Hashtable;
import javax.security.auth.login.LoginException;
import oracle.iam.identity.exception.UserAlreadyExistsException;
import oracle.iam.identity.exception.UserCreateException;
import oracle.iam.identity.exception.ValidationFailedException;
import oracle.iam.identity.usermgmt.api.UserManager;
import oracle.iam.identity.usermgmt.vo.User;
import oracle.iam.platform.OIMClient;
import oracle.iam.platform.authz.exception.AccessDeniedException;
public class BulkUserCreation {
static OIMClient client;
static UserManager usrmgr;
static User uservo=new User(null);
BulkUserCreation(String username,String password)
{
System.out.println("Creating client......");
Hashtable<String,String> h=new Hashtable<String,String>();
h.put(client.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory");
h.put(client.JAVA_NAMING_PROVIDER_URL,"t3://example.com:14000");
System.setProperty("java.security.auth.login.config","D:/authwl.conf");
System.setProperty("APPSERVER_TYPE", "wls");
client=new OIMClient(h);
try {
client.login(username, password.toCharArray());
System.out.println("Now Logged in to OIM server........");
}
catch (LoginException e)
{
e.printStackTrace();
}
}
public void createUser(String firstName,String lastName,String userName,String email,String empType,String orgkey )
{
uservo.setFirstName(firstName);
uservo.setLastName(lastName);
uservo.setLogin(userName);
uservo.setEmail(email);
uservo.setEmployeeType(empType);
uservo.setOrganizationKey(orgkey);
try {
usrmgr.create(uservo);
System.out.println("User"+userName+" created successfully..");
} catch (ValidationFailedException | UserAlreadyExistsException | UserCreateException
| AccessDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args)throws Exception {
String username="<Give here your OIM user Name>";
String password="Your OIM Password";
BulkUserCreation t=new BulkUserCreation(username,password);
usrmgr=client.getService(UserManager.class);
BufferedReader br=new BufferedReader(new FileReader("abc.csv"));
String line=br.readLine();
while(line!=null)
{
String s[]=line.split(",");
t.createUser(s[0], s[1], s[2], s[3], s[4], s[5]);
line=br.readLine();
}
client.logout();
System.out.println("Sucessfully loggedout from OIM Server....");
}
}
This course is completely designed for someone who had already completed our other parts of Oracle Identity Manager courses.
This is an advance course, where we will try to perform various operations on Oracle Identity Manager with Java OIM API.
So candidate must have java knowledge to take most advantage out of this course.
Here we will cover various OIM API related to User, Account, Entitlement etc.
So it will be a complete hands on journey.
System Requirement
RAM: 8 GB +
OS : 64-bit
Processor: 2 core Processor
Hard Disk : 50+ GB
Eclipse IDE
Q)What is Oracle Identity Manager?
Ans: Oracle Identity Management, a software suite marketed by Oracle Corporation, provides identity and access management (IAM) technologies.
The name of the software suite closely resembles the name of one of its components, Oracle Identity Manager.
Oracle Identity Management enables organizations to effectively manage the end-to-end lifecycle of user identities across all enterprise resources, both within and beyond the firewall and into the cloud. The Oracle Identity Management platform delivers scalable solutions for identity governance, access management and directory services.
Student's Reviews:
Amit Rai :
if you really want to learn OIM , just go through this course. Amazing
Antonio Romero Elvira :
It's a great course. I like so much because this course teach me how to configurate my VM to install OIM 11gR2. Not much courses teaches to install OIM from zero. I like it
Benjamin Nelson :
Just the information I needed. Very thorough.
Amol:
Amazing course Loved It. Instructor is knowledgeable and explain every topic in depth.