Re: Obtain information about client from within an APEX application

From: David Mann <dmann99_at_gmail.com>
Date: Thu, 10 May 2012 15:21:59 -0400
Message-ID: <CAGazuyUDE8xuSFsJa93XP-yTd5dPt+iyyHBoqp61VmickcPLNA_at_mail.gmail.com>



This just worked for me to get IP address of my workstation that was hitting my Apex server... I believe this may be obscured if you have any proxy or forwarding going on (you may get the IP address of the appliance doing the proxy):

htp.p('User IP Address: ' || OWA_UTIL.get_cgi_env ('REMOTE_ADDR'));

I'm not sure if getting username will be that simple. You can get APP_USER substitution variable if the user is authenticated in some way... This is not necessarily OSUSER on their workstation if that is what you are looking for. We get around this by creating a 'Single Sign On' custom auth layer... so APP_USER gets authenticated via our site SSO scheme, then from there on out APP_USER is set correctly. If they don't authenticate nicely then they get hand in face.

More info about the substitution string here: http://www.utoug.org/i/doc/concept_sub_strings.htm#BEIHCJBG

htp.p( V('APP_USER') );

--

Dave Mann
www.brainio.us
www.ba6.us - Database Stuff - http://www.ba6.us/rss.xml
--

http://www.freelists.org/webpage/oracle-l Received on Thu May 10 2012 - 14:21:59 CDT

Original text of this message