9 Replies Latest reply: Mar 19, 2012 9:23 PM by Kuldeep RSS

    OIM 11g - get user attributes on request template

    912744
      Can I use OIMClient to get user attributes from prepopulate adapters on my request template ?
        • 1. Re: OIM 11g - get user attributes on request template
          BikashBagaria
          You can use OIMClient without authentication params or just use Platform.getService() in the pre pop adapter in request dataset.

          -Bikash
          • 2. Re: OIM 11g - get user attributes on request template
            912744
            Can you please elaborate on "without authentication params"
            • 3. Re: OIM 11g - get user attributes on request template
              BikashBagaria
              OIMClient client = new OIMClient();

              -Bikash
              • 4. Re: OIM 11g - get user attributes on request template
                912744
                I tried with both the methods but was only able to fetch the following details for the user:

                mapAttrs: {Display Name={base=TESTUSER11}, act_key=3, Full Name={base=null}, usr_key=75, User Login=TESTUSER11, Last Name=user11, First Name=test11}


                I want all the user attributes. Is there some way I can get all of those
                • 5. Re: OIM 11g - get user attributes on request template
                  BikashBagaria
                  You got the user key ... what's more you can ask for?.. use the APIs to get whatever information you want to get for that user ...

                  http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/oracle/iam/identity/usermgmt/api/UserManager.html#getDetails_java_lang_String__java_util_Set__boolean_

                  -Bikash
                  • 6. Re: OIM 11g - get user attributes on request template
                    912744
                    I think we can only fetch the requester's profile details using this method. It also does not return the custom attributes.
                    • 7. Re: OIM 11g - get user attributes on request template
                      BikashBagaria
                      Have you tried using the API? It has worked for me to get whatever attribute I wanted of the user (OOTB attributes & custom).

                      -Bikash
                      • 8. Re: OIM 11g - get user attributes on request template
                        912744
                        Hi Bikash
                        Here is the behavior difference that I have observed:

                        When I directly fetch UserManager using Platform.getService(UserManager.class) -
                        UserManager userManager = Platform.getService(UserManager.class);
                        Map attributes - mapAttrs: {Display Name={base=TESTUSER11}, usr_key=75, User Login=TESTUSER11, Last Name=user11, First Name=test11}

                        When I fetch OIMClient and then get the UserManager using the client -
                        OIMClient client = new OIMClient();
                        UserManager userManager = client.getService(UserManager.class);
                        Map attributes - mapAttrs: {Display Name={base=TESTUSER11}, usr_key=75, User Login=TESTUSER11, Last Name=user11, First Name=test11}

                        When I hard code the oim creds and call client.login() -
                        String oimUserName = "xelsysadm";
                        String oimPassword = "OIMPassword";
                        String oimURL = "t3://192.168.56.34:14000/oim";
                        String oimInitialContextFactory = "weblogic.jndi.WLInitialContextFactory";
                        java.util.Hashtable env = new java.util.Hashtable();
                        env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_FACTORY_INITIAL, oimInitialContextFactory);
                        env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_PROVIDER_URL, oimURL);
                        oracle.iam.platform.OIMClient client = new oracle.iam.platform.OIMClient(env);
                        client.login(oimUserName, oimPassword.toCharArray());
                        UserManager userManager = client.getService(UserManager.class);
                        Map attributes - mapAttrs: {usr_manager_key=6, Phone No=45454545, Email=testuser11@mydomain.com, Center No=3434, Display Name={base=TESTUSER11}, Cost Center Name=CCName, usr_key=75, User Login=TESTUSER11, Last Name=user11, Title=null, EmployeeId=2323, First Name=test11}


                        Am I missing something ??

                        The third approach solves my purpose but I don't want to hard code the creds. Also fetching the creds from CSF does not work for me.
                        • 9. Re: OIM 11g - get user attributes on request template
                          Kuldeep
                          Hi,
                          1. get The detail via - user = userManager.getDetails("User Login", "xelsysadm", null);
                          2. get the required attribute via - user.getAttribute("Cost Center Name");

                          or simply you can check all the attributes by iterating attribute*s* fetched via - HashMap<String, Object> attMap = user.getAttributes();,

                          without worrying about credential,
                          I have not faced limited attribute access via Platform.

                          Thanks
                          Kuldeep