[REQ] [typescript-angular]: Support securityScheme type 'openIdConnect' like type 'oauth2' is already supported
Created by: aanno2
Is your feature request related to a problem? Please describe.
Support securityScheme type 'openIdConnect' like type 'oauth2' is already supported.
If your securitrySchemes
includes something like:
"securitySchemes": {
"oAuth2Flows": {
"type": "oauth2",
"flows": {
"implicit": {
"authorizationUrl": "${KEYCLOAK_BASE_URL}/auth/realms/zap/protocol/openid-connect/auth",
"scopes": {
"openid": "description"
}
}
}
}
openapi-generator
emits the following inside API calls:
// authentication (oAuth2Flows) required
if (this.configuration.accessToken) {
const accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
This is all right, as the client needs to send the (OAuth2) bearer token to the server.
However, for the type 'openIdConnect', the code is not generated.
"securitySchemes": {
"kcqs": {
"type": "openIdConnect",
"openIdConnectUrl": "\${KEYCLOAK_BASE_URL}/auth/realms/zap/.well-known/openid-configuration"
}
}
Result:
// authentication (kcqs) required
// nothing follows
Describe the solution you'd like
The very same code must be generated for type 'openIdConnect' and type 'oauth2'.