Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by 2359967
Bounty Started worth 50 reputation by 2359967
deleted 29 characters in body
Source Link
2359967
  • 103
  • 6

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

EDIT

My idea is instantiate an OAuth2 class like this:

$client = new Client();
$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 getAccessToken() method?

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

EDIT

My idea is instantiate an OAuth2 class like this:

$client = new Client();
$oauth2 = new OAuth2('key', 'client_id', 'scope', 'redirect_uri'); 
$accessToken = $oauth2->getAccessToken();

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 getAccessToken() method?

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

EDIT

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 getAccessToken() method?

Some considerations
Source Link
2359967
  • 103
  • 6

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

EDIT

Any suggestions?My idea is instantiate an OAuth2 class like this:

$client = new Client();
$oauth2 = new OAuth2('key', 'client_id', 'scope', 'redirect_uri'); 
$accessToken = $oauth2->getAccessToken();

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 getAccessToken() method?

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

Any suggestions?

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

EDIT

My idea is instantiate an OAuth2 class like this:

$client = new Client();
$oauth2 = new OAuth2('key', 'client_id', 'scope', 'redirect_uri'); 
$accessToken = $oauth2->getAccessToken();

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 getAccessToken() method?

added 90 characters in body
Source Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64

I'm trying to authenticate into StackExchange's ApiStack Exchange's API with the following urlURL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

enter image description hereOAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

Any suggestions?

I'm trying to authenticate into StackExchange's Api with the following url:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

enter image description here

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

Any suggestions?

I'm trying to authenticate into Stack Exchange's API with the following URL:

https://stackexchange.com/oauth/dialog?client_id=3535&scope=write_access&redirect_uri=https://stackexchange.com/oauth/login_success

This returns a redirect with access_token into queryString:

OAuth response

The problem comes when I try to get the redirection with Curl: it return 500 internal server error.

Any suggestions?

Source Link
2359967
  • 103
  • 6
Loading