-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HTTP Basic Auth doesn't work in v2.1.0-M2 #1171
Comments
We just pushed a fix to the develop_2.0 that should help address this. This affects the index.html as well as the library--can you please look at the updates and test the updates? |
The line that's throwing you an error has a typo... |
@ponelat - but that's in our sources ;) https://github.com/swagger-api/swagger-ui/blob/develop_2.0/dist/index.html#L63 |
Apologies, @r-brown I've tested against your spec, it works now :D |
No issues guys - I should be able recognize this on my own :-/ |
keep in mind it's not merged into develop_2.0 yet. and still, if it's a bug, it needs to be handled, so thanks for the report. |
Sure; the change #1240 is trivial and I'll merge this locally before test. Thx! |
I've just updated swagger-ui version at http://io.labs64.com/NetLicensing-API/ to develop_2.0 and tried both
|
Again I must apologize, my previous comment is erroneous! The real fix, which is slightly older than my comment above, explains why it was working on my side. You can return poor little window.swaggerUi.api to his original self and remove the line below. // pre-populate on the page using demo account
$('#input_username').val("demo");
$('#input_password').val("demo");
addAuthorization(); // <--- this evil little bugger! Remove. And if everything is absolutely hunky-dory, I will stop apologizing and fix it! |
I've changed the code as you suggested, but the header still doesn't contain Authorization. |
Hmmm, so you've checked in Chrome(or other browser) and you don't see the request header.. If not, I'm going to take a closer look at your code (if you don't mind) I'd like to put some debug info in.. |
I've checked this with the following browsers:
Sure, feel free to dig into the code; I can also grant access to the repo https://github.com/Labs64/NetLicensing-API if necessary. |
OK looks like a chicken & egg problem. You need to return a 200 for the OPTIONS request when calling your server. That is required for seeing IF it can even send the |
@r-brown did you get a chance to see if you can get a successful(200) response from OPTIONS? Looking to close the issue, but want to make sure all the bugs are fixed :) |
Hi @ponelat, I've just changed Apache HTTPD configuration for CORS preflight requests and... it works http://io.labs64.com/NetLicensing-API/ Used swagger-ui version: 'develop_2.0' (branch) Thank you for your support! |
Hello,
I'm trying to configure Swagger to use default demo account with HTTP Basic Auth.
Below is my index.html configuration:
source: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/index.html
... and JSON definition:
source: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/v2.0/netlicensing.json
With this configuration basicAuth header is not set and I'm always getting browser prompt dialog for credentials entry.
Could you help me with this issue?
Live version can be found here: http://io.labs64.com/NetLicensing-API/
The text was updated successfully, but these errors were encountered: