Skip to Content
author's profile photo Former Member
Former Member

How to get current user for WS

Hello

I've created Web Service from Stateless Session Bean with Basic Authentification & Support Logon Ticket features.

I need to determine current logged user in bean methods.

UMFactory.getAuthenticator().getLoggedInUser() method requires Request & Response.

WDClientUser.getCurrentUser() throws NullPointerException when i try call it.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 04:08 PM

    Hi Aliaksandr,

    try this,

    WDClientUser.forceLoggedInClientUser().getSAPUser().

    getUniqueName();

    In order to the User ID, you have to run your WD application in the Portal.

    Hope it helps,

    - Teecheu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I am using it in a Web Dynpro component and I think that it is the only plase you can use it. If you want to determine the user in a EJB I think that javax.ejb.SessionContext.getCallerPrincipal() should work as already was mentioned.

      Best Regards.

      Victor

  • Posted on Feb 18, 2005 at 08:03 PM

    Hi Aliaksandr,

    What about javax.ejb.SessionContext.getCallerPrincipal()? Is it suitable for you?

    HTH,

    Vladimir

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vladimir

      Unfortunatelly no, I need to check user.isAuthenticated() later, when I perform search user by given Principal using UserFactory.getUserByLogonId() it returns "abstract" user account.

      Aliaksandr

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.