<div dir="ltr">Thanks for your reply Francis. I still have one problem:<div><br></div><div>When I run this:</div><div>$ docker run --name keycloak1 -p 8080:8080 -p 8787:8787 jboss/keycloak<br></div><div><br></div><div>I can access the keycloak app console on <a href="http://192.168.99.100:8080/auth/">http://192.168.99.100:8080/auth/</a> from my browser</div><div><br></div><div>But when I run it in debug mode as:</div><div>$ docker run --name keycloak1 -p 8080:8080 -p 8787:8787 jboss/keycloak --debug<br></div><div><br></div><div>I cannot access the keycloak console. What is wrong here, any idea?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 12:48 AM, Francis Pouatcha <span dir="ltr">&lt;<a href="mailto:francis.pouatcha@adorsys.com" target="_blank">francis.pouatcha@adorsys.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Rashmi,<div><br></div><div>follow these instructions to have keycloack debug accessible from eclipse:</div><div><br></div><div>1- Simple web application</div><div>User a simple HelloServlet to try out the debugging process before applying you experience to wildfly.</div><div><br></div><div>1- Wildfly and eclipse</div><div>Like Thomas mentioned, Make sure you active the debug property while starting wildfly. This is independent of keycloak, as keycloak is just another web application running on wildfly. So make sure you have a simple webapp running in wildfly standalone so you can get used to the debugging process.</div><div><br></div><div>2- Wildfly in a docker container</div><div>Take your simple web application and wildfly into a docker container and try following:</div><div>a) Make sure you start wildfly in the container in debug mode. Not matter how you manage the docker containers in your development environment, you will have to expose their ports so you can reach the container from and outside the docker host. &quot;Exposing the port means mapping the defined wildfly ports to some other ports on the docker host. If you are using docker-composer you have to try something like:   ports:\    - &quot;8080:8080&quot;\    - &quot;8787:8787&quot;. In this case see the docker-compose reference for details.</div><div><br></div><div>3- Accessing the docker container</div><div>Once you wildfly docker container is startet in debug mode, make sure you can access you HelloServlet  from a web browser on the same machine on which you have your eclipse installed. If this works, use the same hostname or ip to replace &quot;localhost&quot; in you eclipse debugging config. Generally this will default to: <span style="font-size:12.8px"><a href="http://192.168.99.100:8787" target="_blank">192.168.99.100:8787</a>.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">You did it right, you will be able to stop on the breakpoint inside your HelloServlet.</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">4- Keycloak</span></div><div>Repeat the same procedure with your custom authenticator. Do not forget to download the keycloak sources and include them in your the source path so you can navigate and set break points.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr">Best regards<br>Mit freundlichen Grüßen<br>Cordialement<br><br>Francis Pouatcha<br>Founder and Technical Lead Group Adorsys<br><br>LinkedIn: <a href="http://www.linkedin.com/pub/francis-pouatcha/8/35a/542" target="_blank">http://www.linkedin.com/pub/francis-pouatcha/8/35a/542</a><br>adorsys GmbH &amp; Co. KG, Germany: <a href="http://www.youtube.com/watch?v=rVRkFGUNexo&amp;authuser=0" target="_blank">http://www.youtube.com/watch?v=rVRkFGUNexo&amp;authuser=0</a><br>Adorsys S.A., Cameroon: &quot;African Software Competence Center&quot;<br>Open <a href="https://github.com/adorsys" target="_blank">https://github.com/adorsys</a><br><br>Cell USA: <a href="tel:%2B1%20770%20329%207026" value="+17703297026" target="_blank">+1 770 329 7026</a><br>Cell Germany: <a href="tel:%2B49%20172%2018%2016%20074" value="+491721816074" target="_blank">+49 172 18 16 074</a><br>Cell Cameroon: +237 51 74 71 99<br><br></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Fri, Jul 1, 2016 at 2:39 AM, Rashmi Singh <span dir="ltr">&lt;<a href="mailto:singhrasster@gmail.com" target="_blank">singhrasster@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Thomas for your reply. I have a few questions on your response. I am still very new to docker, so please bear with me. <div>when you say I can set env variables in docker container, would this be sufficient?</div><div><br></div><div>First connect to the docker container as:</div><div><br></div><div>docker exec -i -t keycloak bash<br></div><div>Then, once I am in the container, I run the following to set env variables?</div><div><br></div><div><div><div style="font-size:12.8px">set DEBUG_MODE=true</div><div style="font-size:12.8px">set DEBUG_PORT=8787</div><div style="font-size:12.8px">exit</div><div style="font-size:12.8px">Then, restart the container as:</div><div style="font-size:12.8px">docker restart keycloak    (keycloak is the name of my container)</div><div style="font-size:12.8px">Also, how can I make sure that the env variable got correctly set in the docker container? From inside the container, if I run the command &quot;env&quot;, should it list these new env variables if they are added successfully?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Then, when you say &quot;......<span style="font-size:12.8px">default on port 8787 which you need to expose on your docker container or use the container interface...&quot;, what exactly do you mean? Do you mean some sort of port forwarding? Could you tell me w tohat exactly I need to do with my existing container named as &quot;keycloak&quot;</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Then, on eclipse, where you mentioned the settings for the Debug configurations, what should be the hostname there? would it be localhost? or the default machine IP of docker which is 192.168.99.100? Or it should be something else?</span></div><div style="font-size:12.8px"><br></div></div></div><div> </div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 6:29 PM, Thomas Darimont <span dir="ltr">&lt;<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>you could add -debug flag to the standalone.sh command-line or define the following env variables in your docker container:</div><div><div>set DEBUG_MODE=true</div><div>set DEBUG_PORT=8787</div></div><div><br></div><div>this will start keycloak with remote debugging enabled by default on port 8787 which you need to expose on your docker container or use the container interface...</div><div><br></div><div>you can then connect to the keycloak instance inside the docker container via the remote debugger from your IDE.</div><div>For eclipse just go to &quot;Debug configurations...&quot; -&gt; Remote Java Application -&gt; select your project with the custom authenticator -&gt; adjust hostname and port and click &quot;debug&quot;.</div><div><br></div><div>Cheers,</div><div>Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-07-01 0:26 GMT+02:00 Rashmi Singh <span dir="ltr">&lt;<a href="mailto:singhrasster@gmail.com" target="_blank">singhrasster@gmail.com</a>&gt;</span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">We have a Maven project setup on Eclipse that uses some keycloak features and we generate a jar that contains our AuthenticationProvider classes etc. <div>We use docker for the deployment. We basically run a jboss/keycloak image there</div><div>We have a shell script that has a bunch of commands to copy our project jars from local to the keycloak image on docker container like:</div><div><br></div><div>docker cp /customauthenticator-1.0.0-SNAPSHOT.jar keycloak:/home/modules/xxx.yyy.zz.keycloak.customizations<br></div><div>....</div><div>docker restart keycloak<br></div><div><br></div><div>Running this shell script deploys everything on keycloak on docker.</div><div>And so far we are just putting logs throughout our code to debug issues.</div><div>We want to be able to setup a debugging environment on our eclipse. I am not sure how to achieve this when we use keycloak. Because, here we basically build our modules or authenticator jars etc and copy them to keycloak directories. So, it&#39;s not a standalone project war file that we are directly deploying to app server as such. So, then how do we put our maven project (creating jars etc) in a debug mode in eclipse? Is it possible? How?</div></div>
<br></div></div>_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>