[keycloak-dev] getAuthorizationContext from RefreshableKeycloakSecurityContext with Spring Security

Pedro Igor psilva at redhat.com
Tue Nov 22 06:49:02 EST 2016


Hey Ignacio,

It is more related with KEYCLOAK-3662 [https://issues.jboss.org/browse/KEYCLOAK-3662]. I think we don't have authz integrated with Spring adapters, yet. Will talk with Sebastien.

That should explain why you are not getting that instance.

Regards.
Pedro Igor
On 11/21/2016 9:04:00 PM, Ignacio Ocampo <nafiux at gmail.com> wrote:
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 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
_______________________________________________
keycloak-dev mailing list
keycloak-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-dev


More information about the keycloak-dev mailing list