Hi Manuel,
i have a problem with Oauth at Discogs. Discogs now use https instead of http.
I got the latest oauth api, and copied it to my web-server, but i got the following error message:
OAuth client error
Error: it was not possible to open the OAuth request token URL: 0 could not connect to the host "api.discogs.com"
OAuth client: Checking the OAuth token authorization state
OAuth client: The OAuth access token is not set
OAuth client: Requesting the unauthorized OAuth token
OAuth client: Accessing the OAuth request token at https://api.discogs.com/oauth/request_token
OAuth client: Error: it was not possible to open the OAuth request token URL: 0 could not connect to the host "api.discogs.com"
I try to explain my doing:
I have a vb-script (Discogs-Tagger from MediaMonkey), which send a http-post to my web-server:
germanc64.de/mm/oauth/oauth_guid.ph
...
The oauth_guid.php on the web-server do the authentication. Here is the importand content of it:
require('http.php');
require('oauth_client.php');
$client = new oauth_client_class;
$client->debug = true;
$client->debug_http = true;
$client->server = 'Discogs';
$f = $_GET["f"];
$client->redirect_uri = 'http://'.$_SERVER['HTTP_HOST'].
dirname(strtok($_SERVER['REQUEST_URI'],'?')).'/oauth_guid.php?f=' . $f;
$client->client_id = 'otAQdlbdkiijJomXiHSS'; $application_line = __LINE__;
$client->client_secret = 'deleted';
$f = $_GET["f"];
if(($success = $client->Initialize()))
{
if(($success = $client->Process()))
{
$success = $client->CallAPI(
'https://api.discogs.com/oauth/identity',
'GET', array(), array('FailOnAccessError'=>true), $user);
}
$success = $client->Finalize($success);
}
Do you know what i do wrong? If i change the https:// into http://api.discogs.com it works great.
I hope you can help me, thank you in advance.