Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » APEX and client_identifier (APEX 5.x)
APEX and client_identifier [message #645243] Tue, 01 December 2015 05:45 Go to next message
John Watson
Messages: 7399
Registered: January 2010
Location: Global Village
Senior Member
I'm trying to understand how I can make the identity of an APEX user, as determined by whatever the authentication scheme is, known to the database.
In Expert Oracle Application Express Security (Scott Spendolini, 2013) there is this:
Quote:
In APEX 4.2, more thorough information about which APEX session maps to which database session has been added to the MODULE, CLIENT_INFO, and CLIENT_IDENTIFIER columns of V$SESSION. The MODULE column now contains three values delimited by colons: the parsing schema followed by /APEX, APP followed by the APEX application ID, and the APEX page ID. The CLIENT_INFO column contains two values delimited by colons: the APEX-authenticated user name and the workspace ID. Lastly, the CLIENT_IDENTIFIER column contains two values delimited by colons: the APEX-authenticated user name and the session ID.
<snip>
Despite this enhancement, the information stored in these three columns in V$SESSION represents the initial values set when that database session is created by APEX. A single database session may and almost always maps to a number of different APEX applications across different workspaces. Since APEX makes heavy reuse of database sessions, the values in these columns may not represent the current values of the session using them.

I interpret this as meaning that the information in v$session.client_identifier is usless. In fact, seriously misleading. Is that correct? That the value may bear no relationship to the user using the session at any particular moment?

I have been reading about a variable :APP_USER. Is this always guaranteed to be available and correct when a persistent APEX session does anything? What I'm thinking is that I could have a call to to dbms_session.set_identifier(:app_user) at the beginning of each procedure. This would be a real nuisance, and a massive task to implement, and more work for the application to do.

Is there any standard way to track who the application user is for whom APEX_PUBLIC_USER is running code at any given moment?

Thank you for any insight.
Re: APEX and client_identifier [message #645256 is a reply to message #645243] Tue, 01 December 2015 10:26 Go to previous messageGo to next message
Littlefoot
Messages: 21415
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I use :APP_USER and I'm satisfied with it. Didn't notice any misbehavior (so far, that is).
Re: APEX and client_identifier [message #645447 is a reply to message #645256] Mon, 07 December 2015 03:06 Go to previous message
John Watson
Messages: 7399
Registered: January 2010
Location: Global Village
Senior Member
Thank you for replying.:APP_USER certainly works in every way I've tried to use it. However, it doesn't seem to be necessary to use it for my case, because V$SESSION.CLIENT_IDENTIFIER does appear to be set appropriately for each page visit. It would seem that the quotation I gave is not correct (at least not for current releases of ORDS/APEX).

What I want to do, by the way, is enable tracing and/or statistics aggregation for a nominated APEX user with DBMS_MONITOR.CLIENT_ID_[ STAT | TRACE ]_ENABLE, so I need to get the APEX authenticated logon ID and the session identifier.
Previous Topic: Placing Navigation Menu On Right Side
Next Topic: Passing value to g_f01 for submit process
Goto Forum:
  


Current Time: Fri May 25 19:39:17 CDT 2018