You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JacobS <ja...@gmail.com> on 2011/03/17 09:51:49 UTC

jaasAuthenticationPlugin in osgi

I am trying to use the jaasAuthenticationPlugin in my osgi environment (
Virgo web server with spring-dm ), but after creating an LoginModule
implementation and exposing it to the service registry the activemq bundle
cannot find it and throws this exception:

10:34:45.262 [ActiveMQ Transport: tcp:///127.0.0.1:51561] WARN 
o.a.a.broker.TransportConnection - Failed to add Connection
java.lang.SecurityException: User name or password is invalid.
	at
org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:83)
~[bundlefile:5.4.1]
	at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
~[bundlefile:5.4.1]
	at
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
~[bundlefile:5.4.1]
	at
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:694)
[bundlefile:5.4.1]
	at
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83)
[bundlefile:5.4.1]
	at
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137)
[bundlefile:5.4.1]
	at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:309)
[bundlefile:5.4.1]
	at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:228)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
[bundlefile:5.4.1]
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:201)
[bundlefile:5.4.1]
	at java.lang.Thread.run(Thread.java:662) [na:1.6.0_24]
Caused by: javax.security.auth.login.LoginException: unable to find
LoginModule class: acme.security.MyLoginModule in KernelBundleClassLoader:
[bundle=org.apache.activemq.activemq-core_5.4.1]
	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)
~[na:1.6.0_24]
	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
~[na:1.6.0_24]
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
~[na:1.6.0_24]
	at java.security.AccessController.doPrivileged(Native Method)
~[na:1.6.0_24]
	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
~[na:1.6.0_24]
	at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
~[na:1.6.0_24]
	at
org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:76)
~[bundlefile:5.4.1]

I am using activemq 5.4.1

Thanks
Jacob


--
View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3383955.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: jaasAuthenticationPlugin in osgi

Posted by JacobS <ja...@gmail.com>.
Thanks, I will give it a try

--
View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3385251.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: jaasAuthenticationPlugin in osgi

Posted by Guillaume Nodet <gn...@gmail.com>.
See http://karaf.apache.org/manual/2.2.0/developers-guide/security-framework.html
and the code is at
  http://svn.apache.org/viewvc/karaf/tags/karaf-2.2.0/jaas/

On Thu, Mar 17, 2011 at 13:58, JacobS <ja...@gmail.com> wrote:
> Can you elaborate about integration layer for karaf, maybe I can use that in
> virgo, where can I find some documentation on that ?
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384425.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: jaasAuthenticationPlugin in osgi

Posted by JacobS <ja...@gmail.com>.
Can you elaborate about integration layer for karaf, maybe I can use that in
virgo, where can I find some documentation on that ?

--
View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384425.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: jaasAuthenticationPlugin in osgi

Posted by Guillaume Nodet <gn...@gmail.com>.
JAAS does not work in OSGi.  You need to use a specific integration
layer in order to make that work.
We've done that in Karaf, but not sure how easy it would be to port it in Virgo.
But that's more a question for the Virgo guys rather than ActiveMQ, as
ActiveMQ has nothing do fix in that area.

On Thu, Mar 17, 2011 at 11:00, JacobS <ja...@gmail.com> wrote:
> Hi,
> acme.security.MyLoginModule  is my implementation of the LoginModule
> interface it is not a misconfiguration. btw this implementation worked fine
> when used not as an osgi service.
>
> This is my config file:
>
> ActiveMQ {
> acme.security.MyLoginModule required
> debug="true";
> };
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384078.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: jaasAuthenticationPlugin in osgi

Posted by JacobS <ja...@gmail.com>.
Hi,
acme.security.MyLoginModule  is my implementation of the LoginModule
interface it is not a misconfiguration. btw this implementation worked fine
when used not as an osgi service.

This is my config file:

ActiveMQ {
acme.security.MyLoginModule required
debug="true";
};

--
View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384078.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: jaasAuthenticationPlugin in osgi

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

this login module class looks strange

acme.security.MyLoginModule

maybe it's a misconfiguration?

Regards
-- 
Dejan Bosanac
-----------------
FuseSource - The experts in open source integration and messaging.
Email: dejanb@fusesource.com
Web: http://fusesource.com
Twitter:  http://twitter.com/dejanb
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Mar 17, 2011 at 9:51 AM, JacobS <ja...@gmail.com> wrote:

> I am trying to use the jaasAuthenticationPlugin in my osgi environment (
> Virgo web server with spring-dm ), but after creating an LoginModule
> implementation and exposing it to the service registry the activemq bundle
> cannot find it and throws this exception:
>
> 10:34:45.262 [ActiveMQ Transport: tcp:///127.0.0.1:51561] WARN
> o.a.a.broker.TransportConnection - Failed to add Connection
> java.lang.SecurityException: User name or password is invalid.
>        at
>
> org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:83)
> ~[bundlefile:5.4.1]
>        at
> org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
> ~[bundlefile:5.4.1]
>        at
>
> org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
> ~[bundlefile:5.4.1]
>        at
>
> org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:694)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83)
> [bundlefile:5.4.1]
>        at
> org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:309)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:228)
> [bundlefile:5.4.1]
>        at
>
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
> [bundlefile:5.4.1]
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
> [bundlefile:5.4.1]
>        at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:201)
> [bundlefile:5.4.1]
>        at java.lang.Thread.run(Thread.java:662) [na:1.6.0_24]
> Caused by: javax.security.auth.login.LoginException: unable to find
> LoginModule class: acme.security.MyLoginModule in KernelBundleClassLoader:
> [bundle=org.apache.activemq.activemq-core_5.4.1]
>        at
> javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)
> ~[na:1.6.0_24]
>        at
> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
> ~[na:1.6.0_24]
>        at
> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
> ~[na:1.6.0_24]
>        at java.security.AccessController.doPrivileged(Native Method)
> ~[na:1.6.0_24]
>        at
> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
> ~[na:1.6.0_24]
>        at
> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
> ~[na:1.6.0_24]
>        at
>
> org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:76)
> ~[bundlefile:5.4.1]
>
> I am using activemq 5.4.1
>
> Thanks
> Jacob
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3383955.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>