artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
684 stars 216 forks source link

Why file_get_contents? #42

Open ghost opened 10 years ago

ghost commented 10 years ago

Currently the user data is requested using file_get_contents():

    $level = error_reporting(0);

    $response = file_get_contents($endpoint->getAbsoluteUri(), false, $context);
    error_reporting($level);
    if (false === $response) {
        $lastError = error_get_last();
        if (is_null($lastError)) {
            throw new TokenResponseException('Failed to request resource.');
        }
        throw new TokenResponseException($lastError['message']);
    }

My question would be "why?" provided that most of the time, allow_url_fopen is set to OFF (as it should be, for security reasons), and this call will fail.