Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4406
Closed
Open
Issue created Nov 07, 2019 by Administrator@rootContributor

[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'.

Assignee
Assign to
Time tracking