[keycloak-user] Spring boot and spring security adapters

Sebastien Blanc sblanc at redhat.com
Wed Dec 7 09:58:18 EST 2016


If you add this in your SecurityConfig :

@Bean
 public KeycloakConfigResolver KeycloakConfigResolver(){
    return new KeycloakSpringBootConfigResolver();
 }

You should be able to use the springboot adpater and spring security
adapters at the same time and use application.properties to define your
keycloak configurations properties (and you don;t need a keycloak.json
anymore) .



On Mon, Dec 5, 2016 at 2:37 PM, Brian Schwartz <schwartzbj17 at gmail.com>
wrote:

> Not if you're also using spring security adapter.  I figured out my
> issue.  Can't use spring boot adapter and spring security adapter
> together.  Removed spring boot adapter and added keycloak.json file
> location property to the application.properties file.  Now it works.
>
> Thanks all.
>
> On Dec 5, 2016 7:25 AM, "Sebastien Blanc" <sblanc at redhat.com> wrote:
>
>> For Spring Boot you can directly write the keycloak config in the
>> application.properties file, look at the documentation :
>> https://keycloak.gitbooks.io/securing-client-applications-gu
>> ide/content/topics/oidc/java/spring-boot-adapter.html
>>
>>
>>
>> On Fri, Dec 2, 2016 at 9:09 PM, Brian Schwartz <schwartzbj17 at gmail.com>
>> wrote:
>>
>>> I'm using keycloak 2.3.0.final spring boot and spring security adapters.
>>> The spring security adapter requires a keycloak.json file to be in
>>> web-inf
>>> but i don't have that or web.xml.  How do I change where the keycloak
>>> adapter looks for keycloak.json?
>>> _______________________________________________
>>> keycloak-user mailing list
>>> keycloak-user at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>>
>>
>>


More information about the keycloak-user mailing list