Retrieve log on user's name in class SimpleUICommand

Hi everyone, I would like to retrieve current log on user name in the method execute(IScreenflowData sfd) in class SimpleUICommand, found at https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Implementing%20Flexible%20UI%20One-Step-Screenflow.article.
Since there is no request to work with so I tried the following code
try {
  String userName = AccessContextFactory.getInstance().getContext().getUser().getEmail();
catch (ContextUnavailableException e)
  PortalRuntime.getLogger().severe("ContextUnavailableException");
   e.printStackTrace();
But I got ContextUnavailableException in the log.
How can I retrieve log on user name in this case? Is it a general method to do this in case there is no request ?
Thanks for reply.
Best regards.
Wang

Hi Wang,
without having tested it, it seems that the framework calls <i>setTargetParameters</i> (hopefully before <i>execute(IScreenflowData sfd)</i> is called). If this is the case, you'll have the IResourceContext at hand. From this you can retrieve the user.
Hope it helps
Detlev

Similar Messages

  • RTMF apis to retrieve logged in users in portal

    Hi Experts
    Can anyone tell me if there is any RTC api available that can be used in webdynpro java to fectch the list of logged in users in the portal.
    Also if the apis are not available in webdynpro java, can these be used in portal components?
    Thanks
    Siva

    Hi,
    You should read the wiki : [List of logged on users in the Portal |http://wiki.sdn.sap.com/wiki/display/Snippets/Listofloggedonusersinthe+Portal]
    Regards,
    Pierre

  • Retrieving Last used User Login Name in OIM 11g R2

    In my scenario, i want to retrieve the last used user login in OIM for user profile, to create next User Login based on last one retrieved ?
    Is there any API method available in User Management to get this value or Any customized DB query that will help ?
    Setup used is OIM 11g R2 PS1.

    Thanks Rajiv for Input !
    Still i have some doubts in my scenario. Actually i have to create new User Login in sequence based on last User Login of Last user created . This is no based on User ID. Also, whatever already existing users with user login are present , they will be uploaded in OIM for first time through trusted reconcilation.
    After reconcilation is done, then hereafter while creating next user i have to update its user login attribute in sequence of latest user login used and check for its uniqueness.Suppose, in case while bulk data import in OIM for first time , the users are not in sequence of User Login attribute, then it will be difficult to get the latest user login. Is there any way to get last user created based on User Login and not on User Id ?
    Hope i have given clear picture of my scenario.

  • Read logged in user-works in Delphi7 but not in Delphi 2010

    Hi all
    I have some code I wrote a while back in Delphi 7 - simple program to read a currently logged in user IDs, read available class definitions, read some user attributes - relatively simple stuff. I am now trying to move to Delphi 2010 and the very same code that works on Delphi 7 does NOT work on Delphi 2010. The code was updated to compile and run on Delphi 2010, so it executes with no errors.
    I am using NWDSWhoAmI to get the currently logged in user name and NWDSRead to retrieve user attribute values. On Delphi 7, the code works, all API return "Success" and return correct values. In Delphi 2010, all APIs return "Success" but the code act as if I am not logged in - the username returned is "[Public]" and when I try reading attribute values I get $8884 - RESOLVE SVC FAILED (also may mean I am not authenticated to the NDS tree).
    The environment is XP and Novell Client 4.91 on the workstation, NW6.5 on the server (one sever tree). The code runs under the currently logged in user with full admin rights in the tree and Novell Client configuration on both workstations is identical. Any ideas on how to resolve this would be greatly appreciated.
    Thanks
    Vlad

    Vlad,
    since both Delphi versions go through the same DLLs it must be a difference
    in the code - possibly different variable implementation as 16/32 bit or
    signed/unsigned vars
    It is good practice to use the NWLibrary defined variable types instead of
    native Delphi types.
    I have successfully used the same sources in Delphi 4, 5, 6, and 2010
    Try my old samples:
    http://support.novell.com/techcenter...a20020203.html and my Delphi
    version independent Delphi libraries
    http://developer.novell.com/wiki/index.php/Delphi-units
    Wolfgang
    "vladh" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi all
    > I have some code I wrote a while back in Delphi 7 - simple program to
    > read a currently logged in user IDs, read available class definitions,
    > read some user attributes - relatively simple stuff. I am now trying to
    > move to Delphi 2010 and the very same code that works on Delphi 7 does
    > NOT work on Delphi 2010. The code was updated to compile and run on
    > Delphi 2010, so it executes with no errors.
    > I am using NWDSWhoAmI to get the currently logged in user name and
    > NWDSRead to retrieve user attribute values. On Delphi 7, the code works,
    > all API return "Success" and return correct values. In Delphi 2010, all
    > APIs return "Success" but the code act as if I am not logged in - the
    > username returned is "[Public]" and when I try reading attribute values
    > I get $8884 - RESOLVE SVC FAILED (also may mean I am not authenticated
    > to the NDS tree).
    > The environment is XP and Novell Client 4.91 on the workstation, NW6.5
    > on the server (one sever tree). The code runs under the currently logged
    > in user with full admin rights in the tree and Novell Client
    > configuration on both workstations is identical. Any ideas on how to
    > resolve this would be greatly appreciated.
    > Thanks
    > Vlad
    >
    >
    > --
    > vladh
    > ------------------------------------------------------------------------
    > vladh's Profile: http://forums.novell.com/member.php?userid=84546
    > View this thread: http://forums.novell.com/showthread.php?t=422167
    >

  • How to access Portal Logged in user in Web Service application

    Hi Experts,
    I have created one Deployable Proxy and based on that i have created Web Based (WAR) project. to consume the proxy i have created Servlet based java file which invokes Web services. Based on this WAR project i created EAR application which deploys on J2EE server.
    I am facing issue while accessing Portal Logged in user in my Servlet Class in WAR project so can  you please provide inputs for how we can access Portal Logged in user in our Servlet class? also how we can access LDAP detailes of portal Logged inuser ?
    I tried to fetch the Logged in user from servlet request but i can't access it giving me null value. Following is the method details that i am using in my servlet.
    protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException                
    IUser user = UMFactory.getAuthenticator().getLoggedInUser();
    String strName = user.getFirstName();
             If I checked in LDAP values First name for logged in user is present but in my code its giving Null value.
    Can you please provide your inputs on above issue.
    Regards,
    Rahul

    have you found a solution this problem yet?

  • After installing new operating system software, my user account name has been changed and i don't know the password.

    i need help!
    I just installed Mac OS Maverick in my laptop, but when i checked the Users&Groups There are only 2 User name 1 is  "Apple(admin) and 2 is Guest, my user account name has been changed even the password. how can i retrieve my old user account name and password or how can i changed it?

    Here's an updated set of instructions you can try:
    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then save any photo stream photos that you wish to keep to your camera roll (unless using iCloud Photo Library).  When finished go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • How to retrieve the username of the logged in user

    Hi, I've been looking for a possibility retrieve some user data like the username of the currently logged in user since yesterday but could not find anything proper. I'm relatively new to APEX. Could someone perhaps point me to an easy-to-understand document? I would be glad if it would also cover the basic of authentication and authorization schemes.

    Hi, thanks for your reply. I've already changed my handle but the system said that it would take about one hour for the change to be done.
    Actually I have the following situation. I have a table that associates IDs to names. The names are the same as the user names of the users in APEX. On an APEX-Page I have a select-box that lists all available IDs. What I want to do is to automatically pre-select the ID of the currently logged in user. So I have created an authentication scheme as described in the help using following options:
    Based on a pre-configured scheme from the gallery > Show Login Page and Use Application Express Account Credentials
    And then I made the new authentication scheme the application's current scheme. Then I went to the page definition and created a new process, selecting "On Load - After Regions" as "Process Point", and entered the following source:
    declare
    nID number;
    begin
    :P2_TEMP := :APP_USER; -- this is just for debug purposes
    select b.ID into nID from MYTABLE b where b.NAME = :APP_USER;
    :P2_ID := nID;
    exception
    when others then
    null;
    end;
    But it doesn't work. Since the text field P2_TEMP stays empty I believe I am doing something wrong with APP_USER. Anybody who can help me with that?
    Edited by: user10977071 on 05.04.2009 08:57

  • User Name/Password class for MySQL -- it almost works ... almost

    I'm working on creating a user name/password class called Login that will get the information that is required to log into a MySQL database (This program is not an applet, by the way).
    In brief this class does following:
    * It creates a JFrame with JTextFields and a JPasswordField and a login button. All compents have ActionListener.
    * I am able to read the info from the fields (I tested this using System.out.println)
    * Another program calls this Login class (see code at end of post)
    I want the program to close the frame (I figured that out) and return the values to the calling program. I can't figure out how to have it return a cat string ( of "host|port|username|password" ). If this was one large piece of java source code, it'd be a piece of cake, but the code is broken into several java source components and I'm trying to figure out how to get the ActionListener to return the string.
    One web page mentioned using an ejector but haven't been able to find any information about that. Another thought was maybe putting some kind of code in the windowClosing event for the Login class.
    Ex:
      public void windowClosing(WindowEvent e)
         setVisible(false);
         dispose();
         // return value to calling function somehow
      }Any help would be greatly appreciated. I'm teaching myself this so I'm sure there are better ways to do the JFrame formatting, but here's the code anyway. I'll post the additional changes (in context) when I get a working version of this.
    //Login.java
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Object;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class Login extends JFrame implements ActionListener
       JTextField serverHost;
       IntTextField port;
       JTextField userName;
       JPasswordField password;
       JButton login;
       Canvas canvas;
       String ServerHost_String;
       String Port_String;
       String UserName_String;
       String Password_String;
       String Login_String;
       Font ssb10 = new Font("Sans Serif", Font.BOLD,10);
       Font hb30 = new Font("Helvetica", Font.BOLD,30);
       Integer rc;
       //public void init()
       public Login()
          // Set up buttons
          login = new JButton("Login");
          serverHost = new JTextField("localhost",10);
          port = new IntTextField(3306, 4);
          userName = new JTextField("root",10);
          password = new JPasswordField(10);
          // Draw Screen
          Canvas horizontal_spacer1 = new Horizontal_Spacer(420,15);
          Canvas horizontal_spacer2 = new Horizontal_Spacer(420,15);
          Canvas horizontal_spacer3 = new Horizontal_Spacer(420,15);
          Canvas horizontal_spacerA = new Horizontal_Spacer(100,45);
          Canvas horizontal_spacerB = new Horizontal_Spacer(100,45);
          Canvas vertical_spacer1 = new Vertical_Spacer();
          Canvas vertical_spacer2 = new Vertical_Spacer();
          Canvas vertical_spacerA = new Vertical_Spacer();
          Canvas vertical_spacerB = new Vertical_Spacer();
           * Top
          canvas = new Top_Logo();
          JPanel top = new JPanel();
          top.add(canvas);
          //top.add(horizontal_spacer1);
          add(BorderLayout.NORTH,top);
           * Middle
          Box p1 = Box.createHorizontalBox();
          Box p2 = Box.createHorizontalBox();
          Box p3 = Box.createHorizontalBox();
          JPanel bp = new JPanel();
          JLabel rbp = new JLabel();
          p1.setFont(ssb10);
          p2.setFont(ssb10);
          p3.setFont(ssb10);
          p1.setAlignmentX(Component.LEFT_ALIGNMENT);
          bp.setAlignmentX(Component.LEFT_ALIGNMENT);
          p3.setAlignmentX(Component.LEFT_ALIGNMENT);
          rbp.setLayout(new BoxLayout(rbp,BoxLayout.X_AXIS));
          rbp.setBorder(new TitledBorder("Connection to MySQL Server Instance"));
          JLabel lString = new JLabel("Server Host: ");
          lString.setFont(ssb10);
          // Setup server Host and Port JPanel
          p1.add(lString);
          p1.add(serverHost);
          lString = new JLabel("  Port: ");
          lString.setFont(ssb10);
          p1.add(lString);
          p1.add(port);
          // Setup username JPanel
          lString = new JLabel("Username:    ");
          lString.setFont(ssb10);
          p2.add(lString);
          p2.add(userName);
          // Setup password JPanel
          lString = new JLabel("Password:    ");
          lString.setFont(ssb10);
          p3.add(lString);
          p3.add(password);
          // Draw the big Jpanel
          //bp.add(horizontal_spacerA);
          bp.add(p1);
          bp.add(p2);
          bp.add(p3);
          //bp.add(horizontal_spacerB);
          rbp.add(vertical_spacerA);
          rbp.add(bp);
          rbp.add(vertical_spacerB);
          add(BorderLayout.WEST,vertical_spacer1);
          add(BorderLayout.CENTER,rbp);
          add(BorderLayout.EAST,vertical_spacer2);
          // Bottom
          JPanel bot = new JPanel();
          bot.setLayout(new BoxLayout(bot,BoxLayout.Y_AXIS));
          bot.add(horizontal_spacer2);
          bot.add(login);
          bot.add(horizontal_spacer3);
          add(BorderLayout.SOUTH,bot);
          // Draw JFrame
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(420,280);
          setResizable(false);
          setVisible(true);
          // Listen for buttons being clicked
          login.addActionListener(this);
          serverHost.addActionListener(this);
          userName.addActionListener(this);
          port.addActionListener(this);
          password.addActionListener(this);
       class Horizontal_Spacer extends Canvas
          Horizontal_Spacer(int X, int Y)
             setSize(X,Y);
             setVisible(true);
       class Vertical_Spacer extends Canvas
          Vertical_Spacer()
             setSize(25,10);
             setVisible(true);
       class Top_Logo extends Canvas
          Top_Logo()
             setBackground(Color.white);
             setSize(420,65);
             setVisible(true);
          public void paint(Graphics g)
               g.setFont(hb30);
               g.drawString("MySQL Login",20,45);
       public void actionPerformed(ActionEvent event)
          Object source = event.getSource();
          ServerHost_String=serverHost.getText();
          Port_String=port.getText();
          UserName_String=userName.getText();
          Password_String=new String(password.getPassword());
          if ((ServerHost_String.compareTo("")!=0) &&
              (Port_String.compareTo("")!=0) &&
              (UserName_String.compareTo("")!=0) &&
              (Password_String.compareTo("")!=0))
               Login_String=ServerHost_String + "|" +
                            Port_String + "|" +
                            UserName_String + "|" +
                            Password_String;
               setVisible(false);
               dispose();
          public void windowClosing(WindowEvent e)
            setVisible(false);
            dispose();
    //Login_Test.java
    import javax.swing.*;
    public class Login_Test extends JFrame
       //public void run()
       public static void main(String [] args)
          Login f = new Login();
    }Doc

    Let me get this clear.
    You want a login dialog.
    Some program calls the dialog and waits untile user respond
    once the user press ok or cancel it reutrn the users input to the caller.
    You can do this directly using JFrame
    but you can do it wil JDialog if you use it as aModal dialog.
    it will look like this
    class LogInDialog  extends JDialog implements ActionListener{
       String value;
       public LogInDialog(){
          setModel(true);
        // This is what you invoke
        public String loadDialog(){
            setVisible(true);
            return value;
        public void actionListener(..... e){
            if (e.getSource() == bCancel)
               value = null;
            else if (e.getSource() == bOk)
               value = //generate the string
            dispose();
    }

  • Unable to log in to the user account (name) at this time

    I get this error message when I try to log-in in my main admin account. And this is not a lost password issue I know im typing the write password because when I type a wrong one the box shakes when I type the right one it gives me that message.
    I tried alot of stuff to gain access to it but I cannot, the only thing that I can do is go in as root user and extract the files that I had in there, but I have no physcial access to the login it self, I started making a different account name for it but I dont want to lose all my prefrenses although I think the only thing that is making it this way is File Vault (its swtiched on for the locked out account)
    Any thoughts?

    I'm also getting the dreaded "You are unable to log in to the user account __ at this time" but believe this happened when I inadvertently tuned off an external hard drive without ejecting it first. At first, I thought it was a File Vault problem, but my user.sparseimage file is still there and accessible once I changed the permissions to those of another user account.
    What I have come to believe, based on other postings I have read on this topic, at least in my case, is that I must have corrupted the logged in user on the netinfo file. The solutions I've seen so far for fixing the netinfo file seem pretty complicated, though I do have a backup of that file.
    I have yet to decide whether the netinfo problem is easily fixable or if I would better employ my time moving my iTunes and iPhoto files off that sparse image and into another user account. I'm open to suggestions.
    Bill
    iBook G-4   Mac OS X (10.4.7)   1.33 GHz, 768 MB memory, 60 GB HD, iPod Shuffle

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • I have tried to log in on a web site and this is what I'm gettig: Alert 530 Autentication failed. I have used the correct password and user's name.

    ftp.oxbow.fr This is the file I have log on and I have used the correct password and user's name and this is what comes up:
    Alert 530 Authentication Failed!

    This is a user to user forum. Apple is not here. Apple does not answer questions here.
    iTunes Support -
    http://www.apple.com/support/itunes/
    Mac App Store Support -
    http://www.apple.com/support/mac/app-store/

  • How to get the name of currently logged in user in the network

    Hi all,
    I want to know if there's a way to get the name of the currently logged in user in the network.
    SYS_CONTEXT('USERENV','OS_USER') won't work for me because our users do not loggin in portal.
    Any ideas?
    Thanks in advance.
    Brett

    Hello, I had the same problem. Here is a smaller version to find the Group of the current User.
    The VI get the members of a Group and match it with the Username.
    Note :
    If the User belongs to multiple Groups the the VI returns only the 1st Groupname
    If the User belongs to no Group then the VI returns "unknown Group"
    The VI is written with LabVIEW 2010 and TestStand 4.2.1
    Attachments:
    current user group.vi ‏20 KB
    TestStand get Group of current User.PNG ‏43 KB

  • How to get logged in user name from windows service c#

    i use the below code to get logged in user name.
    private string GetLoggedInUser()
    string userName = "";
    if (System.Security.Principal.WindowsIdentity.GetCurrent() != null)
    userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    return userName;
    just do not understand why it is not giving a logged in user name rather it is return data in this format
    NT AUTHORITY\SYSTEM but i want to get user name.
    i try to run my service as Local Service and local system account but in every case i am getting this string
    NT AUTHORITY\SYSTEM instead of logged in user name.
    so please guide me what to change in code. thanks

    System is the account the service is running under.
    There can be none or many interactive users be logged in. What if none or multiple are logged in? Which one are you referring to then?
    Armin

  • Retrieving information about the logged in user in Power BI for O365

    I am trying to retrieve the email of the current logged in user so i can pass it into a query to my sql server which then adjusts the data based on who is viewing a power bi dashboard. If anyone knows a way to grab that information or even the url that
    the file has, then i can parse out its location and change my data based on that as well.

    Currently row level security is not supported in Power BI.
    Thanks,
    Sagar K 
    (Blog: http://datamazik.blogspot.in/)

  • How to retrieve the all user name from system domain(including login user)?

    Hi, I am trying to get the system domain all users name. But I unable to get the all user name except domain login user name. I used the below code. What I want to do to get the all user name from system domain. Kindly any one help me.
    Properties envVars = new Properties();
    Runtime r = Runtime.getRuntime();
    String OS = System.getProperty("os.name").toLowerCase();
         if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1 ) || (OS.indexOf("windows xp") > -1) )
              p = r.exec( "cmd.exe /c set" );
         BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
         String line;
         while( (line = br.readLine()) != null )
              int idx = line.indexOf( '=' );
              String key = line.substring( 0, idx );
              String value = line.substring( idx+1 );
              envVars.setProperty( key, value );
         String domainDNSName = envVars.getProperty("USERDNSDOMAIN");
         String userName = envVars.getProperty("USERNAME");
         System.out.println("\n\n\n DOMAIN NAME == "+domainDNSName +" USERNAME == "+userName);
    Thanks & Regards
    Palani

    Thanks kajbj,
    I don't know, How many users in domain. I neet to get all the user names from my domain. User like A, B,C,D, E,F. I need to get this users name.
    public class Env {
         public static void main(String[] args) {
              System.out.println("USERDOMAIN: " + System.getenv("USERDOMAIN"));
              System.out.println("USERNAME: " + System.getenv("USERNAME"));
    Here , I am getting the login user name only. So i needs all user name. How to retrive or get this.
    Regards
    Palani

Maybe you are looking for

  • Itunes prob with videos

    I dont know what the ** is going on, but when i plug in my ipod it updates the songs , but not the movies.. it worked liked yesterday.. it will update the songs then say "the update is complete." It wont even say "it is ok to disconnect" There are mo

  • FCP Crashes when I try to open a project - just one project.

    I even tried going to the Autosave Vault to open the latest saved file. "Finder>Documents>Final Cut Pro Documents>Autosave Vault>Look for the folder with the project's name you are trying to open." Someone else had a similar issue and had success wit

  • How do I fix quality of photos in iMovie from iPhoto?

    I am a first time poster here and I'm not very technical with computers but if someone could please explain this to me simply I'd be very appreciative. When trying to make a slideshow from pictures I took, with all the effects and such in iMovie, I'm

  • Integrating As a Third-Party Provider

    I work for a third-party application provider that is considering the feasibility of integrating with Oracle Portal. Does registration as a third-party provider require the transference (delivery) of all of only our meta-data our all of our content o

  • Logs are generating with owner and group as 'root'

    Hi, In our newly installed and configured Oracle application server(10.1.3.5), the logs are generating with owner and group as 'root'. Location: $ORACLE_HOME/Apache/Apache/logs -rw-r----- 1 root root 6700 Apr 3 02:03 access_log.1364947200 -rw-r-----