Open jbreton opened 2 years ago
Just to also record my comment in #12515 here:
If my understanding is correct, RFC 6749, section 7.1 Access tokens does specify that other access token types such as Oauth-HTTP-MAC are also permissible. Thus, adding the Bearer
prefix (and thus assuming this is the access token type used) would be incorrect.
Consequently, I would suggest to classify this as not a bug. Open to adding some additional documentation to configuration.accessToken
as mentioned in #12515.
Bug Report Checklist
Description
The OAuth support of api clients for typescript-fetch does not include the "Bearer" prefix.
Base on RFC-6750, the authentication header value should start with "Bearer". If we compare typescript-fetch (OAuth support with basic bearer (lines 170-178) and also other OAuth implementations, the "Bearer" prefix should be added by the API client.
openapi-generator version
Affects 6.0.0 and is present since at least 5.2.1
OpenAPI declaration file content or url
Generation Details
I generated the client using
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i typescript-fetch-oauth.yml -g typescript-fetch -o output
Steps to reproduce
typescript-fetch-oauth.yml
output/apis/PetsApi.ts
The generated code looks like this :
It should look like this :
Suggest a fix