Bug Report Checklist
Description
Relevant code is here.
When handling auth methods, the Typescript/Angular generator implements a method call to add the authorization token to the request headers or query. It does this for the api_key, http, or oauth2 security scheme types, but does nothing for the openIdConnect type, resulting in a comment in the generated code indicating the need for authorization, but no actual implementation. The resulting generated services fail authorization as a result.
openapi-generator version
7.12.0
(issue confirmed in source for 4cffd32f87224e54a60813e1fc9da73788977e54)
Steps to reproduce
Run typescript/angular generator for any OpenAPI file with an operation implementing a security scheme of type openIdConnect.
Suggest a fix
The issue is visible in source and the fix should be simple, which is why I have not bothered to create a sample spec. To resolve this, the OIDC case should add a bearer token in the authorization header by the same approach as the OAuth2 case. For observability, it may also be worth issuing a warning in the event that the auth method is present but none of these type-specific cases are triggered (helpful in the event that the spec is extended for other security scheme types, resulting in a similar issue to this one).
As a workaround in the interim, OpenAPI docs can be modified to document the security scheme as OAuth2 rather than OIDC, at least for purposes of code generation.
Bug Report Checklist
Description
Relevant code is here.
When handling auth methods, the Typescript/Angular generator implements a method call to add the authorization token to the request headers or query. It does this for the
api_key,http, oroauth2security scheme types, but does nothing for theopenIdConnecttype, resulting in a comment in the generated code indicating the need for authorization, but no actual implementation. The resulting generated services fail authorization as a result.openapi-generator version
7.12.0
(issue confirmed in source for 4cffd32f87224e54a60813e1fc9da73788977e54)
Steps to reproduce
Run typescript/angular generator for any OpenAPI file with an operation implementing a security scheme of type
openIdConnect.Suggest a fix
The issue is visible in source and the fix should be simple, which is why I have not bothered to create a sample spec. To resolve this, the OIDC case should add a bearer token in the authorization header by the same approach as the OAuth2 case. For observability, it may also be worth issuing a warning in the event that the auth method is present but none of these type-specific cases are triggered (helpful in the event that the spec is extended for other security scheme types, resulting in a similar issue to this one).
As a workaround in the interim, OpenAPI docs can be modified to document the security scheme as OAuth2 rather than OIDC, at least for purposes of code generation.