Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPxe, http, basic auth and login command in embed script and in menu script
2019-05-15, 11:40
Post: #1
iPxe, http, basic auth and login command in embed script and in menu script
I have the latest git veriosn of iPXE compiled from sources by myself.
There is login commands in 2 places - in embed script:
Code:
#!ipxe

ifconf || reboot
login || reboot
chain http://${username:uristring}:${password:uristring}@fqdn/folder/menu.ipxe

which is compiled in during make step, for example make bin/undionly.kpxe EMBED=script.ipxe

and in menu itself:
Code:
login
kernel http://${username:uristring}:${password:uristring}@fqdn/folder/folder1/wimboot
initrd http://${username:uristring}:${password:uristring}@fqdn/folder/folder1/BCD  BCD
.....

But 1 during first login command empty username and password is sent to Web server.
As following, Permission is denied.
I saw at its logs.
During second login is ok.
But if is to remove login command from embed script and specify exact user/password at http string all is ok.
That is:
Code:
#!ipxe

imgfree
ifconf || reboot
chain http://rightuser:rightpass@fqdn/folder/menu.ipxe

After that, login in menu works fine.

Is it right functioing by design ?
Find all posts by this user
Quote this message in a reply
2019-05-15, 20:59
Post: #2
RE: iPxe, http, basic auth and login command in embed script and in menu script
Test with the same command in both cases
and try with
echo ${username:uristring}
etc
to see that you have the exact same thing.

you might also want to read the git commit history, there might be some gotchas in the iPXE auth client code

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-05-16, 11:29
Post: #3
RE: iPxe, http, basic auth and login command in embed script and in menu script
(2019-05-15 20:59)NiKiZe Wrote:  Test with the same command in both cases
and try with
echo ${username:uristring}
etc
to see that you have the exact same thing.

you might also want to read the git commit history, there might be some gotchas in the iPXE auth client code

You mean after login ?
And test to write in cli or via embed script ?
Find all posts by this user
Quote this message in a reply
2019-05-16, 15:23 (This post was last modified: 2019-05-16 16:31 by cpservicespb.)
Post: #4
RE: iPxe, http, basic auth and login command in embed script and in menu script
The working solution for me is:
${username}
and
${password}
not
${username:uristring}
and
${password:uristring}
Find all posts by this user
Quote this message in a reply
2019-05-16, 17:19
Post: #5
RE: iPxe, http, basic auth and login command in embed script and in menu script
Good, so the important thing is to use the same dataset when doing debugging, printing ${username} and then expecting ${username:uristring} to have data, without checking username:uristring instead.

Which version of iPXE are you using, maybe it is an old build without uristring support.
Or it is something special with that, so copying it to a real string, could give different data:
set lusername ${username}
echo ${lusername:uristring}

but also try to create another string with data and try uristring on that.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-05-16, 18:00 (This post was last modified: 2019-05-16 22:27 by cpservicespb.)
Post: #6
RE: iPxe, http, basic auth and login command in embed script and in menu script
I use git version from May, 13, 2019 compiled by myself.
Invoking of
Code:
set lusername ${username}
echo ${lusername:uristring}
after
Code:
login
gives right result.

So strange, I rebuilt mentioned above version frpm scratch and all began to work.

So, this issue is solved.
Find all posts by this user
Quote this message in a reply
Post Reply 




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