CC-1987 : Automatic upload of recorded shows to Soundcloud
added a method to the php soundcloud api to allow use to connect with a user's username and password.
This commit is contained in:
parent
5ddd670979
commit
10706ec72a
|
@ -260,6 +260,30 @@ class Services_Soundcloud {
|
||||||
return $this->_getAccessToken($postData, $curlOptions);
|
return $this->_getAccessToken($postData, $curlOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve access token.
|
||||||
|
*
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param array $postData Optional post data
|
||||||
|
* @param array $curlOptions Optional cURL options
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
* @see Soundcloud::_getAccessToken()
|
||||||
|
*/
|
||||||
|
function accessTokenResourceOwner($username, $password, $postData = array(), $curlOptions = array()) {
|
||||||
|
$defaultPostData = array(
|
||||||
|
'client_id' => $this->_clientId,
|
||||||
|
'client_secret' => $this->_clientSecret,
|
||||||
|
'grant_type' => 'password',
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password
|
||||||
|
);
|
||||||
|
$postData = array_merge($defaultPostData, $postData);
|
||||||
|
|
||||||
|
return $this->_getAccessToken($postData, $curlOptions);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refresh access token.
|
* Refresh access token.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue