Auth And Headlines In Yii Soap Server

Hello!

Use yii2 (advanced), developed soap api service using http://www.yiiframework.com/extension/yii2-soap-server/, https://github.com/subdee/yii2-soap-server/.

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.

ps

Sorry for my english. ;)

up