Code sample InitAuth - PHP

 

ini_set('soap.wsdl_cache_enabled', 0);

ini_set('soap.wsdl_cache_ttl', 0);

$DistributorID = "Contact Signant for DistributorID";

$AccessCode = "Contact Signant for AccessCode";

$atservices_wsdl = "https://test3.signant.no/Auth/AuthService.svc?wsdl";

$atservices_client = new SoapClient($atservices_wsdl, array("trace" => 1, "exception" => 0, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL, 'encoding'=>'ISO-8859-1'));

//print_r($atservices_client);

$authTypes = array(

'NO_BuyPass',

'NO_BankID'

);

$AuthenticationOptions = array(

'AuthTypes' => $authTypes ,

'NextUrl'=>'https://www.google.com/login.done',

'CancelUrl'=> 'https://www.google.com/login.cancel',

'ReturnSSN' => false

);

$result = $atservices_client->InitAuth(array("DistributorID" => $DistributorID, "AccessCode" => $AccessCode, "AuthOptions" => $AuthenticationOptions));

print_r($result);

print_r("<hr>");

$newURL = $result->InitAuthResult->AuthenticationUrl;

header('Location: '.$newURL);