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.
Comment | File | Size | Author |
---|---|---|---|
#2 | keycloak--improve-extendability--3236844-2.patch | 1.02 KB | esolitos |
Comments
Comment #2
esolitosAttached a patch which takes care of the simplest solution.
Comment #3
joseph.olstadthanks for the patch
Comment #5
joseph.olstadComment #6
joseph.olstadthere are others like this if you want to do those also that'd be great.