1 Reply Latest reply: Apr 2, 2013 7:21 AM by 706722 RSS

    Login user with database credential : seen as APEX_PUBLIC_USER

    Christophe
      Hello,

      I'm using Application Express 4.2.1.00.08

      In the application, the authentication method used is the DB one, so the user (schema) must exist on the DB. This works fine.

      For instance, I'm login as SCOTT

      Creating the following query
      select upper(user) from dual
      shows that the real logged user is APEX_PUBLIC_USER and npot SCOTT.

      How to create a connection with another "real" username ?
        • 1. Re: Login user with database credential : seen as APEX_PUBLIC_USER
          706722
          I'm not sure if this is possible (to have on user SCOTT than APEX_PUBLIC_USER -> this is always APEX LISTENER user seen in database and as I thin this is always APEX_PUBLIC_USER)

          But U can do workaround -> if U can connect to application via DB credentials use v('APP_USER') and U get what U want (it works in database too, not only in APEX so maybe function getCurrentUser ->

          there check if user is APEX_PUBLIC_USER then return v('APP_USER') and if it's not then return user)

          Maybe APEX just use a connection to authenticate but for the database application and U are always a APEX_PUBLIC_USER. I have never used DB authentication

          Edited by: nirud on 2013-03-29 04:45