[keycloak-user] Fwd: NOT_ATTEMPTED: bearer only error while trying to access server from client

Stian Thorgersen sthorger at redhat.com
Thu Sep 29 05:26:46 EDT 2016


The message NOT_ATTEMPTED is displayed when the bearer token is missing. So
the server doesn't see the "Authorization: bearer ..." header. You'll need
to check if that header is actually sent to the server.

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.

On 28 September 2016 at 08:58, Ganga Lakshmanasamy <lganga14 at gmail.com>
wrote:

> Yes our rest service is using keycloak adapter. How to check if it is a
> CORS issue. Is there a way?
>
> On Sep 28, 2016 12:17 PM, "Stian Thorgersen" <sthorger at redhat.com> wrote:
>
>> Maybe it's a CORS issue? If it works from rest clients, but not from JS
>> that could make sense.
>>
>> On 28 September 2016 at 08:47, Stian Thorgersen <sthorger at redhat.com>
>> wrote:
>>
>>> I'd try to debug the issue on the rest service side. What is in
>>> implemented in? Is it using a Keycloak adapter?
>>>
>>> On 26 September 2016 at 09:06, Ganga Lakshmanasamy <lganga14 at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> 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.
>>>>
>>>> Regards,
>>>> Ganga Lakshmanasamy
>>>>
>>>> On Mon, Sep 26, 2016 at 12:07 PM, Stian Thorgersen <sthorger at redhat.com
>>>> > wrote:
>>>>
>>>>> How are you getting the token in the angular js based client? Are you
>>>>> using keycloak.js?
>>>>>
>>>>> You can try to verify the token at jwt.io to check if it's valid.
>>>>>
>>>>> On 26 September 2016 at 06:28, Ganga Lakshmanasamy <lganga14 at gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> We are getting the "NOT_ATTEMPTED: bearer only" error while trying to
>>>>>> access our backend rest service which has access type as bearer only from
>>>>>> our public angular js based client.
>>>>>> We are setting the "Authorization" header in our request but looks
>>>>>> like the adapter is not able to recognize the header with the bearer token.
>>>>>>
>>>>>> Please help us resolving the issue. We have validated the client
>>>>>> settings and the configs seems to be proper.
>>>>>>
>>>>>> *Note*: 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.
>>>>>>
>>>>>> Regards,
>>>>>> Ganga Lakshmanasamy
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> keycloak-user mailing list
>>>>>> keycloak-user at lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160929/31976ca2/attachment.html 


More information about the keycloak-user mailing list