Problem/Motivation

Currently it is quite hard extending the Drupal\keycloak\Plugin\OpenIDConnectClient\Keycloak plugin because it relies on the KeycloakService and the service has hardcoded the openid_connect.settings.keycloak configuration name in its constructor.

Decorating the service does not help because the $config it set in the constructor, so the obvious option is to extend the KeycloakService class, but that requires to override the __construct() method, which means that any changes from the Keycloak module will need to be cloned to the extending class, increasing the maintenance burden.

Proposed resolution

there are many solutions, some complex some less. The simplest solution would be to store the configuration name in a CONST, so that the extending class simply needs to override this constant.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

esolitos created an issue. See original summary.

esolitos’s picture

Assigned: esolitos » Unassigned
FileSize
1.02 KB

Attached a patch which takes care of the simplest solution.

joseph.olstad’s picture

thanks for the patch

joseph.olstad’s picture

Status: Active » Fixed
joseph.olstad’s picture

there are others like this if you want to do those also that'd be great.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.