Skip to content

Enable OAuth client credentials grant #7153

@khvn26

Description

@khvn26

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiIssue related to the REST API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions