<div dir="ltr">Hi,<div><br></div><div>I have the war file of service bearer only application in <b>jboss deployments folder, </b>the auth-server.war for keycloak is also at the same location.</div><div><br></div><div>Roles configured:-</div><div><img src="cid:ii_14dbeca548e2e58e" alt="Inline image 1" width="472" height="136"><br></div><div><br></div><div>Here&#39; my web.xml for service bearer only application:-</div><div><br></div><div><img src="cid:ii_14dbed93f3336999" alt="Inline image 2" width="472" height="272"><br></div><div><br></div><div>Here&#39;s the setting for the bearer only application in keycloak</div><div><br></div><div><img src="cid:ii_14dbedc6478e1f94" alt="Inline image 3" width="472" height="262"><br></div><div><br></div><div>User Role Mappings</div><div><br></div><div><img src="cid:ii_14dbee4cb5e64fd0" alt="Inline image 1" width="472" height="348"><br></div><div><br></div><div>I am using REST services to fulfill the request. Here&#39;s a snippet of code:-</div><div><br></div><div><div><b><i>KeycloakSecurityContext securityContext = (KeycloakSecurityContext) httpRequest</i></b></div><div><b><i><span class="" style="white-space:pre">                                </span>.getAttribute(KeycloakSecurityContext.class.getName());</i></b></div><div><b><i>AccessToken accessToken = securityContext.getToken();</i></b></div></div><div><br></div><div><br></div><div>OAuth Client Scope Mappings:-</div><div><br></div><div><img src="cid:ii_14dbeebaff520bf8" alt="Inline image 2" width="472" height="262"><br></div><div><br></div><div><br></div><div>Please let me know, if any more information is required.</div><div><br></div><div><br></div><div>Regards,</div><div>Arjit Agrawal</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 4, 2015 at 6:02 PM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:stian@redhat.com" target="_blank">stian@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">We&#39;ll need much more info here. How have you secured the app? Is it a WAR? Do you require any roles for the resource you&#39;re invoking? Are you sending a bearer token with the request? How do you get the request? Does the user have the required roles? Does the client have the required scope?<br>
<span class=""><br>
----- Original Message -----<br>
&gt; From: &quot;Arjit Agrawal&quot; &lt;<a href="mailto:arjit.agrawal.07@gmail.com">arjit.agrawal.07@gmail.com</a>&gt;<br>
&gt; To: &quot;keycloak-user&quot; &lt;<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>&gt;<br>
&gt; Sent: Thursday, 4 June, 2015 5:49:08 AM<br>
&gt; Subject: [keycloak-user] HTTP 403 Forbidden while connecting to bearer only   application<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I have a new application - &#39;testapi&#39; under a new realm - &#39;testrealm&#39;. This<br>
&gt; application is to be used as an API. Its an bearer only application .<br>
&gt;<br>
&gt; I have also made an OAuth Client to access this service.<br>
&gt;<br>
&gt; I am using iOS AeroGear plugin in my project to connect to API service with<br>
&gt; all the required creditionals like clientId, roles etc.<br>
&gt;<br>
&gt; Version of Keycloak - 1.0-beta3 .<br>
&gt; Version of Jboss - JBoss AS 7.1.1<br>
&gt;<br>
</span>&gt; Its hosted on Amazon AWS . (I tried the same in my local environment it was<br>
<span class="">&gt; working but when i have done the same on Amazon server, i am getting this<br>
&gt; issue.)<br>
&gt;<br>
&gt;<br>
&gt; Thanks for any help on this one.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Arjit Agrawal<br>
&gt;<br>
</span>&gt; _______________________________________________<br>
&gt; keycloak-user mailing list<br>
&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Arjit Agrawal<br>AKGEC, Ghaziabad</div>
</div>