OK, maybe I have to change my question.
I have an application that connects to my JBoss Server and uses no credentials at first.
Than it gets some information from the server. The Beans that are used don't have a security context.
Now I use part of the information to access Beans that have a security context.
So I set during runtime of my client app the credential data (using some information that I got before)
Is something like this also possible with JBoss 7.1?
It seems as if my credentials are not being used when I change or set them during runtime.
When I check the SQL Statement in SQL Profiler the password is not the one I set on client side.
Ok, once more.
I found the following https://community.jboss.org/wiki/JBossAS7RemoteEJBAuthenticationHowto
But event with that I fail. Is there somewhere a guide for dummies (like me)
I just don't understand how I can set the credentials of my user in order to access beans in security context.
In JBOSS 4 this worked for me:
org.jboss.security.SecurityAssociation.setPrincipal(new UserIdPrincipal(objUser.getUsername(), objUser.getId()));