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

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

Open
ricardozanini opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
area:client This item is related to the client extension

Comments

@ricardozanini
Copy link
Member

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.

@ricardozanini ricardozanini added the area:client This item is related to the client extension label Feb 7, 2025
@ricardozanini ricardozanini self-assigned this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client This item is related to the client extension
Projects
None yet
Development

No branches or pull requests

1 participant