php-soundcloud icon indicating copy to clipboard operation
php-soundcloud copied to clipboard

Authenticating without the SoundCloud Connect Screen

Open ghaliano opened this issue 10 years ago • 0 comments

Hi, when reading this section from the doc https://developers.soundcloud.com/docs/api/guide#authentication the php code section throw this message: // this example is not supported by the PHP SDK

otherwise there is a tricky way to do that: https://github.com/ghaliano/awesome-media/blob/master/MediaGateway/src/MediaGateway/ProviderClientFactory.php#L29

           $client = new \Soundcloud\Service(
                $config['api_key'], 
                $config['secret_key']
            );
            $client->setAccessToken(
                $client->credentialsFlow($config['login'], 
                $config['password'])['access_token']
            );

plz see it in action here: https://github.com/ghaliano/awesome-media/blob/master/Demo/demo.php

ghaliano avatar Apr 02 '15 20:04 ghaliano