如何通过 OIM API 验证用户身份?

How to authenticate user via OIM API?

我需要从第三方应用程序进行 oim 用户身份验证。我正在搜索 OIM API 同样的。

在 OIM 中,身份验证被卸载到应用程序服务器(即 WebLogic),因此您必须添加一个身份验证提供程序,它知道如何连接到您希望 OIM 用于身份验证的应用程序。

https://blogs.oracle.com/ArdaEralp/entry/configure_oim_ad_ldap_authentication https://docs.oracle.com/cd/E28280_01/web.1111/e13718/atn.htm#DEVSP220

以上链接将让您了解如何为 OIM 配置新的身份验证提供程序以及身份验证提供程序的实际含义及其内部结构。

public static final String OIM_HOSTNAME = "oim.hpt.lab";
public static final String OIM_PORT = "14000";
public static final String OIM_PROVIDER_URL = "t3://"+ OIM_HOSTNAME + ":" + OIM_PORT;
public static final String OIM_USERNAME = "tungpt";
public static final String OIM_PASSWORD = "Hpt123456";
public static final String OIM_CLIENT_HOME = "F:/designconsole11gr3/config";
public static final String AUTHWL_PATH = OIM_CLIENT_HOME + "/authwl.conf";

public static void main(String[] args) {
    // TODO Auto-generated method stub
    OIMClient oimClient = null;
    try {
        //Set system properties required for OIMClient
        System.setProperty("java.security.auth.login.config", AUTHWL_PATH);
        System.setProperty("APPSERVER_TYPE", "wls");

        // Create an instance of OIMClient with OIM environment information  
        Hashtable env = new Hashtable();
        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory");
        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIM_PROVIDER_URL);
        oimClient = new OIMClient(env);

        // Login to OIM with the approriate credentials
        System.out.println("Login by: "+ OIM_USERNAME);
        oimClient.login(OIM_USERNAME, OIM_PASSWORD.toCharArray());
        System.out.println("Login Done!");
    }catch(Exception e){
        e.printStackTrace();
    }
}