Also this problem occurs when user was logged in and we are trying to relogin from jsp as `internal' user, or from EJB. In other words, we can't login as 'internal' for some specific activity in LoginModule, JSP, EJB, after we were logged in as `user'
Its not clear what you are talking about here. What is an example of what you are doing to relogin as the internal user? Submit the example as a bug report to sourceforge:
The question is
how can I dynamicaly relogin during one request to the server? In some cases it's very important to have such possibility, for examples suppose that you have "User" entity bean. And this bean has "changePassword" method, which can be executed by "Administrator" or by user which is represented by this entity bean instance. And there is the way: temporary switch to "Administrator" user to perform this action. May be this example not so good(because this functionality may be implemented in such another way), but it is quite simple to understand. But it's seems that Subject.doAs, lc.login-lc.logout, pushRunAsRole don't work:(