public function determineAccessToken($headerOnly = FALSE)
    {
		switch ($headerOnly){
			case FALSE:
				$accessToken = $this->requestHandler->getParam($this->tokenKey);
				if ($accessToken !== null){
					break;
				}
			case TRUE:
				$tokenType = $this->getTokenType();
				if (strrpos(get_class($tokenType),"Bearer") !== FALSE){
					$accessToken = $tokenType->determineAccessTokenInHeader($this->requestHandler,$this->authHeader);
				}else{
					$accessToken = $tokenType->determineAccessTokenInHeader($this->requestHandler);
				}
				break;
		}

        if (empty($accessToken)) {
            throw new InvalidRequestException('access token');
        }

        return $accessToken;
    }
public function determineAccessToken($headerOnly = FALSE)
    {
		switch ($headerOnly){
			case FALSE:
				$accessToken = $this->requestHandler->getParam($this->tokenKey);
				if ($accessToken !== null){
					break;
				}
			case TRUE:
				$tokenType = $this->getTokenType();
				if (strrpos(get_class($tokenType),"Bearer") !== FALSE){
					$accessToken = $tokenType->determineAccessTokenInHeader($this->requestHandler,$this->authHeader);
				}else{
					$accessToken = $tokenType->determineAccessTokenInHeader($this->requestHandler);
				}
				break;
		}

        if (empty($accessToken)) {
            throw new InvalidRequestException('access token');
        }

        return $accessToken;
    }
public function determineAccessToken ( $ headerOnly = FALSE ) { switch ( $ headerOnly ) { case FALSE : $ accessToken = $ this -> requestHandler -> getParam ( $ this -> tokenKey ) ; if ( $ accessToken !== null ) { break ; } case TRUE : $ tokenType = $ this -> getTokenType ( ) ; if ( strrpos ( get_class ( $ tokenType ) , "Bearer" ) !== FALSE ) { $ accessToken = $ tokenType -> determineAccessTokenInHeader ( $ this -> requestHandler , $ this -> authHeader ) ; } else { $ accessToken = $ tokenType -> determineAccessTokenInHeader ( $ this -> requestHandler ) ; } break ; } if ( empty ( $ accessToken ) ) { throw new InvalidRequestException ( 'access token' ) ; } return $ accessToken ; }
Reads in the access token from the headers

@param bool $headerOnly Limit Access Token to Authorization header

@throws \OAuth2\Server\Exception\InvalidRequestException Thrown if there is no access token presented

@return string
Reads in the access token from the headers