Implement OAuth2 authentication for API endpoints related to code components

Created on 20 May 2025, 2 months ago

Overview

HTTP requests from our CLI tool need to be authenticated at our API endpoints.

β†’ See: 🌱 [Meta] CLI tool for code components Active

Proposed resolution

Create a new submodule for authenticating HTTP requests at our API endpoints using OAuth2. Rely on Simple OAuth 6.0.x β†’ as a dependency.

Authentication provider

Implement our own authentication provider service by extending \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider, or if we could simply rely on `SimpleOauthAuthenticationProvider`.

Scopes

Use the simple_oauth_static_scope module (also see simple_oauth_static_scope_example), and define the following OAuth scopes:

xb:javascript-components:read
xb:javascript-components:write
xb:asset-library:read
xb:asset-library:write

Enable them for the client credentials grant type, and associate with the administer code components permission.

Documentation

Write simple documentation for setting up an OAuth2 consumer (/admin/config/services/consumer) to work with our authenticated endpoints.

✨ Feature request
Status

Active

Version

0.0

Component

CLI Tool

Created by

πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024