Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paw-OpenAPI3Importer doesn't set "Grant Type" in Auth -> OAuth2 properly, when importing an endpoint with a security definition. #14

Open
paw-eloquent-safe opened this issue Jun 9, 2022 · 1 comment
Assignees

Comments

@paw-eloquent-safe
Copy link

Imagine we have the following OpenAPI definition:

{
    "openapi": "3.0.1",
    "info": {
      "title": "Example Api",
      "version": "v1"
    },
    "servers": [
      {
        "url": "https://example.org/",
        "description": "Example Server"
      }
    ],
    "paths": {
      "/users/register": {
        "post": {
          "tags": [
            "Users"
          ],
          "security": [
            {
              "oauth2-client-flow": []
            }
          ],
          "requestBody": {
            "content": {
                ...
            }
          },
          "responses": {
            "200": {
              "description": "Success"
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
          ...
        },
      "securitySchemes": {
        "oauth2-client-flow": {
          "type": "oauth2",
          "flows": {
            "clientCredentials": {
              "tokenUrl": "https://example.org/auth/connect/token",
              "scopes": {}
            }
          }
        }
      }
    },
    "security": [
      {
        "oauth2-client-flow": []
      }
    ]
  }

Then when importing this I expect the "Grant Type" in Auth -> OAuth2 for /users/register to be set to "Client Credentials" with the "Acces Token URL" to be filled.

Instead it looks like this:
Screenshot 2022-06-09 at 12 04 58
While I expected this:
Screenshot 2022-06-09 at 12 09 10

Same story goes for all of the other flows. (I think, didn't test it, tho)

@pongstr
Copy link

pongstr commented Jun 28, 2022

hey @k-visscher thanks for reporting this, I looked around and couldn't find an API that can programmatically set the Grant-Type according to the schema. I'll ask around within the Team and see if they can point me to the right direction.

@pongstr pongstr self-assigned this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants