kernel/private/rest/classes/oauth/utility.php
protected static function getTokenFromAuthorizationHeader()
    {
        $token = null;
        $authHeader = null;
        if ( function_exists( 'apache_request_headers' ) )
        {
            $apacheHeaders = apache_request_headers();
            if ( isset( $apacheHeaders[self::AUTH_HEADER_NAME] ) )
                $authHeader = $apacheHeaders[self::AUTH_HEADER_NAME];
        }
        else
        {
            if ( isset( $_SERVER[self::AUTH_CGI_HEADER_NAME] ) )
                $authHeader = $_SERVER[self::AUTH_CGI_HEADER_NAME];
        }

        if ( isset( $authHeader ) )
        {
            $tokenPattern = "/^(?P<authscheme>OAuth)\s(?P<token>[a-zA-Z0-9]+)$/";
            $match = preg_match( $tokenPattern, $authHeader, $m );
            if ( $match > 0 )
            {
                $token = $m['token'];
            }
        }


        return $token;
    }
protected static function getTokenFromAuthorizationHeader()
    {
        $token = null;
        $authHeader = null;
        if ( function_exists( 'apache_request_headers' ) )
        {
            $apacheHeaders = apache_request_headers();
            if ( isset( $apacheHeaders[self::AUTH_HEADER_NAME] ) )
                $authHeader = $apacheHeaders[self::AUTH_HEADER_NAME];
        }
        else
        {
            if ( isset( $_SERVER[self::AUTH_CGI_HEADER_NAME] ) )
                $authHeader = $_SERVER[self::AUTH_CGI_HEADER_NAME];
        }

        if ( isset( $authHeader ) )
        {
            $tokenPattern = "/^(?P<authscheme>OAuth)\s(?P<token>[a-zA-Z0-9]+)$/";
            $match = preg_match( $tokenPattern, $authHeader, $m );
            if ( $match > 0 )
            {
                $token = $m['token'];
            }
        }


        return $token;
    }
protected static function getTokenFromAuthorizationHeader ( ) { $ token = null ; $ authHeader = null ; if ( function_exists ( 'apache_request_headers' ) ) { $ apacheHeaders = apache_request_headers ( ) ; if ( isset ( $ apacheHeaders [ self :: AUTH_HEADER_NAME ] ) ) $ authHeader = $ apacheHeaders [ self :: AUTH_HEADER_NAME ] ; } else { if ( isset ( $ _SERVER [ self :: AUTH_CGI_HEADER_NAME ] ) ) $ authHeader = $ _SERVER [ self :: AUTH_CGI_HEADER_NAME ] ; } if ( isset ( $ authHeader ) ) { $ tokenPattern = "/^(?P<authscheme>OAuth)\s(?P<token>[a-zA-Z0-9]+)$/" ; $ match = preg_match ( $ tokenPattern , $ authHeader , $ m ) ; if ( $ match > 0 ) { $ token = $ m [ 'token' ] ; } } return $ token ; }
Extracts the OAuth token from the HTTP header, Authorization.

The token is transmitted via the OAuth Authentication scheme ref.
Section 5.1.1.

PHP does not expose the Authorization header unless it uses the 'Basic'
or 'Digest' schemes, and it is therefore extracted from the raw Apache
headers.

On systems running CGI or Fast-CGI PHP makes this header available via
the <var>HTTP_AUTHORIZATION</var> header.
@link http://php.net/manual/en/features.http-auth.php
@throws ezpOauthInvalidRequestException
@return string The access token string.
Extracts the OAuth token from the HTTP header Authorization .