The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Authorization: WHM not working correctly

Discussion in 'cPanel Developers' started by FrankLaszlo, Jan 28, 2011.

  1. FrankLaszlo

    FrankLaszlo Active Member

    Joined:
    Dec 19, 2008
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    I cant see to get this to work. I am trying to create an autologin script for our support staff so we do not need to give them root passwords or accounts on all of the servers. Heres the code I am using:

    Code:
    
    $r = mysql_fetch_array($data);
    $username = "root";
    $serverhash = preg_replace("'(\r|\n)'","",$r['srv_hash']);
    $header[0] = "Authorization: WHM root:".$serverhash;
    $header[1] = "Location: https://$server.asmallorange.com:2087/login/";
    header($header[0]);
    header($header[1]);
    
    
    The header appears to be coming across just fine, but I see a 302 redirect immediately after that may be causing the problem.

    Any thoughts?
     
    #1 FrankLaszlo, Jan 28, 2011
    Last edited: Jan 28, 2011
  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Does this happen when you attempt to access say /xml-api/loadavg?

    the login page, if given correct credentials, will redirect.
     
  3. FrankLaszlo

    FrankLaszlo Active Member

    Joined:
    Dec 19, 2008
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Nope. I am using the same database (where the access hash is stored) to run another script that does XML API functions.

    I also have a ticket open about this if you have not seen it yet.

    Thanks Matt!
     
  4. FrankLaszlo

    FrankLaszlo Active Member

    Joined:
    Dec 19, 2008
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    The ticket ID is #1182134 for reference. If you'd like to follow up there instead (it has login information and what not), that would be fine.

    I'll follow up with this post when we figure out a solution.
     
Loading...

Share This Page