-
-
Notifications
You must be signed in to change notification settings - Fork 523
Unable to generate header in api call when using @RequestHeader #425
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
Comments
Hi @Andrew3431, Your question is already answered here: Use @securityrequirement and respect the OpenAPI specification syntax, and it should work. Next time, please have a look at our contribution guide, on the following section: Using GitHub Issues. Because this kind of questions should go to stackoverflow: We use GitHub issues to track bugs and enhancements. If you have a general usage question please ask on Stack Overflow. |
@bnasslahsen I am able to pass the authorization header value through the Authorize button on the top right corner of the swagger UI (I use that for all my other apis which I need to be protected with a security header). My question was, is there a way to send authorization header through the The header value does get passed through if sent using the Authorize button but not when sent in @parameter tag. |
The behaviour you are describing is not related to springdoc-openapi. But to swagger-ui: The specification does not allow explicitly adding Authorization header. For more information, please read: |
Thank you @bnasslahsen |
I need to allow the user to enter the bearer token in the parameter section which will be sent in header when the call is made
json value is
The access token value entered in Parameter , is not getting sent to Header as "Authorization". The curl command created by swagger is
curl -X GET "http://localhost:8080/openid/userdata" -H "accept: application/json"
I want the curl command to generated as
curl -X GET "http://localhost:8080/oidc/userinfo" -H "Authorization: Bearer XXX" "accept: application/json"
whereBearer XXX
is the value entered in Parameter. Is it possible to achieve this without sending the access token via security requirement ?The text was updated successfully, but these errors were encountered: