php-http / message

HTTP Message related tools
http://php-http.org
MIT License
1.3k stars 42 forks source link

WSSE Authentication #144

Open template-provider opened 3 years ago

template-provider commented 3 years ago

PHP version: 7.2

Description Cannot authenticate with WSSE Plugin

How to reproduce Use WSSE REST Api like emarsys rest api

Possible Solution Change line in Wsse.php

$digest = base64_encode(hash($this->hashAlgorithm, $nonce.$created.$this->password, false));

Additional context I am trying to auth against a wsse api from emarsys. But the auth does not work correctly with the current implementation. Current:

$digest = base64_encode(hash($this->hashAlgorithm, base64_decode($nonce).$created.$this->password, true));

The base64_decode is not needed because the nonce creation is using a md5. The parameter binary should be false instead of true, than the auth works. Can anybody reproduce this? Thx