Jump to content

Sending Headers To Authenticate


elite_prodigy

Recommended Posts

Okay, first a touch of a back-story:

 

Our DNS crashed recently because it's overladden with 96,000+ zones. We are only using around 45,000, maybe a little less. Which means that accounts have not been properly terminated over time and DNS zones have piled up. So, I got the lovely task of sorting through the zones and figuring out which ones are still being used by an account, and which ones need deleting.

 

It took me about a day to finally stumble upon a way to get every single domain WHM is managing without having to parse through BIND zone files, which would have been awful.

 

So, now I have the method, but it requires me to authenticate first. So, if any of you have ever used cPanel or WHM (not exactly the greatest, but they are a convenience) then you know that when you try navigate to WHM you get a box that pops up and asks for your user name and password.

 

This login box is generated by the header() function which send an "Authentication Required" message to the browser or whatever it does.

 

So, how do I build an HTTP(S) query with the authentication headers built in. I feel like I should know this, but I don't.

 

I'm not necessarily asking about how to authenticate to cPanel or WHM themselves, but how to build an HTTP(S) query that includes the headers and their values that I need to send.

 

I'm at a loss at the moment and could really use everyone's help here, you guys and gals are awesome here.

 

Infinite thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/153610-sending-headers-to-authenticate/
Share on other sites

I never try that but it seem that cUrl support both http authentification and HTTPS ssl support :

 

http://www.jellyandcustard.com/2006/01/02/php-curl-http-put-ssl-and-basic-authentication/

 

http://www.php.net/manual/en/ref.curl.php

 

And it will be able to do what you want without knowing exactly the http header needed for that...hope is that what you are looking for.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.