Thursday, October 15, 2015

OIM - Print All User Profile Attributes

There are other ways to get user profile attributes .Below is the quick way to get user profile attribute names and its values.
_oimClientAuthen is a OIM java client which you need write before invoking below code


    public void printAllUserAttributes() {
        UserManager umgr = _oimClientAuthen.getService(UserManager.class);
        User user;
        try {
            user = umgr.getDetails("User Login", "stalatam", null);
            HashMap mapAttrs = user.getAttributes();
            Iterator it = mapAttrs.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry pair = (Map.Entry)it.next();
                System.out.println(pair.getKey() + " = " + pair.getValue());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

No comments:

Post a Comment