Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-7060

[KSW][OpenAPI] - Use the OpenAPI Security Schema properties when no configuration is defined

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • False
    • None
    • False
    • ---
    • ---

      KOGITO-6970 introduced OAuth2 support that can be configured like:

      quarkus.oidc-client.petstore_auth.auth-server-url=${keycloak.url}
      quarkus.oidc-client.petstore_auth.discovery-enabled=false
      quarkus.oidc-client.petstore_auth.token-path=/tokens
      quarkus.oidc-client.petstore_auth.credentials.secret=secret
      quarkus.oidc-client.petstore_auth.grant.type=password
      quarkus.oidc-client.petstore_auth.grant-options.password.username=alice
      quarkus.oidc-client.petstore_auth.grant-options.password.password=alice
      quarkus.oidc-client.petstore_auth.client-id=petstore-app
      

      The problem is that some of this information is already presented in the Security Scheme structure, for example:

      {
         "securitySchemes":{
            "petstore_auth":{
               "type":"oauth2",
               "flows":{
                  "implicit":{
                     "authorizationUrl":"https://petstore3.swagger.io/oauth/authorize",
                     "scopes":{
                        "write:pets":"modify pets in your account",
                        "read:pets":"read your pets"
                     }
                  }
               }
            }
         }
      }
      

      authorizationUrl and scopes could be injected into the OidcClient used by the Authorization filter if no configuration is presented. Otherwise, the configuration properties must override them.

            wmedvede@redhat.com Walter Medvedeo
            rhn-support-zanini Ricardo Zanini Fernandes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: