-
Notifications
You must be signed in to change notification settings - Fork 144
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
While doing POST and if APIKey Authentication is used, tastypie gives 401 unauthorized always #16
Comments
I have fixed this issue with a quick fix in Swagger-ui.js, though I am not sure if this is the right way to go. |
This fix works well. For tastypie it will be better to make a username input field instead of merging parameters in the same field |
Mmm I think this is more a swagger-ui issue, they should allow for more flexibility. |
@johnraz what version of swagger UI are you guys on? |
@fehguy : I think it's 1.1 but I cannot find any reference to the version anywhere in our js files :( |
@johnraz I'd suggest pulling the dist folder from master, which is v2.0.9. There are big differences in header support and auth in general in the 2.0.x version of swagger-ui, and I'd start with that before we look into any of the auth issues that you're having. You can now add multiple headers or query params as follows: window.authorizations.add("key", new ApiKeyAuthorization("Authorization", "XXXX", "header")); Which is documented here: |
@fehguy : Thanks for the head up, this is exactly what I was after. We should be able to implement the header as explained in the tastypie doc without any troubles. |
Great, please open an issue in swagger UI if you have trouble. Note that there are changes in the 1.2 specification but the UI is back compatible to 1.1 |
Swagger encodes the values of '&' and all other special characters passed in special-key area due to which tastypie understands only api_key parameter.
The text was updated successfully, but these errors were encountered: