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

While doing POST and if APIKey Authentication is used, tastypie gives 401 unauthorized always #16

Closed
ajinkyagadewar opened this issue Jan 15, 2013 · 8 comments
Labels

Comments

@ajinkyagadewar
Copy link

Swagger encodes the values of '&' and all other special characters passed in special-key area due to which tastypie understands only api_key parameter.

@ajinkyagadewar
Copy link
Author

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.
invocationUrl = decodeURIComponent(invocationUrl);

@Seraf
Copy link

Seraf commented Dec 5, 2013

This fix works well. For tastypie it will be better to make a username input field instead of merging parameters in the same field

@johnraz
Copy link
Contributor

johnraz commented Feb 16, 2014

Mmm I think this is more a swagger-ui issue, they should allow for more flexibility.
@fehguy : Do you have any idea about this ?

@fehguy
Copy link

fehguy commented Feb 16, 2014

@johnraz what version of swagger UI are you guys on?

@johnraz
Copy link
Contributor

johnraz commented Feb 16, 2014

@fehguy : I think it's 1.1 but I cannot find any reference to the version anywhere in our js files :(
We plan to move to the latest version in the near future anyway - what are our option with the latest ?

@fehguy
Copy link

fehguy commented Feb 16, 2014

@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:

https://github.com/wordnik/swagger-ui#header-parameters

@johnraz
Copy link
Contributor

johnraz commented Feb 16, 2014

@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.
Closing this as it will be fixed by #36 when ready

@johnraz johnraz closed this as completed Feb 16, 2014
@fehguy
Copy link

fehguy commented Feb 16, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants