How to enable Direct Naked Impersonation in last version 26.5.6

Hi everyone,

I am trying to use the Direct Naked Impersonation feature in Keycloak version 26.5.6, but I am running into some issues and I’m not able to follow the steps described in the official documentation.

In particular, starting from the basics, I cannot find the “Permissions” tab under the Users section, which seems to be required to configure impersonation permissions as described.

I have already enabled the following features in my configuration:

  • token-exchange

  • admin-fine-grained-authz

However, when I try to proceed (for example enabling management permissions via the Admin API), I receive errors such as “Feature not enabled”.

It looks like either the feature is not fully available or the documentation does not match the behavior of this Keycloak version.

Am I missing any configuration step, or is Direct Naked Impersonation (token exchange without subject_token) not fully supported in Keycloak 26.5.6?

My use case is the following: I will receive a user’s username in a server-to-server flow, and I need to determine whether that user is authorized for the requested resource within the application. To do this, I need to impersonate the user, obtain an access token, and call the authorization endpoint for the resource

Thanks in advance for your help!

Is there anyone on this forum?

Hey, what do you see on this page ?

That should tell you, if your needed feature is on.

I doubt that you can exchange tokens, without a subject_token. You can check on the Keycloak Code itself, what the expected/needed parameters are.

Just as a reminder:

Direct naked impersonation is currently only possible with Token Exchange v1, which has been officially deprecated since 26.6 and will be removed from Keycloak in future.
If Token Exchange v2 will support DNI is currently not known.

So, you should really overthink your requirements and approaches and propably not start with DNI on an deprecated feature. Besides that, Direct Naked Impersonation is highly risky!

That’s exacly what Direct Naked Impersonation is here for, see also https://www.keycloak.org/securing-apps/token-exchange#_direct_naked_impersonation