-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] bearerAuth security scheme not resulting in access_token being used to create Authorization header. #18041
Comments
Are these included in the schema file? security:
- bearerAuth: []
Probably does not generate # ./api/default_api.py
def _get_building_by_id_serialize(
self,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
...
_auth_settings: List[str] = [
'bearerAuth'
] |
Yes, the scehma includes.
So is the behaviour I'm witnessing expected? How should I use an access_token? Currently the workaround is to set the header manually. |
We are seing this issue as well. As workaround we have to use |
I'm also having the exact same issue. Using openapi-generator version 7.7.0. |
For those finding this issue- a work around in the previously mentioned bug (fixed) still works. Namely setting a default header on the api_client. |
Bug Report Checklist
Description
Having generated a Python client from an OpenAPI spec including the following securityscheme:
It is not possible to use the access_token configuration parameter in the resulting client. Passing it to openapi_client.Configuration on instantiation, or adding it to the instantiated object, does not result in the Authorization header being passed in requests.
openapi-generator version
7.3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Debug output:
Related issues/PRs
Seems related:
#8865
But stated fix of setting saccess_token after instantiation of the configuration class doesn't appear to work. And the issue says it was fixed in v6. Indeed, configuration.py in the generated code does seem to include the requisite fixes:
...
Suggest a fix
I can't seem to trace down the code which is ignoring the auth_settings. There appears to be no other code that references auth['bearerAuth'].
The text was updated successfully, but these errors were encountered: