Home » Fusion Middleware & Colab Suite » WebCenter Suite & Portal » Accessing client name with a DAD setup
Accessing client name with a DAD setup [message #124019] Wed, 15 June 2005 18:10 Go to next message
mstonis
Messages: 2
Registered: June 2005
Location: Chicago, IL
Junior Member
I am developing an application that has a dad setup, but still needs to be able to read the client's oracle username. I have tried sys_context() and ora_util, but all I get as a username is the DAD login and the client IP address. I found something that uses LDAP and i would be able to pull the information from there, but it seems like it would be a pain.

Does anyone have any suggestions for what would be best to get the user's oracle username?

Thanks in advance,

MStonis
Re: Accessing client name with a DAD setup [message #124053 is a reply to message #124019] Thu, 16 June 2005 01:33 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
SQL> SELECT sys_context('USERENV', 'SESSION_USER') from dual;

SYS_CONTEXT('USERENV','SESSION_USER')
--------------------------------------------------------------------------------
SCOTT

or
SQL> SELECT user FROM dual;

USER
------------------------------
SCOTT


Best regards.

Frank
Re: Accessing client name with a DAD setup [message #124128 is a reply to message #124019] Thu, 16 June 2005 09:19 Go to previous messageGo to next message
mstonis
Messages: 2
Registered: June 2005
Location: Chicago, IL
Junior Member
All this returns me is the dad user name.

For example:
When I run sys_context sys_context('USERENV', 'SESSION_USER'), I should get 'mstonis'. What I get is 'dadowner'.

Since I am not directly logging in, but using the dad, I don't know how to get a username from my computer. I can get the IP address of the computer that I am using, but I would like to get a name (either oracle username or windows/network username).
Re: Accessing client name with a DAD setup [message #125042 is a reply to message #124128] Wed, 22 June 2005 19:04 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
As far as I know, the browser only knows the login name used on the client's browser machine and it's IP address (although the real IP may be hidden e.g. VPN network etc). You can try running something like this - or if you have debuf turned on for the DAD and you enter a bad URL, it will show you all the environment info.

CREATE OR REPLACE PROCEDURE env
AS
BEGIN
   HTP.htmlOpen;
      HTP.headOpen;
         HTP.title ('Environment Test');
      HTP.headClose;
      HTP.bodyOpen;
         HTP.hr;
         HTP.br;
         HTP.p ('REMOTE_ADDR=' || OWA_UTIL.get_cgi_env ('REMOTE_ADDR'));
         HTP.br;
         HTP.p ('REMOTE_USER=' || OWA_UTIL.get_cgi_env ('REMOTE_USER'));
         HTP.br;
         HTP.p ('HTTP_HOST=' || OWA_UTIL.get_cgi_env ('HTTP_HOST'));
         HTP.br;
         HTP.p ('SERVER_NAME=' || OWA_UTIL.get_cgi_env ('SERVER_NAME'));
         HTP.br;
         HTP.p ('SERVER_PORT=' || OWA_UTIL.get_cgi_env ('SERVER_PORT'));
         HTP.br;
         HTP.p ('owa_util.GET_OWA_SERVICE_PATH=' || OWA_UTIL.get_owa_service_path);
         HTP.br;
         HTP.p ('owa_sec.get_user_id=' || owa_sec.get_user_id);
         HTP.br;
         HTP.p ('owa_sec.get_password=' || owa_sec.get_password);
         HTP.br;
         HTP.p ('<H1>All CGI Environment variables...</H1>');
         OWA_UTIL.print_cgi_env;
      HTP.bodyClose;
   HTP.htmlClose;
END;
Re: Accessing client name with a DAD setup [message #240146 is a reply to message #125042] Thu, 24 May 2007 04:31 Go to previous messageGo to next message
ankit_upadhyay
Messages: 1
Registered: May 2007
Location: Pune,India
Junior Member
Hi
I am getting all the fields but not owa_sec.get_user_id and
owa_sec.get_password. They are coming blank.I want the windows network user name.
Please provide some solution here.
thanks.

Regards,
Ankit
Re: Accessing client name with a DAD setup [message #240367 is a reply to message #240146] Thu, 24 May 2007 12:32 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
you can only pick from whatever you see in the output from "OWA_UTIL.print_cgi_env". Check to see what you get - it varies by version.
Previous Topic: copy page group
Next Topic: link to a calendar portlet
Goto Forum:
  


Current Time: Fri Mar 29 01:03:33 CDT 2024