OpenAPITools / OpenAPITools/openapi-generator

[Bug][Python] oauth

Open
#3,768 20 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Python Enhancement: Feature Hacktoberfest help wanted
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

I generated Python client from our valid OpenAPI Spec. But the OAuth2 code is incomplete (in my understanding)

The Getting Started section in the generated client looks like this

openapi-generator version

Latest release (commit d0d545bbdd409a177befa12cff809607751941f2) with the help of docker

OpenAPI declaration file content or url

OpenAPI Gist

Command line used for generation

./run-in-docker.sh generate -i ./clientapi-v3-openapi-spec.json -g python -o ./out/python-client

Steps to reproduce

Following the instructions here: https://github.com/OpenAPITools/openapi-generator#16---docker

Related issues/PRs

#776 for Java but same intention
Similar Issue in C-Sharp: #3714
Maybe: #2411

Suggest a fix/enhancement

Option 1:
I would find something like this helpful.

config=openapi_client.Configuration()
config.oauth.client.id= client_id
config.oauth.client.secret= client_secret
config.oauth.client.user= user
...

Option 2:
If it is required to write my own layer to handle/generate the oauth2 token I would appreciate if the documentation and the generated readme would point me to this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked OpenAPI declaration and the generated Python client from the documented Docker command, then compare its OAuth2 code and Getting Started README with the supplied gist. Review related issues #776, #3714, and #2411 before defining whether the completed work should add OAuth2 handling, improve configuration, or document the required custom layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.