[keycloak-user] Help with keycloak integration with Spring boot rest api

Anunay Sinha anunay.sinha at arvindinternet.com
Tue Sep 8 06:35:39 EDT 2015

Hi Everyone,
I am new to both spring and keycloak and I do admit that am writing this
before exhausting all my options, but I have spent quite a good amount of
time on this.

So here is my deal.
I have created a spring boot rest api and have tested it.
Next I was trying to integrate it with keyCloak
  I modified my gradle for keycloak
  I configured a client in KeyCloak admin console. It  was bearer only.

  "realm": "TestMyAccount",
  "bearer-only": true,
  "auth-server-url": "",
  "ssl-required": "none",
  "resource": "AIL_MYACCOUNT"

Next I added the following items to my application.properties

keycloak.realm = TestMyAccount
keycloak.realmKey =
keycloak.auth-server-url =
keycloak.ssl-required = external
keycloak.resource = AIL_MYACCOUNT
use-resource-role-mappings = false
ssl-not-required = true
bearer-only = true

This is as per the documentation

I don't have a web.xml in my project and going as per the video tutorial I
ignored those settings.

My access to api was restricted and it is asking me for the authorization.
But am not able to provide it. As per the example in the document, it seems
like bearer only application work on tokens only.
Here is my first question.
Is there a way to generate the tokens for bearers only applications

To get the token I created another client, this time "confidential"
redirecting to same base URI and used it to generate the access token

When am using this access token to access my API am still getting the 401

Am not sure what am doing wrong and where am doing wrong.

Request you to please help me with this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20150908/0503b48f/attachment.html 

More information about the keycloak-user mailing list