src/EightPoints/Guzzle/WsseAuthMiddleware.php
public function attach()
    {
        return function (callable $handler) {

            return function (RequestInterface $request, array $options) use ($handler) {

                $createdAt = $this->getCreatedAt()->format('c');
                $nonce = $this->generateNonce();
                $digest = $this->generateDigest($nonce, $createdAt, $this->password);

                $xwsse = array(
                    sprintf('Username="%s"', $this->username),
                    sprintf('PasswordDigest="%s"', $digest),
                    sprintf('Nonce="%s"', $nonce),
                    sprintf('Created="%s"', $createdAt)
                );

                $request = $request->withHeader('Authorization', 'WSSE profile="UsernameToken"');
                $request = $request->withHeader('X-WSSE', sprintf('UsernameToken %s', implode(', ', $xwsse)));

                return $handler($request, $options);
            };
        };
    }
public function attach()
    {
        return function (callable $handler) {

            return function (RequestInterface $request, array $options) use ($handler) {

                $createdAt = $this->getCreatedAt()->format('c');
                $nonce = $this->generateNonce();
                $digest = $this->generateDigest($nonce, $createdAt, $this->password);

                $xwsse = array(
                    sprintf('Username="%s"', $this->username),
                    sprintf('PasswordDigest="%s"', $digest),
                    sprintf('Nonce="%s"', $nonce),
                    sprintf('Created="%s"', $createdAt)
                );

                $request = $request->withHeader('Authorization', 'WSSE profile="UsernameToken"');
                $request = $request->withHeader('X-WSSE', sprintf('UsernameToken %s', implode(', ', $xwsse)));

                return $handler($request, $options);
            };
        };
    }
public function attach ( ) { return function ( callable $ handler ) { return function ( RequestInterface $ request , array $ options ) use ( $ handler ) { $ createdAt = $ this -> getCreatedAt ( ) -> format ( 'c' ) ; $ nonce = $ this -> generateNonce ( ) ; $ digest = $ this -> generateDigest ( $ nonce , $ createdAt , $ this -> password ) ; $ xwsse = array ( sprintf ( 'Username="%s"' , $ this -> username ) , sprintf ( 'PasswordDigest="%s"' , $ digest ) , sprintf ( 'Nonce="%s"' , $ nonce ) , sprintf ( 'Created="%s"' , $ createdAt ) ) ; $ request = $ request -> withHeader ( 'Authorization' , 'WSSE profile="UsernameToken"' ) ; $ request = $ request -> withHeader ( 'X-WSSE' , sprintf ( 'UsernameToken %s' , implode ( ', ' , $ xwsse ) ) ) ; return $ handler ( $ request , $ options ) ; } ; } ; }
Add WSSE auth headers to Request

@version 3.0
@since   2015-06

@return callable
@throws \InvalidArgumentException
Add WSSE auth headers to Request