Skip to main content

Cannot propagate username/password required by target when using run as ...

3 replies [Last post]
Joined: 2007-08-02

The full title should have been: "Cannot propagate username/password required by target when using run as identity", which is the exception message I'm having trouble with.

I am having problems setting up a distributed server scenario with credentials being propagated between glassfish servers.

- I have glassfish server A (presentation tier) and glassfish server B (business tier)
- I have a "login" servlet on server A that performs authentication via Programmatic Login.
- I have a "test" servlet in server A attempting to make an EJB call to a bean that is located in server B.
- The bean method is marked with the @RolesAllowed annotation.
- Server A's web.xml does NOT have entries defined, nor does it have the defined.

If I execute my login servlet and then I attempt to execute the servlet that attempts the EJB call, I get the before-mentioned exception: "Cannot propagate username/password required by target when using run as identity"

However, I noticed that if I add a entry in the web.xml file for the servlet in question, then the problem goes away.

Can anyone explain why that is?


Related 2nd question, different scenario:

Again, I have server A (presentation tier) and server B (business tier)
This time I have a more "normal" set up. I configure server A to use BASIC authentication ( in web.xml)
I again have a servlet that attempts to call a remote ejb that is annotated with @RolesAllowed.
My servlet is has a configured on it.

When I execute my servlet, I am asked to log in via the BASIC authentication mechanism, and then everything executed wonderfully, inclusing the EJB call. Clearly, my authentication credentials are being propagated.

However, keeping my test browser session open, I now decide to restart server A (presentation tier). I noticed that my session is being preserved across the server restart as my session id remains the same after the restart. However, after the restart, and still in my same browser session as before, which still holds my authentication data, if I attempt to execute the servlet, I now get the infamous exception: "Cannot propagate username/password required by target when using run as identity".

Can anyone explain how the server restart causes this exception?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-12-02

I am having the same issue... is there a solution to this?

Joined: 2003-12-10

The original post is quiet old and uses GF V2.X most likely.

Can you explain your problem in a different thread and mention the version of GF that you are using.

Joined: 2006-12-02

ok let's do that.