openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

Oauth support seems broken

Open bgirschig opened this issue 9 months ago • 0 comments

Describe the bug I am trying to generate a client for an API with an clientCredentials oauth flow, but the generated client doesn't seem to manage the authentication at all: Searching the client's folder for the keyword oauth yields no results.

I can make it work by generating a token myself and using it in AuthenticatedClient, but I would expect the generated client to be able to handle that.

Is openapi-python-client supposed to generate a client that handles a clientCredentials oauth flow ?

OpenAPI Spec File

openapi: 3.0.3
info:
  title: Test API
  version: v1
paths:
  /test:
    get:
      security:
        - oauth2: []
      responses:
        '200':
          description: ""

components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          refreshUrl: https://whatever.com/oauth/token/
          tokenUrl: https://whatever.com/oauth/token/
          scopes: {}

Desktop:

  • OS: Ubuntu 22.04.5
  • Python Version: 3.12.7
  • openapi-python-client version: 0.24.2

bgirschig avatar Mar 26 '25 10:03 bgirschig