on 02-22-2013 4:47 PM
Hi,
in a stateless session bean I'd like to retrieve the user id of the currently logged in portal user.
I tried it with UMFactory.getAuthenticator().getLoggedInUser() and SessionContext.getCallerPrincipal().getName().
UMFactory.getAuthenticator().getLoggedInUser() returns null.
And SessionContext.getCallerPrincipal().getName() ends up in the Exception "javax.ejb.EJBException: ASJ.ejb.003002 EJB Container cannot obtain the security principal, because no security context has been associated with the current thread. Probably the code is executed in system instead of application thread. In order to resolve the error, the code should be executed in an application thread."
Any ideas what could be the problem?
Thanks in advance.
Best regards,
Robert
I found out that this occurs when the session bean is called from a custom UWL connector.
So this question is answered and the next one will be how to get the security context/session context in such a scenario.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.