Add label field to OAuthClient entity
Overview
We came across a use-case for multiple OAuthClient entites with the same Client ID, which makes differentiating them difficult in the UI. We'd like to propose adding a field for an administrative label to the OAuthClient entity and defining it as the label_field
. It might also be a good idea to make labels required.
Proposed behaviour
We're currently building an API extension for synchronizing data from another CRM-like system that requires authorization via OAuth and differentiates multiple instances/sources by using different access tokens for the same client ID/secret.
Our sync API uses configurable profiles which have the OAuth client as a configuration option, so there's a field for selecting an OAuth client in the UI. The only attribute for differentiating OAuth clients in that field is their internal (CiviCRM) ID, as Client ID and secret are the same and the access token should not be exposed and might change. This is not convenient for admins, as they will have to remember which (internal) OAuth client ID corresponds to which instance, which is likely to cause misconfigurations and errors.
I guess this will need:
- the XML schema of the
OAuthClient
entity be extended with alabel
field civix generate:entity-boilerplate
- Upgrade script for applying schema changes - thanks @eileen!
- anything else?
Happy to hear your thoughts!