I'm trying to authenticate into Stack Exchange's API with the following URL:
This returns a redirect with access_token into queryString:
The problem comes when I try to get the redirection with Curl: it return 500 internal server error.
My idea is instantiate an OAuth2 class like this:
$oauth2 = new OAuth2('key', 'client_id', 'scope', 'redirect_uri'); $accessToken = $oauth2->getAccessToken(); // For auth require methods $client = new Client('key', $accessToken); // Without auth $client = new Client();
I don't want to obtain the access_token manually pasting the URL in the browser. I want to generate the token with this four values.
So, any suggestion on how to implement the