[keycloak-dev] getAuthorizationContext from RefreshableKeycloakSecurityContext with Spring Security

Ignacio Ocampo nafiux at gmail.com
Mon Nov 21 18:01:46 EST 2016


I've a question, is this issue related?
https://issues.jboss.org/browse/KEYCLOAK-3796

On Mon, Nov 21, 2016 at 11:43 AM, Ignacio Ocampo <nafiux at gmail.com> wrote:

> Hello Team,
>
> I've an Spring Boot application with Spring Security Core, everything is
> working fine in terms of authentication.
>
> The next step is to setup the authorization with "Authorization enabled"
> in the Client.
>
> I've a problem trying to obtain the authorizationContext from
> RefreshableKeycloakSecurityContext
>
> KeycloakSecurityContext keycloakSecurityContext =
> (KeycloakSecurityContext) request.getAttribute(
> KeycloakSecurityContext.class.getName());
>
>> org.keycloak.adapters.RefreshableKeycloakSecurityContext at 69d7e12b
>>
>
> AuthorizationContext authzContext = keycloakSecurityContext.
> getAuthorizationContext();
>
>> null
>>
> Could you please help me to understand how I can get the authorization
> context?
>
> In my keycloak.json I have:
>
> {
>>   "realm": "MyRealName",
>>   "auth-server-url": "http://myendpoint/auth",
>>   "ssl-required": "none",
>>   "resource": "serviceName",
>>   "credentials": {
>>     "secret": "XXX-XXX-XXX"
>>   },
>>   "policy-enforcer": {
>>   "enforcement-mode" : "ENFORCING"
>>   }
>> }
>
>
> Thanks
>
> Regards.
>
> --
> Ignacio Ocampo Millán
>



-- 
Ignacio Ocampo Millán


More information about the keycloak-dev mailing list