Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • sessionContext.getCallerPrincipal().getName() returns "anonymous"

    Posted on

    I am working on a web app project that contains EJB components and is deployed in JBoss EAP 7.0.7. Some of these EJBs are called remotely from a standalone java client application. The problem is I am able to call the EJBs remotely but the principal always returns "anonymous" instead of the user ID that was just authenticated.

    I have configured the standalone.xml to use a security-domain using a DatabaseLoginModule. I also configured the security domain in my jboss-web.xml and annotated each EJBs to use that security domain.

    When I invoke an EJB method from within the web application, the principal from the sessionContext is set to the logged in user. This is because I have used the HttpServletRequest.login api. But how would I propagate the principal to the EJB layer using the standalone client app without this servlet api? Is there an api that performs authentication and propagates the principal as what the servlet api I mentioned above does? Or am I just missing some configurations? Thanks in advance for your answers/feedback.

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat, Inc.