How to get SSO logged user information in a database trigger

my database is 9i
my application server is 9i too
I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
thanks

Hi,
The only way I could figure out how to get it was to import the com.sap.security.api.
1. From Window>Preferences>Java-->Classpath Variables, set up a variable called WEBAS_HOME pointing to:
<drive>/usr/sap/<SID>/jc00/j2ee/cluster/server0/
2. Right click on properties of your Dynpro Project->Properties->Java Build Path->Libraries and click "Add Variable." 
3. Select WEBAS_HOME and click "Extend"
4. Select /bin/ext/com.sap.api.sda/com.sap.security.api.jar and click OK.
If you don't have access to a portal directory, you will have to get this jar file and copy it to your workspace to add to your build path instead of the above steps.
Then in your code:
import com.sap.security.api.IUser;
import com.sap.security.api.IUserAccount;
  public void GetLogonID( )
     String LogonID;
     try {
          /*     create an user object from the current user */
          IWDClientUser wdUser = WDClientUser.getCurrentUser();
          IUser user = wdUser.getSAPUser();
          if (user != null) {
               IUserAccount acct = user.getUserAccounts()[0];
               if (acct != null) {
                    LogonID = acct.getLogonUid();
               } else
                    LogonID = "acct null";
          } else {
               LogonID = "user null";
          wdContext.currentContextElement().setDisplayName(user.getFirstName() + " " + user.getLastName());
          wdContext.currentContextElement().setLogonID(LogonID.toUpperCase());
     } catch (Exception e) {
          e.printStackTrace();
Hope this helps...  I had to search several places before I found all the necessary stuff.  Maybe I can get my first points!
Thanks,
Andrew

Similar Messages

  • How to get the ep user information data in the web dynpro?

    Hi all
      I want to create a web dynpro application on EP.I want to get the ep user information data in the web dynpro.How can I do?Thanks.

    Lin,
    Two steps to achieve this:-
    <b>Step 1:</b> Add the following code in your view Controller:-
    IWDClientUser user = WDClientUser.getCurrentUser();
    IUser objUser = user.getSAPUser();
    wdContext.currentContextElement().setXXXX(objUser.getUniqueName());
    wdContext.currentContextElement().setYYYY(objUser.getFirstName());
    wdContext.currentContextElement().setZZZZ(objUser.getLastName());
    where XXXX, YYYY , ZZZZ are the context names.
    getUniqueName : Gives Login id of Portal user.
    getFirstName : Gives First Name of the Portal user.
    getLastname : Gives Last Name of the Portal user.
    <b>Step 2 : </b>Use "Organize imports" and make sure that you have the following two libraries added in the build path of your project. You can do these by right clicking on your project name ==> Properties ==> Java Build Path ==> Libraries ==> Add External jars.
    The external jars are :
    <b>com.sap.security.api.jar
    com.sap.security.api.perm.jar</b>
    Finally rebuild your project and deploy.
    Regards,
    <b>Chintan Virani.</b>

  • How to Get  the SSO Logged user information in database trigger

    I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
    thanks

    Try using portal30.wwctx_api.get_user returns a varchar2 (PUBLIC) or the Username that is logged in
    I need to track which SSO user is inserting data into a table , so how can i get the information of that user in a database trigger on that table
    thanks

  • How to get/capture log-on user name on PC (work station)

    Hi,
    Colud anyone give me how to get/capture log-on user name on my PC (work station)?
    I need to get the infomation by using a function module.
    Kind regards,
    Hisao

    Hi,
    TH_USER_INFO shows me terminal ID, IP address and other information. howerver it does't show me log-on user name of OS.
    Kind regards,
    Hisao

  • How to get SSO userid to URL-based app?

    I'm developing a web-app using Struts that will be accessed by Portal (I guess as a URL-based app). The web-app will not require login. The web-app will not be Portal "aware", except that it requires the SSO userid for auditing/logging purposes.
    I know little about Portal and SSO. How can Portal be configured to send the Portal userid of the logged-in Portal user? Can it send it as a parameter in a GET or POST?
    The version of Portal will be 9.0.2 (or greater).

    This topic is answered in the PDK forum here:
    How to get SSO userid to URL-based app?

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

  • How to get the current user logon to portal?

    Hi Gurus,
    How to get the current user who logged into portal.
    I have a webdynpro requirement where in which I have to get the current user id who loggedinto portal which will be the input parameter of the BAPI(adaptive RFC model) which will return me employee number of the particular user.
    Can anyone send me the code to retrive the user id through webdynpro application..........
    Pts will be rewarded for useful inputs......
    Thanks in Advance,
    Dharani

    Hi Dharani,
    Using UMEfactory u can do that...
    1. create one input field,
    2. create one attribute called Uid
    3. assign Uid attribute to the input field
    4. type the following code in Doinit() method
                String uid = wdContext.currentContextElement().getUid();
         try {
         IUser user = UMFactory.getUserFactory().
         getUserByLogonID(uid);
         String userName = user.getDisplayName();
         } catch (UMException ex) {
          e.toString(); 
    5. after that go to Portal create one iview assign to particular user. then u get into the user details...
    thats it
    Regards,
    P.Manivannan

  • How to get the logged in userId value in adf task flow OIM11g R2

    Hi,
    I have created an adf task flow. Now I want to run some query in that based on the logged in userId.
    Could you please help me in knowing how to get the logged in userID value in adf TaskFlow so that I can run a parameterized query.
    Thanks

    3 different ways to retrieve the username (not sure what you mean by user ID) :
    http://mahmoudoracle.blogspot.be/2012/06/adf-get-current-logged-user-name.html#.USI_c-h8zIo
    Also provide your JDev version.
    Basicly, you should use the groovy expression in a view criteria (it's the fastest and easiest way) and call that view criteria whenever you need it.
    That's if you are using ADF BC of course.

  • How to get Portal Login user ID and Groups using UME API in JSPDynpages

    Hi Experts,
    How can I get the portal logged user ID and bsed on that ID need to get his assigend groups.
    For this Initially I need to get the logged user ID using UME API.
    Can you drop the code to write and display using JSP Dynpages?
    Thanks
    Venkat.

    Hi,
    Try the below code
    IUserFactory userfact=UMFactory.getUserFactory();
    IUser user=userfact.getUserByUniqueName(request.getUser().getUserId());
    String usrid=user.getUniqueName();
    And also you can get the groups assigned to user by using the below code
    Iterator groups = user.getParentGroups(true);
    while (groups.hasNext()) {
         String groupstr = (String) groups.next();
         IGroup g = UMFactory.getGroupFactory().getGroup(groupstr);
         response.write("Group name "g.getUniqueName()"<br>");
    Regards
    Suresh

  • How to get the remote user IP address if behind the proxy or firewall

    Hi
    How do i get the remote user Ip address who is invoking the servlet behind from a firewall.
    When i use getRemoteHostAddr it gives the proxy ip address not the actuall user host address... Kindly let me know how to get the actual user ip address
    satish

    There is no reliable way to determine the original IP, and such information is not useful to you if the original IP is behind a firewall. What do you propose to use it for? There is probably an alternative way to do things that does not require the remote IP.

  • How to get the logged in userId value in adf task flow

    Hi,
    I have created an adf task flow and deployed the same in application as an adf library.
    Now I need to get the Logged in User ID value in the adf task flow which I created.
    Based on this userid I need to run query to fetch the data related to the user from the database.
    Please help/guide me to solve this issue.

    3 different ways to retrieve the username (not sure what you mean by user ID) :
    http://mahmoudoracle.blogspot.be/2012/06/adf-get-current-logged-user-name.html#.USI_c-h8zIo
    Also provide your JDev version.
    Basicly, you should use the groovy expression in a view criteria (it's the fastest and easiest way) and call that view criteria whenever you need it.
    That's if you are using ADF BC of course.

  • How to get the health , performance information and about the services run on devices that have connected to the system center?

    Hi All,
    I want to know how to get the health , performance information and about the services run on devices that have connected to the system center to my c# application. Also I need to know about the information of databases that have connected to system center.
    I will appreciate your feedback
    Thank you

    Hi,
    You can configure service monitor for the required service on the server
    refer below link for how to configure service monitoring
    http://www.bictt.com/blogs/bictt.php/2011/03/17/scom-monitoring-a-service-part3
    You can use SCOM SDK to connect to the scom server using c# and get required information
    http://msdn.microsoft.com/en-us/library/hh329086.aspx
    you can find the database in below registry path on management server
    HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseName
    Regards
    sridhar v

  • How to get the NT user id and passwd

    Hi,
    How to get the NT user id and passwd using form 6i

    You cannot get the password. Password are stored in an encrypted format. Almost never decrypted (as a security meassure). Authentication is performed by encrypting the supplied password and matching that against the stored encrypted password.
    Think about it.. just how dangerous it will be to have a function that can dump NT users and their passwords for you. How can you ever expect to "simply decrypt a password"?
    As for getting the user name. See the Win32 kernel API call GetCurrentUser(). Also note that there is a big difference as to the owner/user of a server process/thread versus the end-user of client application (possibly running on another PC) that is making the call to the server.
    Of course, none of this is related to SQL or PL/SQL - which is what I believe the subject matter of this forum is... Kindly suggest that in future you pay attention to posting the correct subject material to the correct forum.

  • How to get the logon user id?

    hi experts
    how to get the logon user id?
    thanks a lot.

    hi ,
    get the data for the user from db tables usr02  usr41..
    regards,
    venkat.

  • How to get latest CPU patch information

    Hi Gurus,
    Good Morning.
    How to get latest CPU patch information for our EBS 11i system, how to get alerts when ever they released CPU patches.

    Check  the SAWWAN'S Excellent previous post regarding developer patches , this post will give you entire information about Developer patches.
    Re: how to find the developer version
    Re: Developer 6i patches
    Check this metalink notes , hope this helps.
    Note: 466890.1 - Script to find Apache, Java, Jinitiator, Forms version and JVM details for Oracle E-Business Suite 11i
    Note: 392793.1 - How to Obtain Oracle Forms Version in Oracle Applications 11i from Command Line
    Edited by: Amigo on Dec 22, 2010 9:20 AM
    Edited by: Amigo on Dec 22, 2010 9:21 AM
    Edited by: Amigo on Dec 22, 2010 9:26 AM

Maybe you are looking for

  • 10.5.6 Results in "forever" indexing Spotlight and poor performance

    Hi all, I recently updated to 10.5.6 and have been struggling with a constantly indexing spotlight ever since. I have tried the following: -- repairing the disk -- repairing the disk permissions -- deleting the spotlight index and re-indexing -- use

  • Error code -50 hard drives won't eject

    I am using three G-drives, a 4TB RAID drive, and two 3-TB G-drives. On both my Macbook and iMac I am having problems ejecting them. I get the message "The disk wasn't ejected because one or more programs may be using it." even when all the programs o

  • Playing movie on multiple slides

    Filmed a speaker giving a presentation while he went through his Keynote slides, now I need to take his slides from keynote and place the small movie of him talking on the corresponding slides from his presentation. Some of the movie clips span two o

  • Private network OK, guest network no IP

    Hi Community - Just installed our new AirPort Extreme, went very well.  The private network (using W2PA Personal) works great.  Devices can connect to the guest network (WPA2 Personal), but do not acquire an IP.  Router is a SonicWall TZ 215.  Any th

  • Entry problem

    my client have done the folowing process 1.  created po with del cost of 37000  which is actually 50000 2.done GR for 37000 as del cost 3. done miro invoice for 37000 4.payment of 37000 5. vendor agin sent another bill of  13000 6.user done INVOICE o