X-WSSE AUTHENTICATION (JUST THE SERVER PAGE, THE CLIENT IS MINE)
€10-50 EUR
In Progress
Posted over 8 years ago
€10-50 EUR
Paid on delivery
Hello,
I'm in trouble with WSSE Authentication in PHP. I found a good client and server file for my tests and works fine, but I receive the call in other way, so I must configure my serverside for receiving the right header with username, psw, nonce and created time.
The call:
<?php
class TokenGenerator {
public static function generateToken($username, $password) {
$nonce = self::generateNonce ();
$created = date ( 'Y-m-d\TH:i:sP' );
$digest = base64_encode ( sha1 ( $nonce . $created . $password, TRUE ) );
$token = sprintf ( 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"', $username, $digest, $nonce, $created );
return $token;
}
private static function generateNonce($bits = 256) {
$bytes = ceil ( $bits / 8 ) * microtime ();
$return = '';
for($i = 0; $i < $bytes; $i ++)
$return .= chr ( mt_rand ( 0, 255 ) );
return md5 ( $return );
}
}
$xwsse = TokenGenerator::generateToken ( 'username', 'RC&EWoiQ7#!!' ); // ### GENERO IL TOKEN
$httpRequest = new \HttpRequest (
'http://XXXX/',
\HttpRequest::METH_POST, [
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept-Charset' => 'UTF-8',
'X-Wsse' => $xwsse
],
'protocol' => HTTP_VERSION_1_2
]
);
$httpRequest->setPostFields ( [
'userName' => 'testAgentnip',
'phoneNumber' => '3474875366',
'customer' => '112233'
] ) or die ( 'Errore' );
try {
$result = $httpRequest->send()->getBody ();
echo $result;
} catch ( \HttpException $ex ) {
error_log ( 'ERRORE CHIAMATA HTTP => ' . $ex->getMessage () );
}
Now I need a page which receive this kind of header.
I've been looking for getallheaders() function, but still doesn't work
Dear Sir,
Thank you for giving me a chance to bid on your project. i am a serious bidder here and i have already worked on a similar project before and can deliver as u have mentioned
I have checked your requirements.i have right skills to work on this assignment
my award = superb result = happy client. In a good partnership, good results happen. Good cooking makes good eating!BWe consider our client as our partner.
can u provide your email or sky-pe etc for further discussion about the project.
I am ready to discuss with you
with best Regards
€33 EUR in 3 days
0.0 (2 reviews)
0.0
0.0
1 freelancer is bidding on average €33 EUR for this job