WSSecurityException: General security error (WSSecurityEngine: Callback supplied no password

1,037 views
Skip to first unread message

bbe...@directpartners.com

unread,
Oct 2, 2013, 5:22:48 PM10/2/13
to google-doubleclick-...@googlegroups.com
Hi. I'm getting the "Callback supplied no password" error when attempting to call getReport.

I've confirmed that I'm passing the Auth Token and not my profile password. I'm in the production environment. My profile has admin privileges. 

I'm using your PHP examples, with getreport as a function.

function getreportdata($reportId, $username, $authToken, $applicationName) {

// Set SOAP and XML settings. Since there is no Report Central on the test

// environment, reporting examples work against the production environment.

$reportWsdl = 'https://advertisersapi.doubleclick.net/v1.20/api/' .

    'dfa-api/report?wsdl';

$namespace = 'http://www.doubleclick.net/dfa-api/v1.20';

$options = array('encoding' => 'utf-8');

// Get ReportService.

$reportService = new SoapClient($reportWsdl, $options);

// Set headers.

$headers = array(DfaHeadersUtil::createWsseHeader($username, $authToken),

    DfaHeadersUtil::createRequestHeader($namespace, $applicationName));

$reportService->__setSoapHeaders($headers);

print_r($headers);

// Create report request object.

$reportRequest = array(

    'queryId' => 0,

    'reportId' => $reportId);


try {

  // Get report information.

  $result = $reportService->getReport($reportRequest);

} catch (Exception $e) {

  print $e->getMessage();

  exit(1);

}

return $result;

}

This is a dump of $headers (with token obfuscated):
Array ( [0] => SoapHeader Object ( [namespace] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd [name] => Security [data] => SoapVar Object ( [enc_type] => 301 [enc_value] => Array ( [UsernameToken] => SoapVar Object ( [enc_type] => 301 [enc_value] => Array ( [Username] => SoapVar Object ( [enc_type] => 101 [enc_value] => myusername [enc_ns] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd [enc_namens] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ) [Password] => SoapVar Object ( [enc_type] => 101 [enc_value] => 123456789== [enc_ns] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd [enc_namens] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ) ) [enc_ns] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd [enc_name] => UsernameToken [enc_namens] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ) ) [enc_ns] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd [enc_name] => Security [enc_namens] => http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ) [mustUnderstand] => ) [1] => SoapHeader Object ( [namespace] => http://www.doubleclick.net/dfa-api/v1.20 [name] => RequestHeader [data] => SoapVar Object ( [enc_type] => 301 [enc_value] => Array ( [applicationName] => SoapVar Object ( [enc_type] => 101 [enc_value] => DFA [enc_ns] => http://www.doubleclick.net/dfa-api/v1.20 [enc_namens] => http://www.doubleclick.net/dfa-api/v1.20 ) ) [enc_ns] => http://www.doubleclick.net/dfa-api/v1.20 [enc_namens] => http://www.doubleclick.net/dfa-api/v1.20 ) [mustUnderstand] => ) ) WSDoAllReceiver: security processing failed; nested exception is: org.apache.ws.security.WSSecurityException: General security error (WSSecurityEngine: Callback supplied no password for: myusername)

Thanks for any help anyone can provide.

Joseph DiLallo (DFA API Team)

unread,
Oct 3, 2013, 10:27:34 AM10/3/13
to google-doubleclick-...@googlegroups.com, bbe...@directpartners.com
Hey there,

The error message you're seeing is the one that is returned when the $authToken you're passing is incorrect. Are you generating an authentication token from the login service first using Authenticate.php? If so, did you remember to change the URL in Authenticate.php from the test environment (advertisersapitest.doubleclick.net) to production (advertisers.doubleclick.net)?

Cheers,
- Joseph DiLallo, the DFA API Team

Joseph DiLallo (DFA API Team)

unread,
Oct 3, 2013, 1:38:13 PM10/3/13
to google-doubleclick-...@googlegroups.com, bbe...@directpartners.com
Hey all,

I worked with this user offline to figure out what the problem was. For posterity, this was a case of an upgraded DCM account trying to use the report service. The report service cannot be used once an account is upgraded. I'll try to get a better error message put in place.

Regards,
- Joseph DiLallo, the DFA API Team

Brad Benton

unread,
Oct 3, 2013, 12:46:38 PM10/3/13
to Joseph DiLallo (DFA API Team), google-doubleclick-...@googlegroups.com


Thanks Joseph,

I had read that was generally the problem in the forums. But yes, I am generating an auth token with authenticate.php, using that in getreport.php, and I'm using production urls in both pages.

Would there be something different in 1.20 from 1.18?

Thanks,

B.



Authenticate.php:

require_once 'DfaHeadersUtil.php';


// Provide DFA login information.

$username = 'myusername';

$password = 'mypassword';

$applicationName = 'DFA';


// Set SOAP and XML settings. To send requests to the production environment,

// replace "advertisersapitest.doubleclick.net" with

// "advertisersapi.doubleclick.net" in the wsdl URL. The namespace will always

// be "www.doubleclick.net", even in the test environment.

$loginWsdl = 'https://advertisersapi.doubleclick.net/v1.20/api/' .

    'dfa-api/login?wsdl';

$namespace = 'http://www.doubleclick.net/dfa-api/v1.20';

$options = array('encoding' => 'utf-8');


// Get LoginService.

$loginService = new SoapClient($loginWsdl, $options);


// Set header.

$header = DfaHeadersUtil::createRequestHeader($namespace, $applicationName);

$loginService->__setSoapHeaders($header);


try {

  // Authenticate.

  $result = $loginService->authenticate($username, $password);

} catch (Exception $e) {

  print $e->getMessage();

  exit(1);

}


// Display user profile token, DFA account name and network ID.

print "User profile token is \"" . $result->token

    . "\", DFA account name is \"" . $result->networkName

    . "\", and DFA account ID is \"" . $result->networkId . "\".";




Getreport.php:


require_once 'DfaHeadersUtil.php';


// Provide criteria to search upon.

$reportId = (float) 'myreportid';


// Provide information required for DFA headers.

$username = 'myusername';

$authToken = 'token_returned_from_authenticate.php';

$applicationName = 'DFA';


// Set SOAP and XML settings. Since there is no Report Central on the test

// environment, reporting examples work against the production environment.

$reportWsdl = 'https://advertisersapi.doubleclick.net/v1.20/api/' .

    'dfa-api/report?wsdl';

$namespace = 'http://www.doubleclick.net/dfa-api/v1.20';

$options = array('encoding' => 'utf-8');


// Get ReportService.

$reportService = new SoapClient($reportWsdl, $options);


// Set headers.

$headers = array(DfaHeadersUtil::createWsseHeader($username, $authToken),

    DfaHeadersUtil::createRequestHeader($namespace, $applicationName));

$reportService->__setSoapHeaders($headers);


// Create report request object.

$reportRequest = array(

    'queryId' => 0,

    'reportId' => $reportId);


try {

  // Get report information.

  $result = $reportService->getReport($reportRequest);

} catch (Exception $e) {

  print $e->getMessage();

  exit(1);

}


// Display report status and download URL. The URL will be blank if the report

// is not done.

print 'This report\'s status is "' . $result->status->name . '" and URL is "'

    . $result->url . '".\n';



Reply all
Reply to author
Forward
0 new messages