src/OAuth2/ClientAssertionType/HttpBasic.php
public function getClientCredentials(RequestInterface $request, ResponseInterface $response = null)
    {
        if (!is_null($request->headers('PHP_AUTH_USER')) && !is_null($request->headers('PHP_AUTH_PW'))) {
            return array('client_id' => $request->headers('PHP_AUTH_USER'), 'client_secret' => $request->headers('PHP_AUTH_PW'));
        }

        if ($this->config['allow_credentials_in_request_body']) {
            // Using POST for HttpBasic authorization is not recommended, but is supported by specification
            if (!is_null($request->request('client_id'))) {
                /**
                 * client_secret can be null if the client's password is an empty string
                 * @see http://tools.ietf.org/html/rfc6749#section-2.3.1
                 */
                return array('client_id' => $request->request('client_id'), 'client_secret' => $request->request('client_secret'));
            }
        }

        if ($response) {
            $message = $this->config['allow_credentials_in_request_body'] ? ' or body' : '';
            $response->setError(400, 'invalid_client', 'Client credentials were not found in the headers'.$message);
        }

        return null;
    }
public function getClientCredentials(RequestInterface $request, ResponseInterface $response = null)
    {
        if (!is_null($request->headers('PHP_AUTH_USER')) && !is_null($request->headers('PHP_AUTH_PW'))) {
            return array('client_id' => $request->headers('PHP_AUTH_USER'), 'client_secret' => $request->headers('PHP_AUTH_PW'));
        }

        if ($this->config['allow_credentials_in_request_body']) {
            // Using POST for HttpBasic authorization is not recommended, but is supported by specification
            if (!is_null($request->request('client_id'))) {
                /**
                 * client_secret can be null if the client's password is an empty string
                 * @see http://tools.ietf.org/html/rfc6749#section-2.3.1
                 */
                return array('client_id' => $request->request('client_id'), 'client_secret' => $request->request('client_secret'));
            }
        }

        if ($response) {
            $message = $this->config['allow_credentials_in_request_body'] ? ' or body' : '';
            $response->setError(400, 'invalid_client', 'Client credentials were not found in the headers'.$message);
        }

        return null;
    }
public function getClientCredentials ( RequestInterface $ request , ResponseInterface $ response = null ) { if ( ! is_null ( $ request -> headers ( 'PHP_AUTH_USER' ) ) && ! is_null ( $ request -> headers ( 'PHP_AUTH_PW' ) ) ) { return array ( 'client_id' => $ request -> headers ( 'PHP_AUTH_USER' ) , 'client_secret' => $ request -> headers ( 'PHP_AUTH_PW' ) ) ; } if ( $ this -> config [ 'allow_credentials_in_request_body' ] ) { // Using POST for HttpBasic authorization is not recommended, but is supported by specification if ( ! is_null ( $ request -> request ( 'client_id' ) ) ) { /**
                 * client_secret can be null if the client's password is an empty string
                 * @see http://tools.ietf.org/html/rfc6749#section-2.3.1
                 */ return array ( 'client_id' => $ request -> request ( 'client_id' ) , 'client_secret' => $ request -> request ( 'client_secret' ) ) ; } } if ( $ response ) { $ message = $ this -> config [ 'allow_credentials_in_request_body' ] ? ' or body' : '' ; $ response -> setError ( 400 , 'invalid_client' , 'Client credentials were not found in the headers' . $ message ) ; } return null ; }
Internal function used to get the client credentials from HTTP basic
auth or POST data.

According to the spec (draft 20), the client_id can be provided in
the Basic Authorization header (recommended) or via GET/POST.

@param RequestInterface  $request
@param ResponseInterface $response
@return array|null A list containing the client identifier and password, for example:
@code
return array(
"client_id"     => CLIENT_ID,        // REQUIRED the client id
"client_secret" => CLIENT_SECRET,    // OPTIONAL the client secret (may be omitted for public clients)
);
@endcode

@see http://tools.ietf.org/html/rfc6749#section-2.3.1

@ingroup oauth2_section_2
Internal function used to get the client credentials from HTTP basic auth or POST data .