豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
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