You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/07/25 11:03:00 UTC

[jira] [Updated] (ARTEMIS-5587) HttpServerAuthenticator needs to set correct TCCL

     [ https://issues.apache.org/jira/browse/ARTEMIS-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ARTEMIS-5587:
------------------------------------
    Labels: pull-request-available  (was: )

> HttpServerAuthenticator needs to set correct TCCL
> -------------------------------------------------
>
>                 Key: ARTEMIS-5587
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5587
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.43.0
>            Reporter: Grzegorz Grzybek
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When using this configuration in {{etc/artemis.profile}}:
> {noformat}
> -DhttpServerAuthenticator.realm=activemq
> -DhttpServerAuthenticator.requestSubjectAttribute=org.jolokia.jaasSubject
> -javaagent:$HOME/.m2/repository/org/jolokia/jolokia-agent-jvm/2.2.10-SNAPSHOT/jolokia-agent-jvm-2.2.10-SNAPSHOT-javaagent.jar= \
>     authClass=org.apache.activemq.artemis.spi.core.security.jaas.HttpServerAuthenticator, \
>     port=7778, \
>     protocol=http, \
>     debug=true, \
>     lazy=true
> {noformat}
> I could tell Jolokia to use Artemis' implementation of {{com.sun.net.httpserver.Authenticator}}. By default, {{etc/login.conf}} is:
> {noformat}
> activemq {
>    org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required
>        debug=false
>        reload=true
>        org.apache.activemq.jaas.properties.user="artemis-users.properties"
>        org.apache.activemq.jaas.properties.role="artemis-roles.properties";
> };
> {noformat}
> The problem is that while Jolokia loads {{org.apache.activemq.artemis.spi.core.security.jaas.HttpServerAuthenticator}} correctly thanks to its {{ArtemisDetector}}, When {{LoginContext.login()}} is invoked, it's the TCCL that is tried to load actual login module (here: {{org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule}}).
> Currently TCCL is set to app class loader.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact