-
Notifications
You must be signed in to change notification settings - Fork 762
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
3.x authorizations are applied to operation, not client #971
Comments
Yup that solves this issue. It doesn't solve the issue of adding auth to fetching the spec. That's tracked elsewhere. |
Hi, I got here from the FAQs, and it looks like you've changed how authorizations worked. If that is correct, perhaps we should document this. Happy to help, BTW, but perhaps someone with more experience with the project can do it better than I. |
I have a Swagger 2.0 spec with following security definition
But I have a hard time getting the swagger-js 3.0 client to pass the credentials.
Can I even use the swagger-js 3.0 client against a swagger 2.0 spec ? |
Same issue here. I can add whatever I want into 'authorizations', nothing is passed with the request. Is there somewhere a full documentation for swagger-js? Or some examples how to use authorizations? Would be really helpful. |
It's still not clear to me how to add per-request operations. All the examples in the index-authorizations tests seem to be global to the client. |
From the documentation I'm having a pretty tough time understanding how to add the following header to my requests: Any tips? |
I encounter the same issue but i solved it with Swagger(SWAGGER_ENDPOINT,{
authorizations: {
accessTokenAuth: `Bearer ${SWAGGER_TOKEN}`
//accessTokenAuth: {token: {access_token: SWAGGER_TOKEN}}
}
}) and it works but not very clean |
This was an unintended change from the 2.x series for swagger-js, we should be able to authorize a client and have it apply them to operations as needed. Instead, we have to apply them to each operation, every time.
The text was updated successfully, but these errors were encountered: