<div dir="ltr">The message <span style="font-size:12.8px">NOT_ATTEMPTED is displayed when the bearer token is missing. So the server doesn&#39;t see the &quot;Authorization: bearer ...&quot; header. You&#39;ll need to check if that header is actually sent to the server.</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Take a look at our CORS example that should explain how to get things working with CORS. Basically you need to enable CORS for the adapter on the rest services.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 September 2016 at 08:58, Ganga Lakshmanasamy <span dir="ltr">&lt;<a href="mailto:lganga14@gmail.com" target="_blank">lganga14@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"><p dir="ltr">Yes our rest service is using keycloak adapter. How to check if it is a CORS issue. Is there a way?<br>
</p><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><div class="gmail_quote">On Sep 28, 2016 12:17 PM, &quot;Stian Thorgersen&quot; &lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Maybe it&#39;s a CORS issue? If it works from rest clients, but not from JS that could make sense.</div><div class="gmail_extra"><br><div class="gmail_quote">On 28 September 2016 at 08:47, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.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">I&#39;d try to debug the issue on the rest service side. What is in implemented in? Is it using a Keycloak adapter?</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 26 September 2016 at 09:06, Ganga Lakshmanasamy <span dir="ltr">&lt;<a href="mailto:lganga14@gmail.com" target="_blank">lganga14@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"><span><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Yes, we are using keycloak.js for token generation. We tried invoking the url and got the response as shown in attached screenshot. Please let us know if we are missing out any.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Regards,</div><div style="font-size:12.8px">Ganga Lakshmanasamy</div></span><div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Sep 26, 2016 at 12:07 PM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt;</span> wrote:<br></span><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How are you getting the token in the angular js based client? Are you using keycloak.js?<div><br></div><div>You can try to verify the token at <a href="http://jwt.io" target="_blank">jwt.io</a> to check if it&#39;s valid.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 26 September 2016 at 06:28, Ganga Lakshmanasamy <span dir="ltr">&lt;<a href="mailto:lganga14@gmail.com" target="_blank">lganga14@gmail.com</a>&gt;</span> wrote:<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"><div class="gmail_quote"><div dir="ltr"><span>Hi,<div><br></div><div>We are getting the &quot;NOT_ATTEMPTED: bearer only&quot; error while trying to access our backend rest service which has access type as bearer only from our public angular js based client. </div><div>We are setting the &quot;Authorization&quot; header in our request but looks like the adapter is not able to recognize the header with the bearer token.</div><div><br></div></span><div>Please help us resolving the issue. We have validated the client settings and the configs seems to be proper.</div><span><div><br></div><div><b>Note</b>: We are able to invoke the rest services with same bearer token from other rest clients like post man and advanced rest client for chrome. The issue comes up only when we try from our angular js code.</div><div><br></div><div>Regards,</div><div>Ganga Lakshmanasamy</div></span></div>
</div><br></div>
<br></div></div><span>______________________________<wbr>_________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">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/mailma<wbr>n/listinfo/keycloak-user</a><br></span></blockquote></div><br></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div></div>
</div></div></blockquote></div><br></div>