<div dir="ltr">Did you try the example does it work?</div><div class="gmail_extra"><br><div class="gmail_quote">On 28 September 2016 at 13:35, Mariusz Chruscielewski - Info.nl <span dir="ltr"><<a href="mailto:mariusz@info.nl" target="_blank">mariusz@info.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="NL" link="#0563C1" vlink="#954F72">
<div>
<pre style="background:#2b2b2b"><span lang="EN-US">I can’t make REST endpoint work, I’m using exactly code supplied in example, I tried also to check how standard endpoints in keycloak code are created, all looks similar:<br><br><span style="color:#a9b7c6"><br></span><i><span style="color:#629755">/**<br> * <b>@author </b></span><span style="color:#77b767"><a href="mailto:<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.<wbr>com</a>"></span><span style="color:#629755">Stian Thorgersen</span><span style="color:#77b767"></a><br> </span><span style="color:#629755">*/<br></span></i><span style="color:#cc7832">public class </span><span style="color:#a9b7c6">HelloResourceProvider </span><span style="color:#cc7832">implements </span><span style="color:#a9b7c6">RealmResourceProvider {<br><br> </span><span style="color:#cc7832">private </span><span style="color:#a9b7c6">KeycloakSession </span><span style="color:#9876aa">session</span><span style="color:#cc7832">;<br><br> public </span><span style="color:#ffc66d">HelloResourceProvider</span><span style="color:#a9b7c6">(<wbr>KeycloakSession session) {<br> </span><span style="color:#cc7832">this</span><span style="color:#a9b7c6">.</span><span style="color:#9876aa">session </span><span style="color:#a9b7c6">= session</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">}<br><br> </span><span style="color:#bbb529">@GET<br> @Produces</span><span style="color:#a9b7c6">(MediaType.</span><i><span style="color:#9876aa">TEXT_HTML</span></i><span style="color:#a9b7c6">)<br> </span><span style="color:#bbb529">@Path</span><span style="color:#a9b7c6">(</span><span style="color:#6a8759">"/{action}"</span><span style="color:#a9b7c6">)<br> </span><span style="color:#cc7832">public </span><span style="color:#a9b7c6">String </span><span style="color:#ffc66d">get</span><span style="color:#a9b7c6">(</span><span style="color:#bbb529">@PathParam</span><span style="color:#a9b7c6">(</span><span style="color:#6a8759">"action"</span><span style="color:#a9b7c6">) String action) {<br> </span><span style="color:gray">//String requestUri = session.getContext().getUri().<wbr>getRequestUri().toString();<br><br> </span><span style="color:#a9b7c6">String title = </span><span style="color:#6a8759">"APP_REQUEST"</span><span style="color:#cc7832">;<br> if </span><span style="color:#a9b7c6">(action.equals(</span><span style="color:#6a8759">"auth"</span><span style="color:#a9b7c6">)) {<br> title = </span><span style="color:#6a8759">"AUTH_RESPONSE"</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">} </span><span style="color:#cc7832">else if </span><span style="color:#a9b7c6">(action.equals(</span><span style="color:#6a8759">"logout"</span><span style="color:#a9b7c6">)) {<br> title = </span><span style="color:#6a8759">"LOGOUT_REQUEST"</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">}<br><br> StringBuilder sb = </span><span style="color:#cc7832">new </span><span style="color:#a9b7c6">StringBuilder()</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">sb.append(</span><span style="color:#6a8759">"<html><head><title><wbr>" </span><span style="color:#a9b7c6">+ title + </span><span style="color:#6a8759">"</title></head><body>"</span><span style="color:#a9b7c6">)</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">UriBuilder base = UriBuilder.<i>fromUri</i>(</span><span style="color:#6a8759">"<a href="http://localhost:8180/auth" target="_blank">http://<wbr>localhost:8180/auth</a>"</span><span style="color:#a9b7c6">)</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">sb.append(</span><span style="color:#6a8759">"<a href=</span><span style="color:#cc7832">\"</span><span style="color:#6a8759">" </span><span style="color:#a9b7c6">+ RealmsResource.<i>accountUrl</i>(<wbr>base).build(</span><span style="color:#6a8759">"test"</span><span style="color:#a9b7c6">).toString() + </span><span style="color:#6a8759">"</span><span style="color:#cc7832">\"</span><span style="color:#6a8759"> id=</span><span style="color:#cc7832">\"</span><span style="color:#6a8759">account</span><span style="color:#cc7832">\"</span><span style="color:#6a8759">>account</a>"</span><span style="color:#a9b7c6">)</span><span style="color:#cc7832">;<br><br> </span><span style="color:#a9b7c6">sb.append(</span><span style="color:#6a8759">"</body></html>"</span><span style="color:#a9b7c6">)</span><span style="color:#cc7832">;<br> return </span><span style="color:#a9b7c6">sb.toString()</span><span style="color:#cc7832">;<br> </span><span style="color:#a9b7c6">}<br><br> </span><span style="color:#bbb529">@Override<br> </span><span style="color:#cc7832">public </span><span style="color:#a9b7c6">Object </span><span style="color:#ffc66d">getResource</span><span style="color:#a9b7c6">() {<br> </span><span style="color:#cc7832">return this;<br> </span><span style="color:#a9b7c6">}<br><br> </span><span style="color:#bbb529">@Override<br> </span><span style="color:#cc7832">public void </span><span style="color:#ffc66d">close</span><span style="color:#a9b7c6">() {<br> }<br><br>}</span><u></u><u></u></span></pre>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<pre style="margin:6.0pt"><span lang="EN-US">But I’m still getting:<u></u><u></u></span></pre>
<pre style="margin-right:6.0pt;margin-bottom:6.0pt;margin-left:0cm"><span lang="EN-US"> <u></u><u></u></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black">RESTEASY003815: Subresource for target class has no jax-rs annotations.: nl.vi.keycloak.providers.rest.<wbr>HelloResourceProvider</span></code><span lang="EN-US"><u></u><u></u></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black"> </span></code><span lang="EN-US"><u></u><u></u></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black">Can you please help me? Thanks</span></code><u></u><u></u></pre>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<table border="0" cellpadding="0" width="461" style="width:345.65pt">
<tbody>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 0cm 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black">Kind Regards,</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black">Mariusz Chruscielewski</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u><u></u></span></p>
</td>
</tr>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 15.0pt 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black">Software Engineer | <a href="mailto:mariusz@info.nl" target="_blank"><span style="color:blue">mariusz@info.nl</span></a> <u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black">+31 (0)20 530 91 13 | <a href="tel:%2B48%20695%20555%20292" value="+48695555292" target="_blank">+48 695 555 292</a>
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u><u></u></span></p>
</td>
</tr>
<tr style="height:15.3pt">
<td style="padding:0cm 0cm 3.0pt 0cm;height:15.3pt">
<p class="MsoNormal" style="line-height:16.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><a href="http://www.info.nl/" target="_blank"><span lang="EN-US" style="font-size:14.0pt;color:white;background:black">info.nl</span><span lang="EN-US" style="color:blue"> </span></a><a href="http://www.info.nl/nl?utm_source=e-mail_sig&utm_medium=e-mail&utm_term=connecting_the_dots&utm_campaign=info_sig" target="_blank"><i><span lang="EN-US" style="color:black">making
platforms work</span></i></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u><u></u></span></p>
</td>
</tr>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 15.0pt 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black">Sint Antoniesbreestraat 16 | 1011 HB Amsterdam | +31 (0)20 530 91 11</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif"><a href="https://www.facebook.com/infonl" target="_blank"><span style="color:blue">Facebook</span></a> |
<a href="https://twitter.com/infonl" target="_blank"><span style="color:blue">Twitter</span></a> |
<a href="https://www.linkedin.com/company/info-nl" target="_blank"><span style="color:blue">LinkedIn</span></a> |
<a href="https://plus.google.com/+infonl/" target="_blank"><span style="color:blue">Google+</span></a></span><span style="font-size:10.0pt;font-family:"Georgia",serif"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div>