Customer Portal

Get Involved. Join the Conversation.

Topic

    Outspark
    Pass-through Authentication ProblemsAnswered
    Topic posted December 8, 2008 by Outspark Green Ribbon: 100+ Points, last edited October 29, 2011 
    3058 Views, 16 Comments
    Title:
    Pass-through Authentication Problems
    Content:

    Hey All,

     

    I am tying RN into our company site. I am dynamically generating (in PHP) a url, which is later used to perform a redirect. I am trying to redirect a user to RN, passing the required arguments, which is supposed log a user into RN and/or create a new user record if that user does not exist. I talked to a project manager at RN... she mentioned that my script is using a deprecated address to the end-user interface, but I followed the exact instructions of integration guide 8.2...

     

    Can someone please take a look and verify that I am taking the appropriate steps?

     

    <code>

     

    $params['p_userid'] = 12341234;  // phony data
    $params['p_passwd'] = 's8df6tsdf76tsd';
    $params['p_email'] = 'nobody@nowhere.com';
    $params['p_li_passwd'] = 'mymyseclipasswd';
      

    // iterate through array and url encode + build queryparam string
      foreach ($params as $key => $value) {
       
       $params_str .= $key.'='.urlencode($value).'&';
      }

     

    // declare base redirect url
    $redirect_url = 'http://<some company>.custhelp.com/cgi-bin/<some company>.cfg/php/enduser/entry.php?p_li=';

    // append encoded query param string (substr to remove trailing amper)
    $redirect_url .= base64_encode(strtr(substr($params_str, 0, -1), array('+' => '_', '/' => '~', '=' => '*')));

     

    // redirect browser

    header("Location: $redirect_url");

    exit;

     

    </code>

    Best Comment

    Ernie Turner

    When I decode the string, this is what I'm getting

     

    [p_userid] => none [p_passwd] => password [p_email.addr] => none@none.com [p_li_passwd] => myseclipasswd&

    As you can see, the extra & at the end of p_li_passwd is whats causing this problem. When you're iterating over the parameters, just make sure you dont append the & to the end of the last item and that should fix it.

     

     

    Comment

    • dmorgan

      Ernie,

       

      YES, It works! I don't know what I was thinking, as I took care of that problem in the php version. Thanks a lot!