Using User Tokens
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3186587. -->
Reported by: [dmlb2000](https://www.drupal.org/user/3618282)
Related to !7 !8
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When coupling Drupal user accounts with Gitlab user accounts using OAuth2 (openid_connect) Drupal can hold authentication tokens per user. The API should be able to optionally use user specific tokens to authenticate against Gitlab.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Install Drupal with OpenID Connect.</li>
<li>Configure Drupal to authenticate users using Gitlab.</li>
<li>Create a field to hold the Gitlab user token.</li>
<li>Create a oidc token hook to save the Gitlab token to the field.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Fix constructor to the API to allow for an optional argument that is passed straight through to the authenticate client method.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>N/A</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>Token should be optional as part of the Settings form.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>N/A</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>N/A</p>
issue