-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[javascript, typescript-node] HTTP / Bearer Scheme does not generate clients that use Bearer Tokens #1133
Comments
Not sure that any clients support it. Looking at https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L3034-L3087 there does not seem to be any |
Same issue for typescript-axios |
May I know if anyone has time to add the bearer support? or sponsor the fix via BountySource similar to these bounties? |
UPDATE: #1470 includes the enhancement: https://github.com/OpenAPITools/openapi-generator/pull/1470/files#diff-d7978f0dcc3f8a06f35df3b87c156d4dR33 |
[Update: Just realized #1470 is already merged] I should be able to update the JS/TS clients. I need it fixed in |
Working on this at https://github.com/mrvdot/openapi-generator/tree/enable-bearer-auth-js-ts. This is my first change for the generator, so any comments/critiques are welcome.
|
Any news on this? |
@Gabrn typescript-axios and typescript-fetch are done, and you're welcome to build from the repo mentioned above if you need those now. I probably won't have time for the others until this weekend |
Just found this issue because the Go / Golang client has the same issue. When specifying a bearer token, basicAuth is implemented. Of note, in addition to taking an access token, it would be nice to take a refresh token as well so the client can refresh the token itself. This is something Go can do as I'm passing in a custom Go |
Hello! do you have any updates on this? |
implemented for typescript-node in #4633 |
I just tested bearer token in our Project and it works. I think it was implemented for this issue: OpenAPITools#1133 They did not mention typescript-angular specificly, so maybe i am wrong
@wing328 can be closed i think :) |
Description
Setting up an API that uses a bearer token should result in clients that send the
Bearer XXXX
value in the Authorization header. However thejavascript
andtypescript-node
clients generate code that wants to send a username/password combination in the header.openapi-generator version
3.2.3
OpenAPI declaration file content or url
Full sample: https://gist.github.com/johnkoerner/952becd82bbb238b51907791d0a13d32
Command line used for generation
Steps to reproduce
Generate a typescript-node or javascript client that uses authentication with the
bearer
scheme.Suggest a fix/enhancement
When the
bearer
scheme is specified, then theAuthorization
header should be specified with theBearer {accessToken}
format. It appears that the OAuth2 flow already supports theBearer
token format.Note: I only tested with
javascript
andtypescript-node
other client generators may have similar issues.The text was updated successfully, but these errors were encountered: