Uploaded image for project: 'Serverless logic'
  1. Serverless logic
  2. SRVLOGIC-526

Authorization token propagation is not working for operations in the root path "/"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 1.35.0
    • Runtimes
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      When we have an OpenAPI  document like this:

       

      /:  <--- root path 
        get:
          operationId: test
          tags:
            - Greeting Resource
          responses:
            "200":
              description: OK
          security:
            - BearerToken: [ ]

       

      that for example is configured this way:

       
       

      quarkus.oidc-client.BearerToken.auth-server-url=http://localhost:8281/auth/realms/kogito/protocol/openid-connect/auth
      quarkus.oidc-client.BearerToken.token-path=http://localhost:8281/auth/realms/kogito/protocol/openid-connect/token
      
      quarkus.oidc-client.BearerToken.discovery-enabled=false
      quarkus.oidc-client.BearerToken.client-id=kogito-app
      quarkus.oidc-client.BearerToken.grant.type=client
      quarkus.oidc-client.BearerToken.credentials.client-secret.method=basic
      quarkus.oidc-client.BearerToken.credentials.client-secret.value=secret
      
      #propagation enabled
      quarkus.openapi-generator.rest_service_yaml.auth.BearerToken.token-propagation=true
      
      #the service url ends with test
      quarkus.rest-client.rest_service_yaml.url=https://localhost:8443/test  

       

      That bearer token propagation is not produced, because the openapi operationId test, is declared for the root path.

      This is the bug.

       

      NOTE:

      we have the following valid workaround, by doing the following translation:

       

      # Remove the path test from the property configuration
      quarkus.rest-client.rest_service_yaml.url=https://localhost:8443

       

      /test:  <--- give the operation the path test
        get:
          operationId: test
          tags:
            - Greeting Resource
          responses:
            "200":
              description: OK
          security:
            - BearerToken: [ ]

       

      With this small translation the propagation works fine.

       

       

              rhn-support-zanini Ricardo Zanini
              wmedvede@redhat.com Walter Medvedeo
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: