The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic auth failing
2017-07-12, 08:14
Post: #1
Basic auth failing
Hello,

I've been trying to download a file from a server. My code is working fine as long as I do not request for an authentication. However, that is not what I want.

I use this code to download the file (using a restful API):
Code:
chain http://${username:uristring}:${password:uristring}@10.1.2.220:8080/ufws/users/${username:uristring}
I read somewhere that when using basic auth, iPXE first try to download the file without using the credentials, but if the server return a 401 error code, then iPXE try to download it using them. After many tests and checking the logs, I came to the conclusion that it was not working this way (at least in my case). iPXE only tries to download the file once and it does not use the credentials I give to it.

To make sure of that, I did a test on another apache server on which I put this code:
Code:
<?php
http_response_code(401);
?>
When doing a chain request on it (using credentials), this is what I have in the logs:
Code:
10.0.0.104 - - [12/Jul/2017:09:06:23 +0200] "GET /test.php HTTP/1.1" 401 - "-" "iPXE/1.0.0+ (dc795b9f)"
As you can see, it only tries once. There is only one request.

So I thought it was coming form the version of iPXE I was using. But I've tried with four different versions (the oldest one being from 2015 and the more recent one being the latest on git) and it is always the same.

I've tried mainly on qemu by using this command:
Code:
qemu-kvm -m 1024 ipxe.iso
I have also done some tests on VirtualBox.

I do not have anymore idea. Can someone helps me on this, please?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Basic auth failing - tim - 2017-07-12 08:14
RE: Basic auth failing - NiKiZe - 2017-07-12, 17:39
RE: Basic auth failing - tim - 2017-07-13, 14:58
RE: Basic auth failing - NiKiZe - 2017-07-13, 17:11



User(s) browsing this thread: 1 Guest(s)