Skip to content

Additional OAuth2 parameters in YAML #7216

Open
@nd1012

Description

@nd1012
  • Swagger-UI version: 3.47.1
  • OpenAPI version: 3.0.0

Content & configuration

Swagger/OpenAPI definition:

components:
  securitySchemes:
    OAuth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://uri.tld
          authConfigs:
            app: "abc"

Swagger-UI configuration options:

      const ui = SwaggerUIBundle({
        url: "https://uri.tld",
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout"
      });

How can we help?

I saw it's possible to initialize OAuth2 with a JavaScript method, that allows defining additional OAuth2 query parameters. Is it possible to define additional OAuth2 query parameters in the YAML/JSON configuration file, too? Above you can see what I tried - I also try the key additionalQueryStringParams without success.

In addition, client_id and client_secret that I entered in the Swagger UI authorization dialog are being sent to the server as basic authorization header - but POST parameters are expected. The server receives only the POST parameter grant_type with the value client_credentials (which is correct so far). Did I do anything wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions