public function updateCredentials(ActionRequest $actionRequest)
    {
        $this->credentials = ['username' => null, 'password' => null];
        $this->authenticationStatus = self::NO_CREDENTIALS_GIVEN;

        $authorizationHeader = $actionRequest->getHttpRequest()->getHeaders()->get('Authorization');
        if (strpos($authorizationHeader, 'Basic ') !== 0) {
            return;
        }

        $credentials = base64_decode(substr($authorizationHeader, 6));
        list($username, $password) = explode(':', $credentials, 2);
        $this->credentials['username'] = $username;
        $this->credentials['password'] = $password;
        $this->authenticationStatus = self::AUTHENTICATION_NEEDED;
    }
public function updateCredentials(ActionRequest $actionRequest)
    {
        $this->credentials = ['username' => null, 'password' => null];
        $this->authenticationStatus = self::NO_CREDENTIALS_GIVEN;

        $authorizationHeader = $actionRequest->getHttpRequest()->getHeaders()->get('Authorization');
        if (strpos($authorizationHeader, 'Basic ') !== 0) {
            return;
        }

        $credentials = base64_decode(substr($authorizationHeader, 6));
        list($username, $password) = explode(':', $credentials, 2);
        $this->credentials['username'] = $username;
        $this->credentials['password'] = $password;
        $this->authenticationStatus = self::AUTHENTICATION_NEEDED;
    }
public function updateCredentials ( ActionRequest $ actionRequest ) { $ this -> credentials = [ 'username' => null , 'password' => null ] ; $ this -> authenticationStatus = self :: NO_CREDENTIALS_GIVEN ; $ authorizationHeader = $ actionRequest -> getHttpRequest ( ) -> getHeaders ( ) -> get ( 'Authorization' ) ; if ( strpos ( $ authorizationHeader , 'Basic ' ) !== 0 ) { return ; } $ credentials = base64_decode ( substr ( $ authorizationHeader , 6 ) ) ; list ( $ username , $ password ) = explode ( ':' , $ credentials , 2 ) ; $ this -> credentials [ 'username' ] = $ username ; $ this -> credentials [ 'password' ] = $ password ; $ this -> authenticationStatus = self :: AUTHENTICATION_NEEDED ; }
Updates the username and password credentials from the HTTP authorization header.
Sets the authentication status to AUTHENTICATION_NEEDED, if the header has been
sent, to NO_CREDENTIALS_GIVEN if no authorization header was there.

@param ActionRequest $actionRequest The current action request instance
@return void
Updates the username and password credentials from the HTTP authorization header . Sets the authentication status to AUTHENTICATION_NEEDED if the header has been sent to NO_CREDENTIALS_GIVEN if no authorization header was there .