Sunday, November 18, 2012

OID 11G: orclMemberof Attribute and how it can improve wls performance


From OID11G and WLS perspective, I want to share with you guys this: Someone asked me thru Oracle Forum last week, I helped him and now I am doing this post to help you:
It’s particular difficult to calculate all of user’s membership in OID(or any LDAP).
1) I did (below) one example into my ldap, search with results for a specific user where I request and receive the value(s) of orclMemberOf.
Note: U will also notice that nested memberships are returned multiple times, once for each group that the user belongs to that is a member of another given group.
So, just be aware of that.
LDAP command line:
[oracle@thiagoleoncioserver bin]$ ./ldapsearch -h thiagoserver.example.com -p 3060 -D cn=orcladmin -w thiagopwd -b “cn=Users,dc=thiagoleoncioserver,dc=oracle,dc=com” -L -s sub -v “uid=thiago.leoncio” memberOf
And expected results:
ldap_open( thiagoserver.example.com , 3060 )
filter pattern: uid=thiago.leoncio
returning: memberOf
filter is: (uid=thiago.leoncio)
dn: uid=thiago.leoncio,cn=users,dc=thiagoleoncioserver,dc=oracle,dc=com
memberof: cn=administrators,cn=groups,dc=example,dc=com
memberof: cn=oaamenvadmingroup,cn=groups,dc=example,dc=com
memberof: cn=groupofgroups,cn=groups,dc=example,dc=com
2)And from performance perspective:
orclMemberOf attribute can speed up authentication into WebLogic and SOA when you have WebLogic’s security framework, by adding it into ‘User Dynamic Group DN attribute’ on authenticator configurations.
I hope this helps,
Thiago Leoncio.

Saturday, November 3, 2012

[Oracle Forms] How to run/Install IE8 on Windows 7

Hello everyone,

   Doing the Oracle Forms development and getting stuck with the issues that IE9, 10 and 11 bring on Active-X requirements for Oracle Forms, I decided to write this article only for helping others to no waste time trying to install directly IE8 on Windows 7.

The easiest and the way that really works is this:


  • Whatever IE version that you have above IE8 is not default in Windows 7. That means if you downgrade the current IE you are going to get the default one - IE8.



  • So thinking about that to go to the places that most of the sites ask you to go:


  1. Control Panel --> Program and Features --> Turn Windows features on or off --> Uncheck the IE version that you have. This procedure simply don't work because you will not find the IE8 files to install on Windows 7.



  • The way that works is:
  1. Go to Control Panel --> Program and Features 
  2. Select View Installed Updates and this will show you this screen below with a lot of patches and upgrades applied.
  3. Then once you find the current version of IE you have installed - select it and then click Uninstall.
  4. This will ask you to restart your computer.
  5. Once you are back to your Windows 7, click in IE and finally you should see the IE8!!!!




I hope it helps you during your forms(PL-SQL) development. Happy Coding.
Thiago Leoncio.

Friday, November 2, 2012

OIM 11G: Helpful API methods


Today I’ll talk about some new methods available using OIM 11g API.
First java method: How to get any user attribute in OIM.

Fig1: UserAttribute method. With this method you’ll be able to collect any attribute from OIM User.
Source:
1
2
3
4
5
6
7
8
9
public String getUserAttribute(String userName,String getAttribute) throws AccessDeniedException,UserSearchException,NoSuchUserException,UserLookupException, SearchKeyNotUniqueException
{
        UserManager usrService= oimClient.getService(UserManager.class);
        User user = usrService.getDetails("User Login", userName, null);
        HashMap mapAttrs = user.getAttributes(); 
        String temp=(String) mapAttrs.get(getAttribute);
        System.out.println("Output is :" + temp);
  return temp;
}
Example:
If I call ..getUserAttribute(Username, Status);
Expected result:
Second java method: Assign a group to another group.

Fig2: goi.addMemberGroup(groupKey, groupKeytoADD);
Source:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public static void addGroupToGroup(tcGroupOperationsIntf goi, String groupNametoADD, String groupName) throws tcInvalidMemberGroupException,                                                            tcMemberGroupNotFoundException {
         long groupKeytoADD = getGroupKey(goi, groupNametoADD);
         long groupKey = getGroupKey(goi, groupName);
         if (groupKeytoADD == -1L || groupKey == -1L) {
                 System.out.println("Error adding user to group");
                 return;
         }
         try {
                 goi.addMemberGroup(groupKey, groupKeytoADD);
                 System.out.println("Added Group " + groupName + " to group "+ groupKeytoADD);
         } catch (tcAPIException e) {
                 logger.info(""+e.toString());
         } catch (tcGroupNotFoundException e) {
                 logger.info(""+e.toString());
         }        
 }
You can use these methods into an adapter or any client Java class. Just be aware of the different ways to call tcDataProvider or oimClient.login(OIMUserName,OIMPassword.toCharArray());
In a Java client:
1-You should create a ‘void static main method’.
2-Include this class into your manifest file and deploy as jar.
3-To Run you’ll need these helpful steps(3.0-based on first method above and sending arguments as args[0] and args[1] on ‘static void main method’):
3.1- java -jar yourjarfile.jar username attribute
3.2-If you need to import one lib: java –classpath oimclient.jar jar yourjarfile.jar username attribute
3.2-If you need to import more than one lib: java -cp $CLASSPATH:yourjarfile.jar username attribute
Using: $CLASSPATH=.:./lib/oimclient.jar:./lib/iam-platform-auth-client.jar:./lib/iam-platform-utils.jar:./lib/iam-platform-context.jar
Using tcDataProvider:
1-Add as part of ‘IN’ variables on your OIM adapter.
2-Using DataSet or request from constructor method(tcDataProvider _tcDataPro)
I hope this helps,
Thiago Leoncio.