Flagsmith / Flagsmith/flagsmith

Enable OAuth client credentials grant

Open
#7,153 1 comment 0 reactions 0 assignees View on GitHub
api
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

### Scope

Enable the OAuth 2.0 client credentials grant in django-oauth-toolkit. This is a general M2M capability, not SCIM-specific — any machine client (CI/CD, internal tooling, IdP SCIM clients) benefits from short-lived tokens over static API keys.

- Enable `client-credentials` grant type in `OAUTH2_PROVIDER` settings.
- Add `client_credentials` to `grant_types_supported` in the authorization server metadata endpoint.
- Allow creating OAuth Applications with the `client-credentials` grant type (via Django admin or API).
- Define a `scim` scope in `OAUTH2_PROVIDER["SCOPES"]`.

### Acceptance criteria

- An OAuth Application with `client-credentials` grant type can be created.
- A POST to `/o/token/` with `grant_type=client_credentials`, valid client_id/client_secret, and `scope=scim` returns a short-lived access token.
- The authorization server metadata endpoint lists `client_credentials` in `grant_types_supported`.
- Existing OAuth flows (Authorization Code + PKCE) are unaffected.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.