Use ADF Managed Bean to get the username in BPM Workspace

Hi all,
I used JSF and ADF to build the UI of human task. And I want to get the username of the user who is manipulate on BPM Workspace. For example, an ADF form can display the username of current user in BPM Workspace. I also try this approach: use Manage Bean, and bind this bean to a output text in ADF form. The code fragment I use to get the current username is:
ADFContext.getCurrent().getSecurityContext().getUserPrincipal().getName();
But it does not work. The value I get is Anonymous.
So, plz help me solve this problem

Hi, please try this function as below:
public String getUserLogin() throws WorkflowException,
BPMIdentityException,
BPMUnsupportedAttributeException {
String userId = "";
IWorkflowServiceClient wfSvcClient;
ITaskQueryService queryService;
IWorkflowContext wfContext;
// Get username of User Login
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
wfSvcClient = WorkflowService.getWorkflowServiceClient();
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
return userId;
Regards.

Similar Messages

  • How to use viewslifetime managed property to get the list of sites which are least accessed?

    Hi,<o:p></o:p>
    I am trying to get the subsites of a site collection which are least accessed. I am using ViewsLifeTime managed property in a content search web part with a condition like this:
    ViewsLifeTime < 0
    OR
    ViewsLifeTime = 0.
    However, It is not giving any results. I even tried with ViewsLifeTime < 10. I have some subsites which are accessed less than 10 times. I came to know this when I saw the value of ViewsLifeTime
    property.
    Can anyone suggest how to add a condition on ViewsLifeTime property?
    Thanks in advance.

    Hi Mohan,
    Here is a thread with similar issue for your reference:
    http://social.technet.microsoft.com/Forums/en-US/770f100d-eadb-45d1-9305-15f11cf9038d/ctxcurrentitemviewslifetime-is-showing-null?forum=sharepointsearch 
    If you would like to get site usage report in SharePoint 2013, there is OOTB feature for you to view popular trends report for a site, you could refer to the link below:
    http://blogs.technet.com/b/tothesharepoint/archive/2014/01/28/view-and-configure-usage-analytics-reports-in-sharepoint-server-2013.aspx
    In addition, custom script for usage report for SharePoint sites might be more helpful to your requirement to know access times:
    http://blog.falchionconsulting.com/index.php/tag/audit/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten.

    I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten. I need to download the product and I can't figure out where to begin.

    Ask someone at your school... Do you have a Cloud redemption code, or a CS6 serial number?
    If Cloud, Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html and
    http://www.adobe.com/products/creativecloud/faq.html
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall
    http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    What it is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
    Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
    If CS6, download at Other downloads and enter your serial number when prompted
    Again... your 1st resource is your school

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • How can I get the username displayed in BW Web-Report?

    Hello all,
    I try to get the username displayed in BW-Report such as 'welcome <username>'.
    Maybe you can give me a suggestion how to do it.
    I appretiate your answer.
    Regards
    Vivian

    you can use the following javascript within the webtemplate to get the user id
    <script language=javascript>
    var user_name ='<object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="TEXTELEMENTS_USER"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DP"/>
             <param name="GENERATE_CAPTION" value=""/>
             <param name="ELEMENT_TYPE_1" value="COMMON"/>
             <param name="ELEMENT_NAME_1" value="SYUSER"/>
             <param name="ONLY_VALUES" value="X"/>
             ITEM:            TEXTELEMENTS_USER
    </object>';
    </script>
    Regards
    Raja

  • How can I get the UserName in JAX-RPC?

    The client is just as following:
    import javax.xml.rpc.Call;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.rpc.namespace.QName;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.ParameterMode;
    public class ACTRPCClient {
    private static String qnameService = "Hello";
    private static String qnamePort = "Greeting";
    private static String BODY_NAMESPACE_VALUE ="http://hello.org/wsdl";
    private static String ENCODING_STYLE_PROPERTY ="javax.xml.rpc.encodingstyle.namespace.uri";
    private static String NS_XSD ="http://www.w3.org/2001/XMLSchema";
    private static String URI_ENCODING ="http://schemas.xmlsoap.org/soap/encoding/";
    public ACTRPCClient() {
    public static void main(String[] args) {
    try {
    String endpoint= "http://127.0.0.1:8080/SOAPListener/Hello";
    ServiceFactory factory =ServiceFactory.newInstance();
    Service service =factory.createService(new QName(qnameService));
    QName port = new QName(qnamePort);
    Call call = service.createCall();
    call.setPortTypeName(port);
    call.setTargetEndpointAddress(endpoint);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
    call.setProperty(ENCODING_STYLE_PROPERTY,URI_ENCODING);
    //here I set the username and password
    call.setProperty("javax.xml.rpc.security.auth.username","tomcat");
    call.setProperty("javax.xml.rpc.security.auth.password","tomcat");
    QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
    call.setReturnType(QNAME_TYPE_STRING);
    call.setOperationName(new QName (BODY_NAMESPACE_VALUE, "getHello"));
    call.addParameter("Greeting", QNAME_TYPE_STRING, ParameterMode.PARAM_MODE_IN);
    String[] params = { new String("Hello!") };
    String result = (String)call.invoke(params);
    System.out.println(result);
    } catch (Exception ex) {
    ex.printStackTrace();
    On the server side,I wrote a my own servlet to receive the soap instead of the jax-rpc.But I can't get the username from the request.
    for example,
    String username;
    username=request.getRemoteUser();
    I noticed that in the api doc,it says when the user has not been authenticated the method getRemoteUser will return null.So I use the username "tomcat" ,password "tomcat "in the tomcat-
    users.xml.But I still can't get the username,why?
    Thanks for your help.

    From the Axis I find the problem,the username and password is stored in the headers of the http.
    And now the jax-rpc only surpport basic authentication,we can get them by calling request.header("Authentication").Howerver,the infomation is encoded by Base64.We copy a module from the Axis to decode the infomation.That's it,but still thank your attention.

  • Getting the Username and password Of Enterprise Portal in WebDynPro

    Hi Friends,
              I have developed one webdynpro application to read the excel sheet from KM Repository. i have used URL to open the connection to that excel file and to get the Inputstream.
              While opening the connection to the excel, I've hardcoded the username and password. I need to get the username and password of the user who login into the Enterprise portal and runs that application. then  i need to pass that username and password along with URL of the Excel sheet.
              Could you people find the solution and replied to me. I am waiting for your bright answer.
    Thanks and Regards,
    Sandeep Kumar Bonam.

    A very standard question in this forum.
    Refer this :
    Re: How to get User Id in Web dynpro application
    Regards,
    Subramanian V.

  • How to get the username/password of the current owner of the running code

    Dear friends,
    Our product is running on the App Server(weblogic/websphere...) and we also use security provider(OpenLDAP) and kerberos to support SSO. Before, when a user tyies to login in the first time, the way we use to authenticate the user is:
    1) Accept the username/password
    2) Query the security provider(OpenLDAP) to get the principles.
    3) verity if the username/password is corrent or not.
    As we know, to query the principles, we need to provide a search user(both username and password) if we configured the access control of the ldap server:
    I have configured my envirioment as follows
    1) In the LDAP server, configured the Middle Tire user(The Operating System user running the App Server) to have the permission to query principles.
    2) The server is configured to runing on SSO envirioment.
    My question is could I get the username/password of the OS user running the App Server at runtime so that I can query the ldap server without explicitly providing the search user?
    Thanks,
    RR
    Edited by: Ricky Ru on Oct 9, 2011 1:50 AM

    Thanks EJP.
    I have made some progress on this. But I have met another issue.
    *1) Using JAAS to login.*
    loginContext.login();
                   Subject subject = loginContext.getSubject();
                   ldapContext = (LdapContext) Subject.doAs(subject, this);
    *2) Init the ldapContext to use the GSSAPI authentication*
    // this is called automatically by login()
         public Object run() {
              Hashtable ldapEnv = new Hashtable();
              ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
              ldapEnv.put(Context.PROVIDER_URL, "ldap://9.30.215.197");
              ldapEnv.put(Context.SECURITY_AUTHENTICATION,"GSSAPI");
              ldapEnv.put(Context.SECURITY_PRINCIPAL,"");
              ldapEnv.put(Context.SECURITY_CREDENTIALS,"");
              //System.setProperty("sun.security.krb5.debug", "false");
              // This tells the GSS-API to use the cached ticket as
              // credentials, if it is available
              System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");     
              try {
                   InitialLdapContext ctx = new InitialLdapContext(ldapEnv,null);
    But I got the following exception when excuting new InitialLdapContext(ldapEnv,null);
    Debug is true storeKey false useTicketCache true useKeyTab false doNotPrompt false ticketCache is null isInitiator true KeyTab is null refreshKrb5Config is false principal is null tryFirstPass is false useFirstPass is false storePass is false clearPass is false
    Acquire TGT from Cache
    Principal is [email protected]
    Commit Succeeded
    javax.naming.AuthenticationException: GSSAPI [Root exception is javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Integrity check on decrypted field failed (31))]]
         at com.sun.jndi.ldap.sasl.LdapSasl.saslBind(LdapSasl.java:150)
         at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214)
         at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2694)
         at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:293)
         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
         at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
         at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
         at LDAPKerbService.run(LDAPKerbService.java:66)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:337)
         at LDAPKerbService.login(LDAPKerbService.java:40)
         at LDAPKerbService.main(LDAPKerbService.java:82)
    Caused by: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Integrity check on decrypted field failed (31))]
         at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:194)
         at com.sun.jndi.ldap.sasl.LdapSasl.saslBind(LdapSasl.java:105)
         ... 16 more
    Caused by: GSSException: No valid credentials provided (Mechanism level: Integrity check on decrypted field failed (31))
         at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:663)
         at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:230)
         at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:162)
         at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:175)
         ... 17 more
    Caused by: KrbException: Integrity check on decrypted field failed (31)
         at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:61)
         at sun.security.krb5.KrbTgsReq.getReply(KrbTgsReq.java:185)
         at sun.security.krb5.internal.CredentialsUtil.serviceCreds(CredentialsUtil.java:294)
         at sun.security.krb5.internal.CredentialsUtil.acquireServiceCreds(CredentialsUtil.java:106)
         at sun.security.krb5.Credentials.acquireServiceCreds(Credentials.java:562)
         at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:594)
         ... 20 more
    Caused by: KrbException: Identifier doesn't match expected value (906)
         at sun.security.krb5.internal.KDCRep.init(KDCRep.java:133)
         at sun.security.krb5.internal.TGSRep.init(TGSRep.java:58)
         at sun.security.krb5.internal.TGSRep.<init>(TGSRep.java:53)
         at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:46)
         ... 25 more
    Do you have any clue on this? Thanks.

  • HttpSessionListener: how to get the username?

    When a session is created, I want to read some data from database
    and store it as session variables. What data is to be read depends
    on the user name.
    I use the HttpSessionListener.
    How can I get the username from within the sessionCreated method?
    I could getRemoteUser() from HttpServletRequest, but how do I get
    the request?
    J2EE API documentation says:
    public interface HttpSession
    Provides a way to identify a user across more than one page request or
    visit to a Web site and to store information about that user.
    Therefore, my problem ought to have a solution, oughtn't it?

    You'd like to think so.
    Unfortunately, the Servlets 2.3 spec does not appear to address combining deployer-based authentication with deployer-based listener classes. This means it's pretty much up to the vendors whether you can do this.
    I'm using jetty/jboss, and the situation is as follows:
    Authentication info is stored in the session only if you use form-based authentication (which, as I found, means you're forced to use form-based authentication if you want your users to be able to log off.)
    However, even if you are using form-based authentication, there are two problems.
    1. your HttpSessionListener implementing class gets called BEFORE they login (i.e. before the login page is presented). So there's nothing in the session yet.
    2. How the container stores the authentication info in the session is entirely up to the vendor. In the case of jetty, the login is stored in the session property "org.mortbay.jetty.Auth".
    So in the case of Jetty, you'd need to implement HttpSessionAttributesListener, wait for that property to be set, and then get the stuff from the db based on that setting. Needless to say, this is highly non-portable. sigh.
    I think the only way to do what we want is to forget HttpServletRequest and use a filter instead. Bummer.
    Did you come up with any bright ideas in the end?

  • I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    Hello mrmacjohn,
    Verifying that any iCloud account that may be signed in is signed out should resolve this error.
    On your Mac, open iCloud preferences, then click Sign Out.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    Cheers,
    Allen

  • In my SOA Composite, Can I use file/FTP adapter to get the EDI X12 850

    Our requirement is to build a SOA Composite to dump all the details in a EDI X12 850 ( Purchase order ) document in to a database table. In my SOA Composite, Can I use file/FTP adapter to get the EDI X12 850 element details to map them to a base base columns.

    Drop the File Adapter to the left lane of the composite i.e., Services lane...
    Go to Step 2, give a meaningful name....
    Step 3, select "define from operation and schema"
    Step 4, select the operation type as "read"
    Step 5, select physical path and give the folder path in the "Directory for incoming files" field.,
    Step 6, select wildcards and give the expression depending on the file name it would be at run time...
    Step 7, select the polling frequency as required....
    Step 8, in the URL field, adjacent to that , select "browse for schema file" and select the XSD which you have exported from B2B Editor.
    say next and finish, you will be good to go.
    Hope this helps,
    Thanks,
    N

  • My samsung says video out from i pad is not supported. i am connecting with apple dock using hdmi. I do get the audio

    my samsung says video out from i pad is not supported. i am connecting with apple dock using hdmi. I do get the audio  any suggestions?

    Jeffrey-
    If the HDMI input to the Samsung is not compatible, does it have a VGA or composite input?  I have both the HDMI and VGA adapters for the iPad, which work with the small Vizio HDTV I tried.  I understand a composite video adapter is also available.
    Fred

  • Use Faces Managed Bean in javaScript

    Thanks in Advance
    Scenario:
    I have got a faces manged bean that constucts a string array .On my page i have got select one list box .Based on my selection ,message to be displayed at the bottom of the page or a pop up window .This string array corresponds to the list box items description.
    I am doing an onclick() event ,when i click on an item in the list ,display the pop up window with the message. here i need to call the FACES MANAGED BEAN
    to display the message in the pop up window.
    Can any one suggest a way for this to start.
    than u

    Use a ValueChangeEvent to do that.

  • When trying to use my banking apps I get the error "Network Required  This application requires an active Internet Connection.  Please try again"

    When trying to use my banking apps I get the error "Network Required  This application requires an active Internet Connection.  Please try again".  This happens with two different apps from two different banks.  One of them works occasionally and have not figured out why.  I have cell signal and I am on a strong WiFi network.  Same thing happens when I turn off the WiFi too.    I have tried uninstalling and re-installing the app with no improvement.   I can't seem to find any setting that would cause this.   Does anyone have any suggestions?  

    I can access the internet just fine in the browser and i can use any other app i have.
    Sent from my Verizon Wireless 4G LTE DROID

  • After ejecting a disk plugged into the USB port using Finder, I am now getting "The disk was not properly ejected" message.  This didn't used to happen.  How can this be corrected?

    After ejecting a disk plugged into the USB port using Finder, I am now getting "The disk was not properly ejected" message.  This didn't used to happen.  How can this be corrected?

    When you right (control) click on the disk and click eject "disk name", do you pull it immeadiatly or wait a few seconds for it to unmount? Try waiting and see if you get the same message. If you do, when the disk is connected go to applications/utilities/disk utility, after opening DU, select the volume in question from the left side bar and try a permissions repair, you may also run verify disk and see if it comes up with any errors (they will be in red)

Maybe you are looking for

  • Is it possible to import images into a specific iPhoto album?

    I have an Album in iPhoto I use for great sample images that inspire me. I'd like to import images straight into that Album from the Finder or my iPhone. Is there any way to do this, I tried using Automator but could not get it to work.

  • Creating PDF documents using DBMS_XSLPROCESSOR ??

    Hi everybody, I have my XML document and my stylesheet in DB and i'm trying to create a PDF document using the DBMS_XSLPROCESSOR.processxsl method, can anybody help me about that ?? Thanks for your help... Lionel from Switzerland

  • Problems with collective search help

    Hello SDNers, I was working with collective search help. Ex : zc_srch1 (Collective) In the 'Include search help' i have included 2 search elementary search help Ex : zsrc1 and zsrc2 (both elementary) I have also assigned the parameter assignment for

  • Help Game center won't recognize CoD Black Ops on my mac

    So I have this Call of duty black ops on my mac but when I try playing multiplayer is say that I need to sign into my game center, so I sign in and I try playing multiplayer again and it still didn't work. Also when I open Black Ops game center says

  • Error when inputting data using scanner

    At one point in my program I use scanner to read the users keyboard input, after pressing enter I get this error: NullPointerException: at JerooProgram.makeRobotJeroos(JerooProgram.java:158) at JerooProgram.main(JerooProgram.java:23) at sun.reflect.N