-
1. Re: Inherit security context from application server
clebert.suconic Aug 11, 2011 6:08 PM (in response to jmbarone)We have just been using JAAS On JBoss latest versions.
-
2. Re: Inherit security context from application server
jmbarone Aug 12, 2011 5:50 AM (in response to clebert.suconic)That´s ok, but you need to login again inside the middleware.
Also, you can obtain the authenticated user, but not the password from the context (obviously!).
So you need to obtain the password, the same password that the user already entered in the web app, from another source.
That´s the point, i want to connect directly to HornetQ if the current user is already authenticated in the JEE container, the same way the session beans inherits the security info from the web context.
Thanks for your time, Clebert.
(Se vc é brasileiro, vai um cumprimento de um vizinho, eu sou uruguaio)
-
3. Re: Inherit security context from application server
ataylor Aug 12, 2011 6:18 AM (in response to jmbarone) -
4. Re: Inherit security context from application server
jmbarone Aug 12, 2011 8:12 AM (in response to ataylor)andy: following your advice i found this text in the user manual (i set the most important in bold):
This means that what i need it's already implemented and it's another case of poor search in the manual :-)
Sorry and thanks for the quick answers and for this excellent software.
-
5. Re: Inherit security context from application server
jmbarone Aug 22, 2011 10:10 AM (in response to jmbarone)Hi, i'm here again :-)
I'm trying to audit the business operations in a JEE container and i need to know who's sending data to the queue, without any explicit intervention in the source code (i can't wait for the collaboration of the programmer to set variables or that kind of things).
I check the API and do some tests with hornetq interceptors, but without success, i mean, i can't obtain the authenticated user inside the interceptor directly.
Maybe i'm doing wrong or exists some other way to do this?
Thanks.
-
6. Re: Inherit security context from application server
ataylor Aug 22, 2011 10:22 AM (in response to jmbarone)Hi, i'm here again :-)
I'm trying to audit the business operations in a JEE container and i need to know who's sending data to the queue, without any explicit intervention in the source code (i can't wait for the collaboration of the programmer to set variables or that kind of things).
I check the API and do some tests with hornetq interceptors, but without success, i mean, i can't obtain the authenticated user inside the interceptor directly.
Maybe i'm doing wrong or exists some other way to do this?
Sorry, Im not really sure I understand what you are saying, what API are you checking?
-
7. Re: Inherit security context from application server
jmbarone Aug 22, 2011 10:43 AM (in response to ataylor)The hornetQ API, i was searching some class/method to obtain the actual user authenticated, but inside the interceptor.
I find some things, like UserID and ClientID but these properties doesn't refer to the authenticated user in hornetQ.
Thanks Andy.
-
8. Re: Inherit security context from application server
ataylor Aug 22, 2011 10:51 AM (in response to jmbarone)we delegate security to the App server so dont have access to it. However you can get the username from the connection info
-
9. Re: Inherit security context from application server
jmbarone Aug 22, 2011 11:35 AM (in response to ataylor)The interceptor receives a RemoteConnection argument.
In which method/class i can find the username?...
-
10. Re: Inherit security context from application server
ataylor Aug 22, 2011 11:52 AM (in response to jmbarone)listConnectionsAsJSON on JMSServerControl thru the management API's
-
11. Re: Inherit security context from application server
jmbarone Aug 22, 2011 3:22 PM (in response to jmbarone)the management API only offers one static method: getNotificationInfos on JMSServerControlImpl.
i find 2 classes that contains the username info: JMSConnectionInfo or ServerSession, but i cannot see a path from the message or the remoting connection (the parameters of the intercept method) to them.
-
12. Re: Inherit security context from application server
ataylor Aug 23, 2011 5:29 AM (in response to jmbarone)the management API only offers one static method: getNotificationInfos on JMSServerControlImpl.
Why does it have to be a static method?
i find 2 classes that contains the username info: JMSConnectionInfo or ServerSession, but i cannot see a path from the message or the remoting connection (the parameters of the intercept method) to them.
Im not sure I understand what your entry point is for doing this, however simply look up the JMSServerControl object and call listConnectionsAsJSON
something like:
String jsonString = jmsServerControl.listConnectionsAsJSON();
JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonString);
-
13. Re: Inherit security context from application server
jmbarone Aug 23, 2011 10:34 AM (in response to ataylor)Ok, Andy ... i understands before, but what i'm asking is how i instantiate the jmsServerControl instance?...
The constructor needs JMSServerManager and that class needs HornetQServer ... so i'm going deeper and deeper inside the core of HornetQ instantiating core classes by myself.
That's why i'm searching a static method or something like that to reach the right server instance, not a server class instantiated by me.
-
14. Re: Inherit security context from application server
ataylor Aug 23, 2011 10:39 AM (in response to jmbarone)just look it up via one of the management API's, either JMX or JMS management, take a look at the user manual