You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Alexander Milovidov <mi...@gmail.com> on 2024/06/11 15:08:16 UTC
Artemis Keycloak integration
Hi All,
Has anyone configured Keycloak for ActiveMQ Artemis management console?
I found that someone wrote in this mailing list about the successful
connection of Artemis v2.20.0 to Keycloak v16.1.1 in Feb 2022.
I tried to use an example from the artemis-examples repository
(features/standard/security-keycloak), and I have found that it does not
work with Keycloak versions 22 and higher.
This example uses Artemis 2.33.0.
When opening management console, I get an empty browser window, and an
error which can be seen in the developer tools (console tab):
Error: The 'Keycloak' constructor must be invoked with 'new'.
at Keycloak (keycloak.js?_=1718116975421:702:16)
at app-fafe513f4b.js:1:106123
at Object.<anonymous> (app-fafe513f4b.js:1:106675)
at l (lib-e53c220218.js:1:27075)
at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
at l (lib-e53c220218.js:1:75611)
at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
at m.handle (lib-e53c220218.js:1:37387)
When running an example with Keycloak 21.1.2, it works, at least it
redirects to the Keycloak login page.
I could not login to the console (it redirected back to the login page,
maybe due to insufficient permissions, some problems with role mapping, but
did not investigate further and did not test application connections to the
broker).
I found a similar issue in the RedHat Jira:
https://issues.redhat.com/projects/ENTMQBR/issues/ENTMQBR-9175 (AMQ 7 does
not work with the new Red Hat build of Keycloak 22/24).
Keycloak 25 also does not work with this example.
Is it a bug, or some misconfiguration? Has someone managed to connect
Artemis with the latest Keycloak versions?
--
Best regards,
Aleksandr
Re: Artemis Keycloak integration
Posted by Domenico Francesco Bruscino <br...@gmail.com>.
The new console requires Jetty >= 11 while the latest ActiveMQ Artemis
release is still using Jetty 10.
On Tue, 2 Jul 2024 at 08:58, Alexander Milovidov <mi...@gmail.com>
wrote:
> Hi Justin,
>
> I tried to run the new Artemis console without success.
> When I run it in the test mode, it should connect to the broker's Jolokia
> URL, but it could not connect it to any broker which requires
> authentication.
> Sometimes I got errors like "the server is not whitelisted", sometimes I
> had connected the new console to the server but did not see any Artemis
> objects.
> When I tried to add .war file of the new console to the broker's
> bootstrap.xml, it did not start because of missing or incompatible
> dependencies.
> Maybe there should be some kind of documentation or an explanation of how
> to make it work. Or how to build an Artemis with the new console.
>
> Is there a roadmap to include the new console in the Artemis release?
>
>
> ср, 12 июн. 2024 г. в 00:15, Justin Bertram <jb...@apache.org>:
>
> > Have you tried using the new console [1]?
> >
> >
> > Justin
> >
> > [1] https://github.com/apache/activemq-artemis-console
> >
> > On Tue, Jun 11, 2024 at 10:08 AM Alexander Milovidov <
> milovidoff@gmail.com
> > >
> > wrote:
> >
> > > Hi All,
> > >
> > > Has anyone configured Keycloak for ActiveMQ Artemis management console?
> > > I found that someone wrote in this mailing list about the successful
> > > connection of Artemis v2.20.0 to Keycloak v16.1.1 in Feb 2022.
> > >
> > > I tried to use an example from the artemis-examples repository
> > > (features/standard/security-keycloak), and I have found that it does
> not
> > > work with Keycloak versions 22 and higher.
> > > This example uses Artemis 2.33.0.
> > >
> > > When opening management console, I get an empty browser window, and an
> > > error which can be seen in the developer tools (console tab):
> > >
> > > Error: The 'Keycloak' constructor must be invoked with 'new'.
> > > at Keycloak (keycloak.js?_=1718116975421:702:16)
> > > at app-fafe513f4b.js:1:106123
> > > at Object.<anonymous> (app-fafe513f4b.js:1:106675)
> > > at l (lib-e53c220218.js:1:27075)
> > > at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
> > > at l (lib-e53c220218.js:1:75611)
> > > at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
> > > at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
> > > at m.handle (lib-e53c220218.js:1:37387)
> > >
> > > When running an example with Keycloak 21.1.2, it works, at least it
> > > redirects to the Keycloak login page.
> > > I could not login to the console (it redirected back to the login page,
> > > maybe due to insufficient permissions, some problems with role mapping,
> > but
> > > did not investigate further and did not test application connections to
> > the
> > > broker).
> > >
> > > I found a similar issue in the RedHat Jira:
> > > https://issues.redhat.com/projects/ENTMQBR/issues/ENTMQBR-9175 (AMQ 7
> > does
> > > not work with the new Red Hat build of Keycloak 22/24).
> > > Keycloak 25 also does not work with this example.
> > >
> > > Is it a bug, or some misconfiguration? Has someone managed to connect
> > > Artemis with the latest Keycloak versions?
> > >
> > > --
> > > Best regards,
> > > Aleksandr
> > >
> >
>
Re: Artemis Keycloak integration
Posted by Alexander Milovidov <mi...@gmail.com>.
Hi Justin,
I tried to run the new Artemis console without success.
When I run it in the test mode, it should connect to the broker's Jolokia
URL, but it could not connect it to any broker which requires
authentication.
Sometimes I got errors like "the server is not whitelisted", sometimes I
had connected the new console to the server but did not see any Artemis
objects.
When I tried to add .war file of the new console to the broker's
bootstrap.xml, it did not start because of missing or incompatible
dependencies.
Maybe there should be some kind of documentation or an explanation of how
to make it work. Or how to build an Artemis with the new console.
Is there a roadmap to include the new console in the Artemis release?
ср, 12 июн. 2024 г. в 00:15, Justin Bertram <jb...@apache.org>:
> Have you tried using the new console [1]?
>
>
> Justin
>
> [1] https://github.com/apache/activemq-artemis-console
>
> On Tue, Jun 11, 2024 at 10:08 AM Alexander Milovidov <milovidoff@gmail.com
> >
> wrote:
>
> > Hi All,
> >
> > Has anyone configured Keycloak for ActiveMQ Artemis management console?
> > I found that someone wrote in this mailing list about the successful
> > connection of Artemis v2.20.0 to Keycloak v16.1.1 in Feb 2022.
> >
> > I tried to use an example from the artemis-examples repository
> > (features/standard/security-keycloak), and I have found that it does not
> > work with Keycloak versions 22 and higher.
> > This example uses Artemis 2.33.0.
> >
> > When opening management console, I get an empty browser window, and an
> > error which can be seen in the developer tools (console tab):
> >
> > Error: The 'Keycloak' constructor must be invoked with 'new'.
> > at Keycloak (keycloak.js?_=1718116975421:702:16)
> > at app-fafe513f4b.js:1:106123
> > at Object.<anonymous> (app-fafe513f4b.js:1:106675)
> > at l (lib-e53c220218.js:1:27075)
> > at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
> > at l (lib-e53c220218.js:1:75611)
> > at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
> > at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
> > at m.handle (lib-e53c220218.js:1:37387)
> >
> > When running an example with Keycloak 21.1.2, it works, at least it
> > redirects to the Keycloak login page.
> > I could not login to the console (it redirected back to the login page,
> > maybe due to insufficient permissions, some problems with role mapping,
> but
> > did not investigate further and did not test application connections to
> the
> > broker).
> >
> > I found a similar issue in the RedHat Jira:
> > https://issues.redhat.com/projects/ENTMQBR/issues/ENTMQBR-9175 (AMQ 7
> does
> > not work with the new Red Hat build of Keycloak 22/24).
> > Keycloak 25 also does not work with this example.
> >
> > Is it a bug, or some misconfiguration? Has someone managed to connect
> > Artemis with the latest Keycloak versions?
> >
> > --
> > Best regards,
> > Aleksandr
> >
>
Re: Artemis Keycloak integration
Posted by Alexander Milovidov <mi...@gmail.com>.
I have checked the Artemis connection URL in the new console settings and
found that I should connect to /console/jolokia (not /hawtio/jolokia).
And it has successfully connected to Artemis, but the default instance is
empty. I will later try the new console in the test environment.
чт, 13 июн. 2024 г. в 18:44, Alexander Milovidov <mi...@gmail.com>:
> I tried but did not succeed. I ran the console in the test mode with mvn
> jetty:run, and default Artemis instance - both on the same Windows machine.
> I could not connect from the new console to Artemis with any IP-address
> (localhost or 127.0.0.1 or even the machine's IP-address after changing
> hostname in the bootstrap.xml binding URI). It just fails to connect (no
> matter if windows firewall is enabled or disabled).
> The new console .war itself does not run in Artemis because there's no
> classes needed to run it. My skills were not enough to understand how it
> can be integrated into existing Artemis installation. I will also try to
> run it on the Linux box, but I'm not sure that it will solve the problem.
>
> So I tried to figure out what does Keycloak need to work with Artemis and
> found that there was a change in version 22 or 24 that requires
> instantiation of JavaScript classes with "new" operator:
>
> https://www.keycloak.org/docs/24.0.4/release_notes/#required-to-be-instantiated-with-the-new-operator
>
> ср, 12 июн. 2024 г. в 13:39, Alexander Milovidov <mi...@gmail.com>:
>
>> Interesting, I haven't heard about the new console. I'll definitely try
>> it. Thanks Justin!
>>
>> ср, 12 июн. 2024 г. в 00:15, Justin Bertram <jb...@apache.org>:
>>
>>> Have you tried using the new console [1]?
>>>
>>>
>>> Justin
>>>
>>> [1] https://github.com/apache/activemq-artemis-console
>>>
>>>
>>>
Re: Artemis Keycloak integration
Posted by Alexander Milovidov <mi...@gmail.com>.
I tried but did not succeed. I ran the console in the test mode with mvn
jetty:run, and default Artemis instance - both on the same Windows machine.
I could not connect from the new console to Artemis with any IP-address
(localhost or 127.0.0.1 or even the machine's IP-address after changing
hostname in the bootstrap.xml binding URI). It just fails to connect (no
matter if windows firewall is enabled or disabled).
The new console .war itself does not run in Artemis because there's no
classes needed to run it. My skills were not enough to understand how it
can be integrated into existing Artemis installation. I will also try to
run it on the Linux box, but I'm not sure that it will solve the problem.
So I tried to figure out what does Keycloak need to work with Artemis and
found that there was a change in version 22 or 24 that requires
instantiation of JavaScript classes with "new" operator:
https://www.keycloak.org/docs/24.0.4/release_notes/#required-to-be-instantiated-with-the-new-operator
ср, 12 июн. 2024 г. в 13:39, Alexander Milovidov <mi...@gmail.com>:
> Interesting, I haven't heard about the new console. I'll definitely try
> it. Thanks Justin!
>
> ср, 12 июн. 2024 г. в 00:15, Justin Bertram <jb...@apache.org>:
>
>> Have you tried using the new console [1]?
>>
>>
>> Justin
>>
>> [1] https://github.com/apache/activemq-artemis-console
>>
>>
>>
Re: Artemis Keycloak integration
Posted by Alexander Milovidov <mi...@gmail.com>.
Interesting, I haven't heard about the new console. I'll definitely try it.
Thanks Justin!
ср, 12 июн. 2024 г. в 00:15, Justin Bertram <jb...@apache.org>:
> Have you tried using the new console [1]?
>
>
> Justin
>
> [1] https://github.com/apache/activemq-artemis-console
>
> On Tue, Jun 11, 2024 at 10:08 AM Alexander Milovidov <milovidoff@gmail.com
> >
> wrote:
>
> > Hi All,
> >
> > Has anyone configured Keycloak for ActiveMQ Artemis management console?
> > I found that someone wrote in this mailing list about the successful
> > connection of Artemis v2.20.0 to Keycloak v16.1.1 in Feb 2022.
> >
> > I tried to use an example from the artemis-examples repository
> > (features/standard/security-keycloak), and I have found that it does not
> > work with Keycloak versions 22 and higher.
> > This example uses Artemis 2.33.0.
> >
> > When opening management console, I get an empty browser window, and an
> > error which can be seen in the developer tools (console tab):
> >
> > Error: The 'Keycloak' constructor must be invoked with 'new'.
> > at Keycloak (keycloak.js?_=1718116975421:702:16)
> > at app-fafe513f4b.js:1:106123
> > at Object.<anonymous> (app-fafe513f4b.js:1:106675)
> > at l (lib-e53c220218.js:1:27075)
> > at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
> > at l (lib-e53c220218.js:1:75611)
> > at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
> > at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
> > at m.handle (lib-e53c220218.js:1:37387)
> >
> > When running an example with Keycloak 21.1.2, it works, at least it
> > redirects to the Keycloak login page.
> > I could not login to the console (it redirected back to the login page,
> > maybe due to insufficient permissions, some problems with role mapping,
> but
> > did not investigate further and did not test application connections to
> the
> > broker).
> >
> > I found a similar issue in the RedHat Jira:
> > https://issues.redhat.com/projects/ENTMQBR/issues/ENTMQBR-9175 (AMQ 7
> does
> > not work with the new Red Hat build of Keycloak 22/24).
> > Keycloak 25 also does not work with this example.
> >
> > Is it a bug, or some misconfiguration? Has someone managed to connect
> > Artemis with the latest Keycloak versions?
> >
> > --
> > Best regards,
> > Aleksandr
> >
>
Re: Artemis Keycloak integration
Posted by Justin Bertram <jb...@apache.org>.
Have you tried using the new console [1]?
Justin
[1] https://github.com/apache/activemq-artemis-console
On Tue, Jun 11, 2024 at 10:08 AM Alexander Milovidov <mi...@gmail.com>
wrote:
> Hi All,
>
> Has anyone configured Keycloak for ActiveMQ Artemis management console?
> I found that someone wrote in this mailing list about the successful
> connection of Artemis v2.20.0 to Keycloak v16.1.1 in Feb 2022.
>
> I tried to use an example from the artemis-examples repository
> (features/standard/security-keycloak), and I have found that it does not
> work with Keycloak versions 22 and higher.
> This example uses Artemis 2.33.0.
>
> When opening management console, I get an empty browser window, and an
> error which can be seen in the developer tools (console tab):
>
> Error: The 'Keycloak' constructor must be invoked with 'new'.
> at Keycloak (keycloak.js?_=1718116975421:702:16)
> at app-fafe513f4b.js:1:106123
> at Object.<anonymous> (app-fafe513f4b.js:1:106675)
> at l (lib-e53c220218.js:1:27075)
> at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
> at l (lib-e53c220218.js:1:75611)
> at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
> at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
> at m.handle (lib-e53c220218.js:1:37387)
>
> When running an example with Keycloak 21.1.2, it works, at least it
> redirects to the Keycloak login page.
> I could not login to the console (it redirected back to the login page,
> maybe due to insufficient permissions, some problems with role mapping, but
> did not investigate further and did not test application connections to the
> broker).
>
> I found a similar issue in the RedHat Jira:
> https://issues.redhat.com/projects/ENTMQBR/issues/ENTMQBR-9175 (AMQ 7 does
> not work with the new Red Hat build of Keycloak 22/24).
> Keycloak 25 also does not work with this example.
>
> Is it a bug, or some misconfiguration? Has someone managed to connect
> Artemis with the latest Keycloak versions?
>
> --
> Best regards,
> Aleksandr
>