Die BPC Version 4.1 wird nicht mehr gewartet.

Sollten Sie diese BPC Version nutzen, empfehlen wir Ihnen eine Migration auf eine aktuelle Version. Die Dokumentation zur neusten BPC Version finden Sie hier. Sollten Sie Fragen haben, wenden Sie sich bitte an unseren Support.

User Impersonation with Keycloak

This feature allows an authorized user to impersonate another user. This can also be referred to as user hijacking.

Usage

In the BPC user overview, an icon () is available that triggers impersonation. After clicking one of these icons, you are immediately logged in as that user.

impersonate bpc 1

Configuration

To enable impersonation, adjustments must be made in Keycloak and in the BPC.

Keycloak

Enabling the Required Feature

The so-called Token Exchange feature must be enabled when starting Keycloak via Java Opts (-Dkeycloak.profile.feature.token_exchange=enabled); otherwise, you will receive the error "Feature not enabled" when attempting to perform user hijacking (= impersonation).

In the Keycloak archive we’ve provided, this is already configured via a profile.properties file.

Roles

Users who are supposed to be able to perform impersonation must have the special role impersonation.

setup keycloak 1

Enable Impersonation Detection

In order for the BPC to detect that one user is impersonating another, the transmission of this information must be configured on the client using a mapper. To do this, go to the client used by the BPC in Keycloak. At Mappers, these can be added using Add Builtin.

Add mappers

impersonate add mapper

The following mappers must be added:

  • Impersonator Username

  • Impersonator User ID

Once these mappers are set, information about who is impersonating the current user is stored in the user session.

BPC

Clicking the icon in the BPC contacts Keycloak and requests impersonation. Afterward, the BPC must be reloaded. To do this, it is essential that the two core settings in the BPC— Core_BaseURL and Core_ClientPath —are set correctly. These two values are used to generate the URL that the BPC frontend then uses to reload the page.

For example, the BPC can be accessed at the following URL: https://bpc.virtimo.net/dev/support/3.4.x/

In this case, the two settings must be set to the following values:

Setting: Value:

Core_BaseURL

Core_ClientPath

/dev/support/3.4.x/

Roles and Permissions

The user who wishes to perform the impersonation must have either the user role IDENTITY_MANAGER_ADMIN or the permission IDENTITY_MANAGER_USER_IMPERSONATE.


Keywords: