Showing posts from September, 2011

Apache reverse proxy with LDAP authentication

Here is a sample Apache conf file that demonstrates the following
Reverse proxy to a backend Java application (/ui is proxied to an app running on port 9010).LDAP authentication against a local LDAP server running on port 1389The REMOTE_USER header is set to the authenticated ldap uid, and passed to the back end Java application.  
My purpose here is to have a super light weight proxy that simulates having a "real" Access Management system in front of the application.  This is strictly for development. The idea is to move authentication out of the application. In production the application is going to be front ended by a PEP (an Oracle OAM Webgate, for example) that will set the REMOTE_USER header based on the users established SSO session.

Here is the config file

Running the Oracle RCU on OEL 6.1

The current Repository Creation Utility - RCU (  does not run successfully on Oracle Enterprise Linux OEL 6.1 - or at least it didn't on my VirtualBox image.  You will get an error about a missing library (libXext).

You can get around this problem by editing the bin/rcu script and changing the JRE home directory to use the  native JRE from the O/S instead of the one bundled with the RCU.  For example - /usr/java/latest/jre.

Please note that OEL 6.1 is not yet certified for FMW and the above is  *NOT SUPPORTED*. Use at your own risk.

An Oracle Startup Script

A script to startup up oracle on boot. Put this in your /etc/init.d directory, and run

chkconfig --add oracle

JQuery.proxy is your friend

I'm a Javascript/JQuery newbie and one of the first puzzles that I ran into is callback functions and the value of "this".

You set up a callback handler like so:

jQuery.getJSON('/address/list', this.myCallback);

And you expect that when your callback is invoked that "this" will be set to the value of the enclosing object:

myCallback: function(json) {
    this.doSomething(); // doesnt work!},
doSomething: function() // ...

What you (not so quickly) discover is that JQuery sets the value of "this" to the DOM object (or the element within the DOM that triggered the callback).  It is *not* set to the object that holds your callback function!

The solution is to use JQuery's proxy wrapper:

jQuery.getJSON('/address/list', JQuery.proxy(this.myCallback,this));

You will want to read  this and this for a full explanation.

BTW - none of these results floated to the top of the Google machine. If you are newbie, you probably don't know that yo…