Auth And Headlines In Yii Soap Server


Use yii2 (advanced), developed soap api service using,

Need to arrange authorization, that is, that the methods can access only by authorized users.

In the client, pass a parameter name and password:

$client = new SoapClient('http://localhost/api/soap', [

    'login' => 'somelogin', 

    'password' => 'somepass', 


In the $_SERVER they appear:


    'PHP_AUTH_USER' => 'somelogin', 

    'PHP_AUTH_PW' => 'somepass', 


And here is how to read them with soap header and where do not really understand, though sought. Who is inherited from \subdee\soapserver\SoapAction and redefined method beforeRun() (or beforeAction($action) in controller), there can be to try to implement a check using the $_SERVER, but it seems some anal way and maybe have a solution is more beautiful?

Questions. How to read soaphedery in the controller, how to organize the authorization, how to access this service soap (if possible) from the controller.

Thank you.


Sorry for my english. ;)