ricbra / php-discogs-api

PHP 5.4 Implementation of the Discogs API
MIT License
152 stars 95 forks source link

Token & token? #23

Closed nundos closed 9 years ago

nundos commented 9 years ago

Hi there!

Totally new to both Oauth and Guzzle and having issues with these 2 lines in your example. https://github.com/ricbra/php-discogs-api#oauth

‘token’ => $token[‘oauth_token’], // get this using a OAuth library ‘token_secret’ => $token[‘oauth_token_secret’] // get this using a OAuth library

How does the tokens work? I know I can get one from my Discogs developer admin but it doesn't work?

Need this to loop out album covers from a marketplace. That aside, thanks for a nice library!

PEACE

ricbra commented 9 years ago

Hi @nundos

When I find the time I'll expand the docs on this specific topic.

In a nutshell: To use the OAuth protected endpoints, a user is required to have an account at Discogs. You implement a OAuth integration with Discogs so users from your website will be redirect to Discogs to allow your application to access their account. Just as a Facebook sign in.

The token and token_secret come from Discogs when a user has completed this process.

ricbra commented 9 years ago

I've created an example implementation: https://github.com/ricbra/php-discogs-api-example

Also added a reference in the docs, so closing this.