Page 1 of 1

AUTH Redirect URL incorrect

Posted: Thu Jul 18, 2013 3:38 pm
by fyaconiello
When I try to get an auth token from the API it redirects me into an error page. It appears that the configured redirect url has an issue.

If I go in my browser to: ... &password=*******

It redirects me here: ... b2545db05e (this page of course doesn't exist)

I believe it should be redirecting to here: ... b2545db05e

Re: AUTH Redirect URL incorrect

Posted: Fri Jul 19, 2013 9:52 am
by hpanesar

This issue has now been resolved. The URL was not complete and I have now modified this.

You should now be able to reach the URL without error.


Harjot Panesar

Re: AUTH Redirect URL incorrect

Posted: Fri Jul 19, 2013 11:00 am
by fyaconiello
I'm attempting to connect to the REST API programmatically as part of a job board. The website needs to be able to make REST calls w/o user interaction. I got the following function from another post in this forum and people seem to be having luck using it. However it isn't working for me.

Code: Select all

function getAuthCode()
    $url = "";
    $url = sprintf($url, CLIENT_ID, USER, PASS);
    $data = sprintf("action=Login&username=%s&password=%s", USER, PASS);
    echo sprintf("GET BULLHORN ACCESS TOKEN URL:\n%s\n", $url);

    $curl = curl_init( $url ); 
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, true);
    #curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_AUTOREFERER, true);
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120);
    curl_setopt($curl, CURLOPT_TIMEOUT, 120);
    #curl_setopt($curl, CURLOPT_NOBODY, true);
    $content = curl_exec( $curl );
    #print_r(curl_getinfo($curl, CURLINFO_EFFECTIVE_URL));
    curl_close( $curl );//die($content);  
    if(preg_match('#Location: (.*)#', $content, $r))
        $l = trim($r[1]);
        $temp = preg_split("/code=/", $l);
        $authcode = $temp[1];

    return $authcode;
I get the following response back from CURL

Code: Select all

$ php includes/rest/connection.php 
GET BULLHORN ACCESS TOKEN URL:************&password=***********

HTTP/1.1 200 OK
Date: Fri, 19 Jul 2013 14:57:34 GMT
Server: Apache-Coyote/1.1
Content-Type: text/html; charset=UTF-8
Set-Cookie: oAuthSession="-wuZ2RsV_hDYvM6XHErZII0bebMvHPsEN7jynVaTf2vEqoprk9gLdcLQjLQJvWJYKKVVG8kpRaNM8rhFDTr9I5QnDeiSTENWOHiiaKSlIR8oJJIIhxJvCI--9QI2L7qi3xhUY2ne1gxauuA9h5RHpcJ8tdJDa5l61aMkGfvO6Rk="; Version=1;; Path=/
Set-Cookie: JSESSIONID=497F16CAB0AA89E9B9A62230957F2497; Path=/bullhorn-oauth-services-2.0/; HttpOnly
nnCoection: close
Transfer-Encoding: chunked

	<title>Bullhorn OAuth - Get Consent</title>
	<meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-touch-fullscreen" content="yes">
    <link rel='stylesheet' type='text/css' href='/oauth/css/consent.css'/>
    <link rel='localizations' type='text/json' href='l10n/localizations.json' />
    <script type="text/javascript" src="js/json2.js"></script>
    <script type="text/javascript" src="js/l10n.js"></script>
    <script type="text/javascript">
        document.getElementById('tos').innerHTML = "Terms of Service".localize();
        document.getElementById('agreetxt').innerHTML = "Agree".localize();
        document.getElementById('declinetxt').innerHTML = "Decline".localize();
<body class="login" style="width: 100% !important; height: 100% !important;">
	<form method="post" style="width:100%;">
		<input type="hidden" name="corporationId" value="5394" />
		<input type="hidden" name="masterUserId" value="5305612" />

		<div class="x-docking-vertical">
	        <div id="appLogoPanel"></div>
			<h1>Subsurface Global</h1>
			<h2 id="tos" >Terms of Service</h2>
	        <td valign="top">NA</td>
	<div class="x-container buttons">
       	<div class="x-container buttonContainer">
	        <div class="x-button" onClick="document.getElementById('agreebtn').click();">
	        	<span id="agreetxt" class="x-button-label">Agree</span>
	        	<input id="agreebtn" type="submit" name="action" value="Agree">
    	<div class="x-container buttonContainer">
	  		 <div class="x-button" onClick="document.getElementById('declinebtn').click();">
	        	<span id="declinetxt" class="x-button-label">Decline</span>
				<input id="declinebtn" type="submit" name="action" value="Decline">

how do I without user intervention get an auth code? My code is unable to click "Agree" on the intermediary TOS page.

Re: AUTH Redirect URL incorrect

Posted: Fri Jul 19, 2013 2:57 pm
by fyaconiello
When i go to the Login page in a browser and try to accept the TOS, a javascript error occurs which causes me to be unable to continue forward.
Screen Shot 2013-07-19 at 11.41.00 AM.png
screenshot of BH failure
Screen Shot 2013-07-19 at 11.41.00 AM.png (118.33 KiB) Viewed 14472 times

Re: AUTH Redirect URL incorrect

Posted: Sat Jan 11, 2014 4:49 pm
by ghempton
I am having this exact issue. Did you ever come up with a solution?

Re: AUTH Redirect URL incorrect

Posted: Wed Jan 15, 2014 7:56 pm
by ghempton
In our case, it turned out that this obscure page was being shown to us due to the wrong password being specified.